d3d12: Emit an error if waiting for too long for semaphore

This commit is contained in:
vlj 2015-06-11 21:01:24 +02:00 committed by Vincent Lejeune
parent d2c13bc4c1
commit c53828787a
1 changed files with 5 additions and 0 deletions

View File

@ -1215,10 +1215,15 @@ void D3D12GSRender::semaphorePGRAPHBackendRelease(u32 offset, u32 value)
void D3D12GSRender::semaphorePFIFOAcquire(u32 offset, u32 value)
{
const std::chrono::time_point<std::chrono::system_clock> enterWait = std::chrono::system_clock::now();
while (true)
{
u32 val = vm::read32(m_label_addr + offset);
if (val == value) break;
std::chrono::time_point<std::chrono::system_clock> waitPoint = std::chrono::system_clock::now();
int elapsedTime = std::chrono::duration_cast<std::chrono::seconds>(waitPoint - enterWait).count();
if (elapsedTime > 0)
LOG_ERROR(RSX, "Has wait for more than a second for semaphore acquire");
std::this_thread::yield();
}
}