Put buffer under the mutex

This commit is contained in:
Jupeyy 2021-10-28 13:46:02 +02:00
parent 06a155a40d
commit 86319303e8

View file

@ -112,8 +112,8 @@ void CGraphicsBackend_Threaded::StopProcessor()
void CGraphicsBackend_Threaded::RunBuffer(CCommandBuffer *pBuffer)
{
WaitForIdle();
m_pBuffer = pBuffer;
std::unique_lock<std::mutex> Lock(m_BufferSwapMutex);
m_pBuffer = pBuffer;
m_BufferInProcess.store(true, std::memory_order_relaxed);
m_BufferSwapCond.notify_all();
}