From 802a8aa84591701442a7e26998d5f72f9b197c37 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 23 Oct 2025 14:41:47 +0100 Subject: [PATCH] Note whether GL pixel history target is depth or colour --- renderdoc/driver/gl/gl_pixelhistory.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/renderdoc/driver/gl/gl_pixelhistory.cpp b/renderdoc/driver/gl/gl_pixelhistory.cpp index 052224c54..f246fafb8 100644 --- a/renderdoc/driver/gl/gl_pixelhistory.cpp +++ b/renderdoc/driver/gl/gl_pixelhistory.cpp @@ -89,6 +89,7 @@ struct ShaderOutFramebuffer struct GLPixelHistoryResources { ResourceId target; + bool depthTarget; // Used for offscreen rendering for draw call events. GLuint fullPrecisionColorImage; @@ -569,6 +570,20 @@ bool PixelHistorySetupResources(WrappedOpenGL *driver, GLPixelHistoryResources & const TextureDescription &desc, const Subresource &sub, uint32_t numEvents, GLuint glslVersion, uint32_t numSamples) { + resources.depthTarget = false; + if(desc.format.type == ResourceFormatType::D16S8 || + desc.format.type == ResourceFormatType::D24S8 || desc.format.type == ResourceFormatType::D32S8) + { + resources.depthTarget = true; + } + else if(desc.format.compType == CompType::Depth) + { + resources.depthTarget = true; + } + else if(desc.format.type == ResourceFormatType::S8) + { + resources.depthTarget = true; + } // Allocate a framebuffer that will render to the textures driver->glGenFramebuffers(1, &resources.fullPrecisionFrameBuffer); driver->glBindFramebuffer(eGL_FRAMEBUFFER, resources.fullPrecisionFrameBuffer);