From af0b869dee8241f9510470e036976de7a1556032 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 7 Dec 2014 10:44:27 +0000 Subject: [PATCH] Fetch compute shader tex resources if it's a compute drawcall --- renderdocui/Windows/TextureViewer.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index ba7007af8..56d254e40 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -800,10 +800,27 @@ namespace renderdocui.Windows ResourceId[] RTs = m_Core.CurPipelineState.GetOutputTargets(); ResourceId Depth = m_Core.CurPipelineState.OutputDepth; - ResourceId[] Texs = m_Core.CurPipelineState.GetResources(ShaderStageType.Pixel); + ResourceId[] Texs = null; - ShaderReflection details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Pixel); - ShaderBindpointMapping mapping = m_Core.CurPipelineState.GetBindpointMapping(ShaderStageType.Pixel); + ShaderReflection details = null; + ShaderBindpointMapping mapping = null; + + var curDraw = m_Core.GetDrawcall(frameID, eventID); + + if (curDraw != null && (curDraw.flags & DrawcallFlags.Dispatch) != 0 && + m_Core.CurPipelineState.GetShader(ShaderStageType.Compute) != ResourceId.Null) + { + Texs = m_Core.CurPipelineState.GetResources(ShaderStageType.Compute); + details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Compute); + mapping = m_Core.CurPipelineState.GetBindpointMapping(ShaderStageType.Compute); + } + + if (details == null) + { + Texs = m_Core.CurPipelineState.GetResources(ShaderStageType.Pixel); + details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Pixel); + mapping = m_Core.CurPipelineState.GetBindpointMapping(ShaderStageType.Pixel); + } uint firstuav = uint.MaxValue;