Display default 'viewed as' for typeless textures. Closes #1351

* Typeless textures must be interpreted as some kind of format, so without a
  better hint we use UNORM as a default. Ensure that this is listed explicitly
This commit is contained in:
baldurk
2019-04-22 16:16:17 +01:00
parent a1a89824d9
commit 11e8bdb209
+13 -1
View File
@@ -1078,11 +1078,23 @@ void TextureViewer::UI_UpdateTextureDetails()
current.format.type == ResourceFormatType::YUV12 ||
current.format.type == ResourceFormatType::YUV16);
CompType viewCast = CompType::Typeless;
if(current.format.compType != m_TexDisplay.typeHint &&
m_TexDisplay.typeHint != CompType::Typeless && !yuv)
{
status += tr(" Viewed as %1").arg(ToQStr(m_TexDisplay.typeHint));
viewCast = m_TexDisplay.typeHint;
}
else if(current.format.compType == CompType::Typeless &&
m_TexDisplay.typeHint == CompType::Typeless && !yuv)
{
// if it's a typeless texture and we don't have a hint, ensure the user knows it's being viewed
// as unorm as a fallback
viewCast = CompType::UNorm;
}
if(viewCast != CompType::Typeless)
status += tr(" Viewed as %1").arg(ToQStr(viewCast));
ui->texStatusDim->setText(status);
}