From 7bcdf9b335eb4ef4187883dd75715a9fff417531 Mon Sep 17 00:00:00 2001 From: Jannik <72194488+JannikGM@users.noreply.github.com> Date: Mon, 12 Oct 2020 12:04:11 +0200 Subject: [PATCH] Fix copy of loop variable in SPIRV by using reference --- renderdoc/driver/shaders/spirv/spirv_debug.cpp | 4 ++-- renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 09fae0c97..ffff73d08 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -330,7 +330,7 @@ void ThreadState::ProcessScopeChange(const rdcarray &oldLive, const rdcarray const rdcarray &liveGlobals = debugger.GetLiveGlobals(); - for(const Id id : oldLive) + for(const Id &id : oldLive) { if(liveGlobals.contains(id)) continue; @@ -338,7 +338,7 @@ void ThreadState::ProcessScopeChange(const rdcarray &oldLive, const rdcarray m_State->changes.push_back({debugger.GetPointerValue(ids[id])}); } - for(const Id id : newLive) + for(const Id &id : newLive) { if(liveGlobals.contains(id)) continue; diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp index 23ecc514b..722ae6782 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp @@ -2376,9 +2376,9 @@ void Debugger::RegisterOp(Iter it) { // don't automatically kill function parameters and variables. They will be manually killed when // returning from a function's scope - for(const Id id : curFunction->parameters) + for(const Id &id : curFunction->parameters) idDeathOffset[id] = ~0U; - for(const Id id : curFunction->variables) + for(const Id &id : curFunction->variables) idDeathOffset[id] = ~0U; curFunction = NULL;