From 1ab648c3fa94af526ffcc4f700e091e10cc5e18d Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 Jan 2023 12:05:29 +0000 Subject: [PATCH] Always show DebugValue in SPIR-V disassembly. Closes #2823 * These were previously hidden by default since they generate a fair amount of noise in the disassembly which is not neccessarily directly useful. * The problem is that DebugValues are steppable and so will generate an instruction in the debugging, but without a disassembly line you can have two different 'instructions' on the same disassembly line but with different source lines: > DebugLine 100 > DebugValue ... > DebugLine 101 > OpSomething ... In this case the DebugValue and OpSomething will both have the same disassembly line, but different source lines. This means it is impossible to reliably place a disassembly breakpoint and know which instruction to stop on, and produces some odd effects when stepping in asm (it will step to the DebugValue then the OpSomething and not visibly move). * Overall the reduction in readability is worth this fix, especially considering that when debug info is present is exactly when people are least likely to be using the disassembly at all. --- renderdoc/driver/shaders/spirv/spirv_disassemble.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp index def2aff7b..45b0c9fcc 100644 --- a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp @@ -28,9 +28,6 @@ #include "spirv_op_helpers.h" #include "spirv_reflect.h" -RDOC_CONFIG(bool, Vulkan_Debug_ShowDebugValues, false, - "Show DebugValue instructions in shader disassembly."); - struct StructuredCFG { enum @@ -1603,15 +1600,15 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, ret += ")"; } - else if(dbg.inst == ShaderDbg::Value && Vulkan_Debug_ShowDebugValues()) + else if(dbg.inst == ShaderDbg::Value) { OpShaderDbg localVar(GetID(dbg.arg(0))); ret += indent; ret += "// DebugValue("; ret += idName(dbg.arg(1)); - ret += " = "; + ret += " is "; ret += idName(localVar.arg(0)); - ret += " "; + ret += " @ "; ret += idName(localVar.arg(2)); ret += ":"; ret += idName(localVar.arg(3));