diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 148015406..4b412870e 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -3994,8 +3994,10 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray } else { - SetDst(call.result, returnValue); - returnValue.name.clear(); + if(hasReturnValueData) + SetDst(call.result, returnValue); + returnValue = ShaderVariable(); + hasReturnValueData = false; // The instruction after a function call is defined to be a convergence point, mark that we entered it enteredPoints.push_back(nextInstruction); } @@ -4040,10 +4042,12 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray else { returnValue.name = ""; + hasReturnValueData = false; if(opdata.op == Op::ReturnValue) { OpReturnValue ret(it); + hasReturnValueData = true; returnValue = GetSrc(ret.value); } diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.h b/renderdoc/driver/shaders/spirv/spirv_debug.h index 3a001609a..4fb3c9d2e 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.h +++ b/renderdoc/driver/shaders/spirv/spirv_debug.h @@ -238,6 +238,7 @@ struct ThreadState uint32_t convergenceInstruction; uint32_t functionReturnPoint; ShaderVariable returnValue; + bool hasReturnValueData; rdcarray callstack; // the list of IDs that are currently valid and live