renderswitch: remove delay, fix long standing race condition

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-06-19 10:21:12 +02:00 committed by Kojin
parent 4237ab9925
commit a9d8a7d70f
2 changed files with 4 additions and 6 deletions

View File

@ -450,7 +450,6 @@ extern uint eecount_on_last_vdec;
extern bool FMVstarted;
extern bool EnableFMV;
extern bool renderswitch;
extern uint renderswitch_delay;
void DoFmvSwitch(bool on)
{
@ -494,8 +493,6 @@ void Pcsx2App::LogicalVsync()
}
}
renderswitch_delay >>= 1;
if( (wxGetApp().GetGsFramePtr() != NULL) )
PADupdate(0);

View File

@ -37,7 +37,6 @@
// renderswitch - tells GS to go into dx9 sw if "renderswitch" is set.
bool renderswitch = false;
uint renderswitch_delay = 0;
extern bool switchAR;
@ -398,8 +397,10 @@ namespace Implementations
{
if (GSDump::isRunning)
return;
if (renderswitch_delay == 0)
static bool reentrant = false;
if (!reentrant)
{
reentrant = true;
ScopedCoreThreadPause paused_core;
freezeData fP = {0, nullptr};
MTGS_FreezeData sstate = {&fP, 0};
@ -410,8 +411,8 @@ namespace Implementations
renderswitch = !renderswitch;
GetMTGS().Freeze(FREEZE_LOAD, sstate);
delete[] fP.data;
renderswitch_delay = -1;
paused_core.AllowResume();
reentrant = false;
}
}