diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 86a7d1416a..c81934fdd2 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -2715,12 +2715,12 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray if(texType & DebugAPIWrapper::Subpass_Texture) { // get current position - ShaderVariable curCoord; + ShaderVariable curCoord(rdcstr(), 0.0f, 0.0f, 0.0f, 0.0f); debugger.GetAPIWrapper()->FillInputValue(curCoord, ShaderBuiltin::Position, 0, 0); // co-ords are relative to the current position - setUintComp(coord, 0, uintComp(coord, 0) + uintComp(curCoord, 0)); - setUintComp(coord, 1, uintComp(coord, 1) + uintComp(curCoord, 1)); + setUintComp(coord, 0, uintComp(coord, 0) + (uint32_t)floatComp(curCoord, 0)); + setUintComp(coord, 1, uintComp(coord, 1) + (uint32_t)floatComp(curCoord, 1)); // do it with samplegather as ImageFetch rather than a Read which caches the whole texture // on the CPU for no reason (since we can't write to it) diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index 0464df960f..37985bd4ff 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -3964,7 +3964,8 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ std::map &builtins = apiWrapper->builtin_inputs; builtins[ShaderBuiltin::DeviceIndex] = ShaderVariable(rdcstr(), 0U, 0U, 0U, 0U); builtins[ShaderBuiltin::DrawIndex] = ShaderVariable(rdcstr(), draw->drawIndex, 0U, 0U, 0U); - builtins[ShaderBuiltin::Position] = ShaderVariable(rdcstr(), x, y, 0U, 0U); + builtins[ShaderBuiltin::Position] = + ShaderVariable(rdcstr(), float(x) + 0.5f, float(y) + 0.5f, 0.0f, 0.0f); // If the pipe contains a geometry shader, then Primitive ID cannot be used in the pixel // shader without being emitted from the geometry shader. For now, check if this semantic