diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 04b0aa948..4a9eeac2e 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -262,7 +262,11 @@ void ThreadState::WritePointerValue(Id pointer, const ShaderVariable &val) // plus any additional ones for other pointers. Id ptrid = debugger.GetPointerBaseId(var); - bool firstLocalWrite = ReferencePointer(ptrid); + // only track local writes when we don't have debug info, so we can track variables first + // becoming alive + bool firstLocalWrite = false; + if(!debugger.HasDebugInfo()) + firstLocalWrite = ReferencePointer(ptrid); ShaderVariableChange basechange; @@ -314,9 +318,9 @@ void ThreadState::WritePointerValue(Id pointer, const ShaderVariable &val) // This one is not included in any of the pointers lists above basechange.after = debugger.GetPointerValue(ids[ptrid]); - // if this is the first local write when we have no debug info, mark this variable as becoming - // alive here, instead of at its declaration - if(firstLocalWrite && !debugger.HasDebugInfo()) + // if this is the first local write, mark this variable as becoming alive here, instead of at + // its declaration + if(firstLocalWrite) basechange.before.name = ""; m_State->changes.push_back(basechange);