From 46a236b5ba7db206cd1d3f87f130c3033e734335 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Sat, 19 Aug 2023 19:12:19 +0100 Subject: [PATCH] Use replay ID to look up GL layered depth buffer texture Previously the code was using the original ID to look for the texture in m_pDriver->m_Textures which would create a default entry if the ID was not found leading to numSlices = 0 and then the pipeline state resource tooltip would show "covers slices 0-4294967294" --- renderdoc/driver/gl/gl_replay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 280552ba5..c046a5dfd 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -1883,8 +1883,9 @@ void GLReplay::SavePipelineState(uint32_t eventId) pipe.framebuffer.drawFBO.colorAttachments[i].swizzle.alpha = MakeSwizzle(swizzles[3]); } - pipe.framebuffer.drawFBO.depthAttachment.resourceId = rm->GetOriginalID( - rm->GetResID(rbDepth ? RenderbufferRes(ctx, curDepth) : TextureRes(ctx, curDepth))); + ResourceId id = + rm->GetResID(rbDepth ? RenderbufferRes(ctx, curDepth) : TextureRes(ctx, curDepth)); + pipe.framebuffer.drawFBO.depthAttachment.resourceId = rm->GetOriginalID(id); pipe.framebuffer.drawFBO.stencilAttachment.resourceId = rm->GetOriginalID( rm->GetResID(rbStencil ? RenderbufferRes(ctx, curStencil) : TextureRes(ctx, curStencil))); @@ -1901,7 +1902,6 @@ void GLReplay::SavePipelineState(uint32_t eventId) pipe.framebuffer.drawFBO.depthAttachment.numSlices = 1; pipe.framebuffer.drawFBO.stencilAttachment.numSlices = 1; - ResourceId id = pipe.framebuffer.drawFBO.depthAttachment.resourceId; if(!rbDepth && id != ResourceId()) { // desktop GL allows layered attachments which attach all slices from 0 to N