From 68f43121fbf0df8cd231eaf2b9ba0f2db360859c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 12 Jan 2024 13:58:17 +1000 Subject: [PATCH] MTGS: Explicitly set FP control register on startup Linux appears? to inherit the value of MXCSR from the creating thread, and that breaks parts of the software renderer. --- pcsx2/MTGS.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 7128a7ed54..d127e1046a 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -9,6 +9,7 @@ #include "IconsFontAwesome5.h" #include "VMManager.h" +#include "common/FPControl.h" #include "common/ScopedGuard.h" #include "common/StringUtil.h" #include "common/WrappedMemCopy.h" @@ -144,6 +145,10 @@ void MTGS::ThreadEntryPoint() { Threading::SetNameOfCurrentThread("GS"); + // Explicitly set rounding mode to default (nearest, FTZ off). + // Otherwise it appears to get inherited from the EE thread on Linux. + FPControlRegister::SetCurrent(FPControlRegister::GetDefault()); + for (;;) { // wait until we're actually asked to initialize (and config has been loaded, etc)