From a60d27a4f35f4551e61a3eaea6fff443d1293484 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 22 May 2022 12:24:03 -0700 Subject: [PATCH] GPU: Fix skip buffer effects rendering. Broken by blue-to-alpha changes. Without calling SetRenderFramebuffer, we were never reconsidering the initial SKIPDRAW_NON_DISPLAYED_FB flag and all drawing was getting skipped. --- GPU/GPUCommon.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 710cc364be..df978cfb9b 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1637,15 +1637,6 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) { // We store it in the cache so it can be modified for blue-to-alpha, next. gstate_c.framebufFormat = gstate.FrameBufFormat(); - if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) { - // Rough estimate, not sure what's correct. - cyclesExecuted += EstimatePerVertexCost() * count; - if (gstate.isModeClear()) { - gpuStats.numClears++; - } - return; - } - if (!Memory::IsValidAddress(gstate_c.vertexAddr)) { ERROR_LOG(G3D, "Bad vertex address %08x!", gstate_c.vertexAddr); return; @@ -1669,6 +1660,16 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) { vfb->usageFlags |= FB_USAGE_BLUE_TO_ALPHA; } + // Must check this after SetRenderFrameBuffer so we know SKIPDRAW_NON_DISPLAYED_FB. + if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) { + // Rough estimate, not sure what's correct. + cyclesExecuted += EstimatePerVertexCost() * count; + if (gstate.isModeClear()) { + gpuStats.numClears++; + } + return; + } + void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr); void *inds = nullptr; u32 vertexType = gstate.vertType;