From aafd0ec788bc59cab35ccb0d2d6afe9a735c8d27 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 21 Jul 2022 11:08:09 +0100 Subject: [PATCH] Fix a bug with variables in loop coming into existence multiple times --- renderdoc/driver/shaders/spirv/spirv_debug.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 4a9eeac2e..73afe1a94 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -345,6 +345,8 @@ void ThreadState::SetDst(Id id, const ShaderVariable &val) if(m_State && ContainsNaNInf(val)) m_State->flags |= ShaderEvents::GeneratedNanOrInf; + ShaderVariable prev = ids[id]; + ids[id] = val; ids[id].name = GetRawName(id); @@ -366,6 +368,7 @@ void ThreadState::SetDst(Id id, const ShaderVariable &val) if(m_State) { ShaderVariableChange change; + change.before = prev; change.after = debugger.GetPointerValue(ids[id]); m_State->changes.push_back(change);