summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-13 08:33:55 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-13 08:33:55 -0600
commit150590a7e8b04a85b317eb09215759aa636dd277 (patch)
tree963def89d67d2dba3460494ff55b3da7f2a76564 /drivers
parent370c692bcbb474d797b9eb5e874e9152aa3af1a8 (diff)
parent05576a2324559c7db69c17e5a1f9f537e161eb8e (diff)
downloadredot-engine-150590a7e8b04a85b317eb09215759aa636dd277.tar.gz
Merge pull request #98975 from clayjohn/D3D12-event-timing
Move D3D12 fence `SetEventOnCompletion` call to `fence_wait` to avoid stalling on some platforms
Diffstat (limited to 'drivers')
-rw-r--r--drivers/d3d12/rendering_device_driver_d3d12.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp
index 0cc89dfaca..0b1b0651c8 100644
--- a/drivers/d3d12/rendering_device_driver_d3d12.cpp
+++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp
@@ -2160,6 +2160,7 @@ RDD::FenceID RenderingDeviceDriverD3D12::fence_create() {
Error RenderingDeviceDriverD3D12::fence_wait(FenceID p_fence) {
FenceInfo *fence = (FenceInfo *)(p_fence.id);
+ fence->d3d_fence->SetEventOnCompletion(fence->fence_value, fence->event_handle);
DWORD res = WaitForSingleObjectEx(fence->event_handle, INFINITE, FALSE);
#ifdef PIX_ENABLED
PIXNotifyWakeFromFenceSignal(fence->event_handle);
@@ -2254,7 +2255,6 @@ Error RenderingDeviceDriverD3D12::command_queue_execute_and_present(CommandQueue
FenceInfo *fence = (FenceInfo *)(p_cmd_fence.id);
fence->fence_value++;
command_queue->d3d_queue->Signal(fence->d3d_fence.Get(), fence->fence_value);
- fence->d3d_fence->SetEventOnCompletion(fence->fence_value, fence->event_handle);
}
}