From 49669d676ea8aab39cb6efd287a16cdccc8b8533 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 21 Feb 2016 15:36:05 +0100 Subject: [PATCH] Identify depth textures by depth format, not just having DSV flag --- renderdoc/replay/replay_output.cpp | 1 + renderdocui/Windows/TextureViewer.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index 35ceb80c4..43bbbec41 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -204,6 +204,7 @@ bool ReplayOutput::AddThumbnail(void *wnd, ResourceId texID) if(m_pRenderer->m_Textures[t].ID == texID) { depthMode = (m_pRenderer->m_Textures[t].creationFlags & eTextureCreate_DSV) > 0; + depthMode |= (m_pRenderer->m_Textures[t].format.compType == eCompType_Depth); break; } } diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index ef0fd1ad2..346d0b6c5 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -1893,7 +1893,7 @@ namespace renderdocui.Windows if (tex == null) return; - bool dsv = ((tex.creationFlags & TextureCreationFlags.DSV) != 0); + bool dsv = ((tex.creationFlags & TextureCreationFlags.DSV) != 0) || (tex.format.compType == FormatComponentType.Depth); bool uintTex = (tex.format.compType == FormatComponentType.UInt); bool sintTex = (tex.format.compType == FormatComponentType.SInt); @@ -2073,7 +2073,11 @@ namespace renderdocui.Windows m_TexDisplay.linearDisplayAsGamma = gammaDisplay.Checked; } - if (tex != null && (tex.creationFlags & TextureCreationFlags.DSV) > 0 && + bool dsv = false; + if(tex != null) + dsv = ((tex.creationFlags & TextureCreationFlags.DSV) != 0) || (tex.format.compType == FormatComponentType.Depth); + + if (dsv && (string)channels.SelectedItem != "Custom") { customRed.Visible = false;