From a4ba2e671cb83c58208f88043013b3dd503e47f6 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 30 Aug 2021 15:25:54 +0100 Subject: [PATCH] Only populate input variables declared in the interface for an entry * This prevents us from trying to fill in e.g. vertex shader inputs when debugging a pixel shader if a module contains multiple entry points --- .../driver/shaders/spirv/spirv_debug_setup.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp index 69ecc28d0..1114c2296 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp @@ -526,6 +526,17 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s return new ShaderDebugTrace; } + rdcarray entryInterface; + + for(const EntryPoint &e : entries) + { + if(e.id == entryId) + { + entryInterface = e.usedIds; + break; + } + } + global.clock = uint64_t(time(NULL)) << 32; for(auto it = extSets.begin(); it != extSets.end(); it++) @@ -618,6 +629,9 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s { if(v.storage == StorageClass::Input || v.storage == StorageClass::Output) { + if(!entryInterface.contains(v.id)) + continue; + const bool isInput = (v.storage == StorageClass::Input); ShaderVariable var;