From 9cf265284eb0e6e3d7e61a79de11aa5140c6dd2a Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 10 Apr 2020 12:57:13 +0100 Subject: [PATCH] Pass ThreadState to CalculateSampleGather * This is needed to fetch the values of Id parameters in ImageOperandsAndParamDatas --- renderdoc/driver/shaders/spirv/spirv_debug.cpp | 2 +- renderdoc/driver/shaders/spirv/spirv_debug.h | 6 +++--- renderdoc/driver/vulkan/vk_shaderdebug.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 45f531827..1836963c9 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -1570,7 +1570,7 @@ void ThreadState::StepNext(ShaderDebugState *state, result.type = resultType.scalar().Type(); - if(!debugger.GetAPIWrapper()->CalculateSampleGather(opdata.op, img.GetBinding(), + if(!debugger.GetAPIWrapper()->CalculateSampleGather(*this, opdata.op, img.GetBinding(), sampler.GetBinding(), uv, ddxCalc, ddyCalc, compare, gather, operands, result)) { diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.h b/renderdoc/driver/shaders/spirv/spirv_debug.h index ee22914e6..7c38c3786 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.h +++ b/renderdoc/driver/shaders/spirv/spirv_debug.h @@ -44,6 +44,8 @@ enum class GatherChannel : uint8_t Alpha = 3, }; +struct ThreadState; + class DebugAPIWrapper { public: @@ -56,7 +58,7 @@ public: virtual void FillInputValue(ShaderVariable &var, ShaderBuiltin builtin, uint32_t location, uint32_t component) = 0; - virtual bool CalculateSampleGather(rdcspv::Op opcode, BindpointIndex imageBind, + virtual bool CalculateSampleGather(ThreadState &thread, rdcspv::Op opcode, BindpointIndex imageBind, BindpointIndex samplerBind, const ShaderVariable &uv, const ShaderVariable &ddxCalc, const ShaderVariable &ddyCalc, const ShaderVariable &compare, GatherChannel gatherChannel, @@ -75,8 +77,6 @@ public: uint32_t component) = 0; }; -struct ThreadState; - typedef ShaderVariable (*ExtInstImpl)(ThreadState &, const rdcarray &); struct ExtInstDispatcher diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index 29eeebdd9..f825eeadc 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -114,7 +114,7 @@ public: return DerivativeDeltas(); } - bool CalculateSampleGather(rdcspv::Op opcode, BindpointIndex imageBind, + bool CalculateSampleGather(rdcspv::ThreadState &thread, rdcspv::Op opcode, BindpointIndex imageBind, BindpointIndex samplerBind, const ShaderVariable &uv, const ShaderVariable &ddxCalc, const ShaderVariable &ddyCalc, const ShaderVariable &compare, rdcspv::GatherChannel gatherChannel,