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.
This commit is contained in:
Stenzek 2024-01-12 13:58:17 +10:00 committed by Connor McLaughlin
parent 51ceab1f3c
commit 68f43121fb
1 changed files with 5 additions and 0 deletions

View File

@ -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)