Skip to content

Commit

Permalink
MTGS: Explicitly set FP control register on startup
Browse files Browse the repository at this point in the history
Linux appears? to inherit the value of MXCSR from the creating thread,
and that breaks parts of the software renderer.
  • Loading branch information
stenzek committed Jan 12, 2024
1 parent 51ceab1 commit 68f4312
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pcsx2/MTGS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 68f4312

Please sign in to comment.