From ebfd76d7428f687cd2e14460a638eef1c066db79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 8 Aug 2023 15:42:52 +0200 Subject: [PATCH] Add back the self-render check that kept Ridge Racer working. This hack was removed in #17838 --- GPU/Common/DrawEngineCommon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index e02b1b5bff..5c0858791c 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -836,6 +836,12 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti DecodeVertsStep(decoded_, decodeCounter_, decodedVerts_, &dc.uvScale); decodeCounter_++; } + + if (prim == GE_PRIM_RECTANGLES && (gstate.getTextureAddress(0) & 0x3FFFFFFF) == (gstate.getFrameBufAddress() & 0x3FFFFFFF)) { + // This prevents issues with consecutive self-renders in Ridge Racer. + gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); + DispatchFlush(); + } } bool DrawEngineCommon::CanUseHardwareTransform(int prim) {