MTGS: Fix spinning when out of space with MTVU off

This commit is contained in:
TellowKrinkle authored and lightningterror committed 2022-12-03 02:44:25 +01:00
1 parent be6598e224
commit c12422b2cd
2 files changed
+3 -3

No files matched your search

-1
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;
+3 -2
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));
}