From a12a320f188f008721fb861a9cadb27e480ed64a Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 14 Oct 2020 16:17:43 +0100 Subject: [PATCH] Skip debug info OpExtInst during debugging --- renderdoc/driver/shaders/spirv/spirv_debug.cpp | 9 +++++++++ renderdoc/driver/shaders/spirv/spirv_debug.h | 1 + renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index c05d21967..9575f7987 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -579,6 +579,15 @@ void ThreadState::SkipIgnoredInstructions() continue; } + if(op == Op::ExtInst) + { + if(debugger.IsDebugExtInstSet(Id::fromWord(it.word(3)))) + { + nextInstruction++; + continue; + } + } + if(op == Op::SelectionMerge) { OpSelectionMerge merge(it); diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.h b/renderdoc/driver/shaders/spirv/spirv_debug.h index 4f158c25c..b04fdbca9 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.h +++ b/renderdoc/driver/shaders/spirv/spirv_debug.h @@ -260,6 +260,7 @@ public: const DataType &GetType(Id typeId); const DataType &GetTypeForId(Id ssaId); const Decorations &GetDecorations(Id typeId); + bool IsDebugExtInstSet(Id id) const; rdcstr GetRawName(Id id) const; rdcstr GetHumanName(Id id); void AddSourceVars(rdcarray &sourceVars, const ShaderVariable &var, Id id); diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp index 8d919bf2c..4d8e3a865 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp @@ -2375,6 +2375,11 @@ uint32_t Debugger::ApplyDerivatives(uint32_t quadIndex, const Decorations &curDe return outVar.rows; } +bool Debugger::IsDebugExtInstSet(Id id) const +{ + return knownExtSet[ExtSet_ShaderDbg] == id; +} + void Debugger::PreParse(uint32_t maxId) { Processor::PreParse(maxId);