MTGS: Fix spinning when out of space with MTVU off

This commit is contained in:
TellowKrinkle 2022-11-27 17:06:00 -06:00 committed by lightningterror
parent be6598e224
commit c12422b2cd
2 changed files with 3 additions and 3 deletions

View File

@ -340,7 +340,6 @@ public:
std::atomic<bool> m_VsyncSignalListener;
std::mutex m_mtx_RingBufferBusy2; // Gets released on semaXGkick waiting...
std::mutex m_mtx_WaitGS;
Threading::WorkSema m_sem_event;
Threading::UserspaceSemaphore m_sem_OnRingReset;
Threading::UserspaceSemaphore m_sem_Vsync;

View File

@ -617,7 +617,7 @@ void SysMtgsThread::WaitGS(bool syncRegs, bool weakWait, bool isMTVU)
// we don't want to access the content of the queue
SetEvent();
if (weakWait)
if (weakWait && isMTVU)
{
// On weakWait we will stop waiting on the MTGS thread if the
// MTGS thread has processed a vu1 xgkick packet, or is pending on
@ -644,9 +644,10 @@ void SysMtgsThread::WaitGS(bool syncRegs, bool weakWait, bool isMTVU)
pxFailRel("MTGS Thread Died");
}
assert(!(weakWait && syncRegs) && "No synchronization for this!");
if (syncRegs)
{
std::unique_lock lock(m_mtx_WaitGS);
// Completely synchronize GS and MTGS register states.
memcpy(RingBuffer.Regs, PS2MEM_GS, sizeof(RingBuffer.Regs));
}