23 Nov
2023
23 Nov
'23
5:21 a.m.
I don't see a method to wait for a fence, at least not without having a command queue. A suggestion I found online goes along the lines of:
if (fence->GetCompletedValue != expected) { HANDLE ev = CreateEvent(...); fence->SetEventOnCompletion(expected, ev); WaitForSingleObject(ev, INFINITE); CloseHandle(ev); }
It's a fair bit easier than that, actually. While perhaps not immediately obvious from the documentation, calling ID3D12Fence_SetEventOnCompletion(fence, value, NULL) will block until "fence" reaches "value". -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/488#note_53499