Last active
August 29, 2015 14:21
-
-
Save vlj/8032af4568f3cf1dce59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void D3D12GSRender::semaphorePGRAPHBackendRelease(u32 offset, u32 value) | |
{ | |
ID3D12Fence *fence; | |
check( | |
m_device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence)) | |
); | |
HANDLE handle = CreateEvent(0, FALSE, FALSE, 0); | |
fence->SetEventOnCompletion(1, handle); | |
m_commandQueueGraphic->Signal(fence, 1); | |
std::thread valueChangerThread([&]() { | |
WaitForSingleObject(handle, INFINITE); | |
CloseHandle(handle); | |
fence->Release(); | |
vm::write32(m_label_addr + offset, value); | |
}); | |
valueChangerThread.detach(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment