From 364f5998c2193567ee0b52f2ca5d13ce4e7e2de2 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Sat, 3 Feb 2024 07:00:21 +0000 Subject: [PATCH] In Vulkan Pixel History zero out unwritten shaderOut elements In Vulkan these are not defined to be zero (behaviour is driver dependent) --- renderdoc/driver/vulkan/vk_pixelhistory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index 8cd8fea48..cbbec4551 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -4272,6 +4272,9 @@ rdcarray VulkanReplay::PixelHistory(rdcarray even uint32_t offset = perFragmentCB.GetEventOffset(eid) + f - discardOffset; FillInColor(shaderOutFormat, bp[offset].shaderOut, history[h].shaderOut); history[h].shaderOut.depth = bp[offset].shaderOut.depth.fdepth; + // Zero out elements the shader didn't write to. + for(int i = fmt.compCount; i < 4; i++) + history[h].shaderOut.col.floatValue[i] = 0.0f; if((h < history.size() - 1) && (history[h].eventId == history[h + 1].eventId)) {