From abba66ea10cf1e556adf98bc8f0dd02c47099eab Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Mon, 24 Jul 2023 07:17:13 +0100 Subject: [PATCH] GL Pixel History set preMod.depth before call to QueryPostModPerFragment Copy the postMod depth to next history's preMod depth. The preMode depth is used to prime the depth buffer in QueryPostModPerFragment. --- renderdoc/driver/gl/gl_pixelhistory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/driver/gl/gl_pixelhistory.cpp b/renderdoc/driver/gl/gl_pixelhistory.cpp index b4deb13f8..930652cb4 100644 --- a/renderdoc/driver/gl/gl_pixelhistory.cpp +++ b/renderdoc/driver/gl/gl_pixelhistory.cpp @@ -2165,6 +2165,12 @@ rdcarray GLReplay::PixelHistory(rdcarray events, QueryPrimitiveIdPerFragment(m_pDriver, this, resources, modEvents, x, flippedY, history, eventFragments, usingFloatForPrimitiveId, textureDesc.msSamp, sampleIdx); + // copy the postMod depth to next history's preMod depth + // (preMode depth is to prime the depth buffer in QueryPostModPerFragment) + for(size_t i = 1; i < history.size(); ++i) + { + history[i].preMod.depth = history[i - 1].postMod.depth; + } QueryPostModPerFragment(m_pDriver, this, resources, modEvents, x, flippedY, history, eventFragments, textureDesc.msSamp, sampleIdx, textureWidth, textureHeight);