From 9bc7e99d831b88785254380373df0cea1b2975eb Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 25 Jul 2016 16:59:36 +0200 Subject: [PATCH] If no pixel shader is bound, don't show shader output in pixel history --- renderdoc/api/replay/data_types.h | 1 + renderdoc/core/replay_proxy.cpp | 4 +++- renderdoc/driver/d3d11/d3d11_analyse.cpp | 4 ++++ renderdocui/Interop/FetchInfo.cs | 1 + renderdocui/Windows/PixelHistoryView.cs | 7 ++++++- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 9b25ec12d..d28da9186 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -486,6 +486,7 @@ struct PixelModification uint32_t eventID; bool32 uavWrite; + bool32 unboundPS; uint32_t fragIndex; uint32_t primitiveID; diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index aeec767be..c5e0dc1ac 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -1386,6 +1386,8 @@ void Serialiser::Serialise(const char *name, PixelModification &el) Serialise("", el.eventID); Serialise("", el.uavWrite); + Serialise("", el.unboundPS); + Serialise("", el.fragIndex); Serialise("", el.primitiveID); @@ -1408,7 +1410,7 @@ void Serialiser::Serialise(const char *name, PixelModification &el) Serialise("", el.depthTestFailed); Serialise("", el.stencilTestFailed); - SIZE_CHECK(PixelModification, 120); + SIZE_CHECK(PixelModification, 124); } #pragma endregion Data descriptors diff --git a/renderdoc/driver/d3d11/d3d11_analyse.cpp b/renderdoc/driver/d3d11/d3d11_analyse.cpp index 77aeaab65..05a4a89b6 100644 --- a/renderdoc/driver/d3d11/d3d11_analyse.cpp +++ b/renderdoc/driver/d3d11/d3d11_analyse.cpp @@ -5319,6 +5319,7 @@ vector D3D11DebugManager::PixelHistory(vector eve mod.eventID = events[i].eventID; mod.uavWrite = uavWrite; + mod.unboundPS = false; mod.preMod.col.value_u[0] = (uint32_t)i; @@ -6253,6 +6254,9 @@ vector D3D11DebugManager::PixelHistory(vector eve m_pImmediateContext->PSGetShader(&curPS, curInst, &curNumInst); m_pImmediateContext->PSSetShader(m_DebugRender.PrimitiveIDPS, NULL, 0); + if(curPS == NULL) + history[h].unboundPS = true; + m_WrappedDevice->ReplayLog(0, history[h].eventID, eReplay_OnlyDraw); m_pImmediateContext->PSSetShader(curPS, curInst, curNumInst); diff --git a/renderdocui/Interop/FetchInfo.cs b/renderdocui/Interop/FetchInfo.cs index 5ad5326ff..0b67eb6f6 100644 --- a/renderdocui/Interop/FetchInfo.cs +++ b/renderdocui/Interop/FetchInfo.cs @@ -819,6 +819,7 @@ namespace renderdoc public UInt32 eventID; public bool uavWrite; + public bool unboundPS; public UInt32 fragIndex; public UInt32 primitiveID; diff --git a/renderdocui/Windows/PixelHistoryView.cs b/renderdocui/Windows/PixelHistoryView.cs index c337e1942..d8ecc5edc 100644 --- a/renderdocui/Windows/PixelHistoryView.cs +++ b/renderdocui/Windows/PixelHistoryView.cs @@ -294,9 +294,14 @@ namespace renderdocui.Windows ResourceFormat fmt = new ResourceFormat(floatTex ? FormatComponentType.Float : texture.format.compType, 4, 4); - string shadOutVal = "Shader Out\n\n" + ModificationValueString(mod.shaderOut, fmt, depth); + string shadOutVal; string postModVal = "Tex After\n\n" + ModificationValueString(mod.postMod, texture.format, depth); + if (mod.unboundPS) + shadOutVal = "No Pixel\nShader\nBound"; + else + shadOutVal = "Shader Out\n\n" + ModificationValueString(mod.shaderOut, fmt, depth); + if (!mod.EventPassed() && hideFailedEventsToolStripMenuItem.Checked) return null;