diff --git a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp index 44e966c10..2a2054243 100644 --- a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp +++ b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp @@ -2978,6 +2978,7 @@ rdcarray D3D12Replay::PixelHistory(rdcarray event { PixelModification &mod = history[h]; + uint32_t eid = mod.eventId; int32_t eventIndex = cb.GetEventIndex(mod.eventId); if(eventIndex == -1) { @@ -3036,10 +3037,14 @@ rdcarray D3D12Replay::PixelHistory(rdcarray event eventPremods[mod.eventId] = mod.preMod; } - for(int32_t f = 1; f < frags; f++) { - history.insert(h + 1, mod); + PixelModification duplicate = mod; + for(int32_t f = 1; f < frags; f++) + { + history.insert(h + 1, duplicate); + } } + for(int32_t f = 0; f < frags; f++) history[h + f].fragIndex = f; h += RDCMAX(1, frags); @@ -3047,7 +3052,7 @@ rdcarray D3D12Replay::PixelHistory(rdcarray event "PixelHistory event id: %u, fixed shader stencilValue = %u, " "original shader stencilValue = " "%u", - mod.eventId, ei.dsWithoutShaderDiscard[0], ei.dsWithShaderDiscard[0]); + eid, ei.dsWithoutShaderDiscard[0], ei.dsWithShaderDiscard[0]); } if(eventsWithFrags.size() > 0) diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index d4907a6bb..1661041e9 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -4627,6 +4627,7 @@ rdcarray VulkanReplay::PixelHistory(rdcarray even { PixelModification &mod = history[h]; + uint32_t eid = mod.eventId; int32_t eventIndex = cb.GetEventIndex(mod.eventId); if(eventIndex == -1) { @@ -4685,7 +4686,7 @@ rdcarray VulkanReplay::PixelHistory(rdcarray even RDCDEBUG( "PixelHistory event id: %u, fixed shader stencilValue = %u, original shader stencilValue = " "%u", - mod.eventId, ei.dsWithoutShaderDiscard[4], ei.dsWithShaderDiscard[4]); + eid, ei.dsWithoutShaderDiscard[4], ei.dsWithShaderDiscard[4]); } m_pDriver->vkUnmapMemory(dev, resources.bufferMemory);