| 934 | } |
| 935 | |
| 936 | void TextureViewer::UI_UpdateStatusText() |
| 937 | { |
| 938 | TextureDescription *texptr = GetCurrentTexture(); |
| 939 | if(texptr == NULL) |
| 940 | return; |
| 941 | |
| 942 | TextureDescription &tex = *texptr; |
| 943 | |
| 944 | CompType compType = tex.format.compType; |
| 945 | |
| 946 | const bool yuv = |
| 947 | (tex.format.type == ResourceFormatType::YUV8 || tex.format.type == ResourceFormatType::YUV10 || |
| 948 | tex.format.type == ResourceFormatType::YUV12 || tex.format.type == ResourceFormatType::YUV16); |
| 949 | |
| 950 | if(tex.format.compType != m_TexDisplay.typeCast && m_TexDisplay.typeCast != CompType::Typeless && |
| 951 | !yuv) |
| 952 | compType = m_TexDisplay.typeCast; |
| 953 | |
| 954 | bool dsv = (tex.creationFlags & TextureCategory::DepthTarget) || (compType == CompType::Depth) || |
| 955 | (tex.format.type == ResourceFormatType::S8); |
| 956 | bool uintTex = (compType == CompType::UInt); |
| 957 | bool sintTex = (compType == CompType::SInt); |
| 958 | |
| 959 | if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass || |
| 960 | m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw || |
| 961 | m_TexDisplay.overlay == DebugOverlay::TriangleSizePass || |
| 962 | m_TexDisplay.overlay == DebugOverlay::TriangleSizeDraw) |
| 963 | { |
| 964 | dsv = false; |
| 965 | uintTex = false; |
| 966 | sintTex = false; |
| 967 | } |
| 968 | |
| 969 | QColor swatchColor; |
| 970 | |
| 971 | if(dsv || uintTex || sintTex) |
| 972 | { |
| 973 | swatchColor = QColor(0, 0, 0); |
| 974 | } |
| 975 | else |
| 976 | { |
| 977 | float r = qBound(0.0f, m_CurHoverValue.floatValue[0], 1.0f); |
| 978 | float g = qBound(0.0f, m_CurHoverValue.floatValue[1], 1.0f); |
| 979 | float b = qBound(0.0f, m_CurHoverValue.floatValue[2], 1.0f); |
| 980 | |
| 981 | swatchColor = QColor(int(255.0f * r), int(255.0f * g), int(255.0f * b)); |
| 982 | } |
| 983 | |
| 984 | { |
| 985 | QPalette Pal(palette()); |
| 986 | |
| 987 | Pal.setColor(QPalette::Background, swatchColor); |
| 988 | |
| 989 | ui->pickSwatch->setAutoFillBackground(true); |
| 990 | ui->pickSwatch->setPalette(Pal); |
| 991 | } |
| 992 | |
| 993 | uint32_t mipWidth = qMax(1U, tex.width >> (int)m_TexDisplay.subresource.mip); |
nothing calls this directly
no test coverage detected