From 21bf1c588fc74fa3de572ffcdd5ac2329eaa334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 14 Oct 2024 11:04:45 +0200 Subject: [PATCH] Ignore single imm point draws, that are accidentally kicked off when games initialize the GPU. --- GPU/GPUCommon.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index bd5579c570..a97dd7958f 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1281,16 +1281,26 @@ void GPUCommon::FlushImm() { if (immCount_ == 0 || immPrim_ == GE_PRIM_INVALID) return; - SetDrawType(DRAW_PRIM, immPrim_); - VirtualFramebuffer *vfb = nullptr; - if (framebufferManager_) - vfb = framebufferManager_->SetRenderFrameBuffer(gstate_c.IsDirty(DIRTY_FRAMEBUF), gstate_c.skipDrawReason); if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) { // No idea how many cycles to skip, heh. immCount_ = 0; return; } + + // Ignore immediate point primitives with a X/Y of 0. + // These are accidentally created when games clear the graphics state. + if (immCount_ == 1 && immPrim_ == GE_PRIM_POINTS && immBuffer_[0].x == 0 && immBuffer_[0].y == 0 && immBuffer_[0].z == 0 && immBuffer_[0].color0_32 == 0) { + immCount_ = 0; + return; + } + + SetDrawType(DRAW_PRIM, immPrim_); + gstate_c.UpdateUVScaleOffset(); + + VirtualFramebuffer *vfb = nullptr; + if (framebufferManager_) + vfb = framebufferManager_->SetRenderFrameBuffer(gstate_c.IsDirty(DIRTY_FRAMEBUF), gstate_c.skipDrawReason); if (vfb) { CheckDepthUsage(vfb); }