SpirvShaderDebugger: Don't display SSA values with DebugInfo
If the shader contains `OpenCL.DebugInfo.100` rich debug info instructions, don't also include raw SSA values in the watch window.
Bug: b/148401179
Change-Id: Id70a702bbb24fb0bf79faa55cd22c0a87c973f62
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/45350
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp
index 3dddf38..0b9731f 100644
--- a/src/Pipeline/SpirvShaderDebugger.cpp
+++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -1622,11 +1622,18 @@
auto dbg = impl.debugger;
if(!dbg) { return; }
- auto resIt = dbg->results.find(insn.wordPointer(0));
- if(resIt != dbg->results.end())
+ // Don't display SSA values if rich debug info is available
+ if(extensionsImported.count(Extension::OpenCLDebugInfo100) == 0)
{
- auto id = resIt->second;
- dbgExposeIntermediate(id, state);
+ // We're emitting debugger logic for SPIR-V.
+ // Does this instruction emit a result that should be exposed to the
+ // debugger?
+ auto resIt = dbg->results.find(insn.wordPointer(0));
+ if(resIt != dbg->results.end())
+ {
+ auto id = resIt->second;
+ dbgExposeIntermediate(id, state);
+ }
}
}