From 2ab5942fdc7c42e7591f13da4b27fd07ebdcc5a5 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Tue, 29 Jul 2025 22:57:07 -0700 Subject: [PATCH] Fix depth-only rendering. --- MarathonRecomp/gpu/video.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MarathonRecomp/gpu/video.cpp b/MarathonRecomp/gpu/video.cpp index bfaf03e7d..f79b7eed3 100644 --- a/MarathonRecomp/gpu/video.cpp +++ b/MarathonRecomp/gpu/video.cpp @@ -3474,8 +3474,7 @@ static void SetDefaultViewport(GuestDevice* device, GuestSurface* surface) static void SetRenderTarget(GuestDevice* device, uint32_t index, GuestSurface* renderTarget) { - // printf("SetRenderTarget %x %d %x\n", device, index, renderTarget); - if (renderTarget != nullptr) + if (index == 0) { RenderCommand cmd; cmd.type = RenderCommandType::SetRenderTarget; @@ -3484,6 +3483,11 @@ static void SetRenderTarget(GuestDevice* device, uint32_t index, GuestSurface* r SetDefaultViewport(device, renderTarget); } + else + { + // Multiple targets are not currently handled. Make sure any attempt to set them is nullptr. + assert(renderTarget == nullptr); + } } static void ProcSetRenderTarget(const RenderCommand& cmd) @@ -3499,7 +3503,6 @@ static void ProcSetRenderTarget(const RenderCommand& cmd) static void SetDepthStencilSurface(GuestDevice* device, GuestSurface* depthStencil) { - // printf("SetDepthStencilSurface: %x\n", depthStencil); RenderCommand cmd; cmd.type = RenderCommandType::SetDepthStencilSurface; cmd.setDepthStencilSurface.depthStencil = depthStencil;