From 0b3e0009d62ada98ae8bf69a48be5ededaec27ac Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sat, 26 Oct 2024 00:51:03 +0300 Subject: [PATCH] Fix MSAA depth resolve. --- UnleashedRecomp/gpu/video.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index afbefe0..60d2037 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -1367,11 +1367,16 @@ static void StretchRect(GuestDevice* device, uint32_t flags, uint32_t, GuestText desc.depthAttachment = texture->texture; texture->framebuffer = g_device->createFramebuffer(desc); } + + if (g_framebuffer != texture->framebuffer.get()) + { + commandList->setFramebuffer(texture->framebuffer.get()); + g_framebuffer = texture->framebuffer.get(); + } bool oldHalfPixel = SetHalfPixel(false); FlushViewport(); - commandList->setFramebuffer(texture->framebuffer.get()); commandList->setPipeline(g_resolveMsaaDepthPipelines[pipelineIndex].get()); commandList->setGraphicsPushConstants(0, &g_depthStencil->descriptorIndex, 0, sizeof(uint32_t)); commandList->drawInstanced(6, 1, 0, 0);