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"
This commit is contained in:
Jake Turner
2023-08-19 19:12:19 +01:00
parent d68a8e9dc4
commit 46a236b5ba
+3 -3
View File
@@ -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