From 186ca3004542430fd85e7d977bf339f85b8f464e Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 25 Nov 2019 10:46:19 +0000 Subject: [PATCH] Treat binding viewcasts are always definitive * On APIs like vulkan the view casting happens from an already typed format, so don't assume that casts are only applied when the underlying format is typeless. When a cast is not valid the view format should never be different from the underlying image format as the API should never make it possible to validly create or bind a view with a different format. --- qrenderdoc/Windows/TextureViewer.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index ded22d711..8419645ad 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -914,16 +914,19 @@ void TextureViewer::UI_UpdateStatusText() TextureDescription &tex = *texptr; - bool dsv = (tex.creationFlags & TextureCategory::DepthTarget) || - (tex.format.compType == CompType::Depth); - bool uintTex = (tex.format.compType == CompType::UInt); - bool sintTex = (tex.format.compType == CompType::SInt); + CompType compType = tex.format.compType; - if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::UInt) - uintTex = true; + const bool yuv = + (tex.format.type == ResourceFormatType::YUV8 || tex.format.type == ResourceFormatType::YUV10 || + tex.format.type == ResourceFormatType::YUV12 || tex.format.type == ResourceFormatType::YUV16); - if(tex.format.compType == CompType::Typeless && m_TexDisplay.typeCast == CompType::SInt) - sintTex = true; + if(tex.format.compType != m_TexDisplay.typeCast && m_TexDisplay.typeCast != CompType::Typeless && + !yuv) + compType = m_TexDisplay.typeCast; + + bool dsv = (tex.creationFlags & TextureCategory::DepthTarget) || (compType == CompType::Depth); + bool uintTex = (compType == CompType::UInt); + bool sintTex = (compType == CompType::SInt); if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass || m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw ||