From 14bb7a60625d0b4e1b59812f7d71cd81fbd5863e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 29 Oct 2024 11:19:32 +0100 Subject: [PATCH] Reduce Windows debugger crashes on shutdown --- Core/System.cpp | 3 +++ GPU/Common/SoftwareTransformCommon.cpp | 4 ++-- GPU/GPU.cpp | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/System.cpp b/Core/System.cpp index b8cb8f2182..6764e6901c 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -550,6 +550,9 @@ bool PSP_IsQuitting() { } void PSP_Shutdown() { + // Reduce the risk for weird races with the Windows GE debugger. + gpuDebug = nullptr; + Achievements::UnloadGame(); // Do nothing if we never inited. diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index 8d1624000c..c2a8b8f1ff 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -539,9 +539,9 @@ void SoftwareTransform::BuildDrawingParams(int prim, int vertexCount, u32 vertTy // so the operations are exact. bool pixelMapped = true; const u16 *indsIn = (const u16 *)inds; + const float uscale = gstate_c.curTextureWidth; + const float vscale = gstate_c.curTextureHeight; for (int t = 0; t < vertexCount; t += 3) { - float uscale = gstate_c.curTextureWidth; - float vscale = gstate_c.curTextureHeight; struct { int a; int b; } pairs[] = { {0, 1}, {1, 2}, {2, 0} }; for (int i = 0; i < ARRAY_SIZE(pairs); i++) { int a = indsIn[t + pairs[i].a]; diff --git a/GPU/GPU.cpp b/GPU/GPU.cpp index 38af2f75ba..341be4f42d 100644 --- a/GPU/GPU.cpp +++ b/GPU/GPU.cpp @@ -121,8 +121,6 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { #endif void GPU_Shutdown() { - // Reduce the risk for weird races with the Windows GE debugger. - gpuDebug = nullptr; delete gpu; gpu = nullptr;