(D3D12) move D3D12SignalCommandQueue to d3d12_gfx_sync.

This commit is contained in:
aliaspider 2020-12-20 07:13:11 +01:00
parent 1681322ffc
commit bf2adda421
2 changed files with 2 additions and 4 deletions

View File

@ -271,11 +271,9 @@ bool d3d12_init_queue(d3d12_video_t* d3d12)
D3D12CloseGraphicsCommandList(d3d12->queue.cmd); D3D12CloseGraphicsCommandList(d3d12->queue.cmd);
D3D12CreateFence(d3d12->device, 0, D3D12_FENCE_FLAG_NONE, &d3d12->queue.fence); D3D12CreateFence(d3d12->device, 0, D3D12_FENCE_FLAG_NONE, &d3d12->queue.fence);
d3d12->queue.fenceValue = 1; d3d12->queue.fenceValue = 0;
d3d12->queue.fenceEvent = CreateEvent(NULL, FALSE, FALSE, NULL); d3d12->queue.fenceEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
D3D12SignalCommandQueue(d3d12->queue.handle, d3d12->queue.fence, d3d12->queue.fenceValue);
return true; return true;
} }

View File

@ -52,6 +52,7 @@ static uint32_t d3d12_get_flags(void *data);
static void d3d12_gfx_sync(d3d12_video_t* d3d12) static void d3d12_gfx_sync(d3d12_video_t* d3d12)
{ {
D3D12SignalCommandQueue(d3d12->queue.handle, d3d12->queue.fence, ++d3d12->queue.fenceValue);
if (D3D12GetCompletedValue(d3d12->queue.fence) < d3d12->queue.fenceValue) if (D3D12GetCompletedValue(d3d12->queue.fence) < d3d12->queue.fenceValue)
{ {
D3D12SetEventOnCompletion( D3D12SetEventOnCompletion(
@ -1615,7 +1616,6 @@ static bool d3d12_gfx_frame(
D3D12CloseGraphicsCommandList(d3d12->queue.cmd); D3D12CloseGraphicsCommandList(d3d12->queue.cmd);
D3D12ExecuteGraphicsCommandLists(d3d12->queue.handle, 1, &d3d12->queue.cmd); D3D12ExecuteGraphicsCommandLists(d3d12->queue.handle, 1, &d3d12->queue.cmd);
D3D12SignalCommandQueue(d3d12->queue.handle, d3d12->queue.fence, ++d3d12->queue.fenceValue);
#if 1 #if 1
DXGIPresent(d3d12->chain.handle, !!d3d12->chain.vsync, 0); DXGIPresent(d3d12->chain.handle, !!d3d12->chain.vsync, 0);