From 52c5822977f7d016672a6366f753f8f59e0cee6c Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:36:38 +0300 Subject: [PATCH] Force depth stencil textures to be transient. --- UnleashedRecomp/gpu/video.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 94b8c3ef..7e1d3775 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -3114,8 +3114,9 @@ static void ProcExecutePendingStretchRectCommands(const RenderCommand& cmd) for (const auto surface : g_pendingSurfaceCopies) { - bool isDepthStencil = (surface->format == RenderFormat::D32_FLOAT); - foundAny |= PopulateBarriersForStretchRect(isDepthStencil ? nullptr : surface, isDepthStencil ? surface : nullptr); + // Depth stencil textures in this game are guaranteed to be transient. + if (surface->format != RenderFormat::D32_FLOAT) + foundAny |= PopulateBarriersForStretchRect(surface, nullptr); } if (foundAny) @@ -3124,8 +3125,13 @@ static void ProcExecutePendingStretchRectCommands(const RenderCommand& cmd) for (const auto surface : g_pendingSurfaceCopies) { - bool isDepthStencil = (surface->format == RenderFormat::D32_FLOAT); - ExecutePendingStretchRectCommands(isDepthStencil ? nullptr : surface, isDepthStencil ? surface : nullptr); + if (surface->format != RenderFormat::D32_FLOAT) + ExecutePendingStretchRectCommands(surface, nullptr); + + for (const auto texture : surface->destinationTextures) + texture->sourceSurface = nullptr; + + surface->destinationTextures.clear(); } }