From e48941eb4853583eb24806736d943d92d110c8ea Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Sun, 8 Oct 2023 16:16:11 -0500 Subject: [PATCH] Fix for command pool crash, fix for hanging on Wait --- src/Refresh_Driver_D3D11.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Refresh_Driver_D3D11.c b/src/Refresh_Driver_D3D11.c index 8bce5d5..e99e3c7 100644 --- a/src/Refresh_Driver_D3D11.c +++ b/src/Refresh_Driver_D3D11.c @@ -1403,6 +1403,12 @@ static void D3D11_Submit( SDL_LockMutex(renderer->contextLock); + /* Notify the command buffer completion query that we have completed recording */ + ID3D11DeviceContext_End( + renderer->immediateContext, + (ID3D11Asynchronous*) d3d11CommandBuffer->completionQuery + ); + /* Serialize the commands into the command list */ res = ID3D11DeviceContext_FinishCommandList( d3d11CommandBuffer->context, @@ -1775,6 +1781,9 @@ tryCreateDevice: /* Initialize miscellaneous renderer members */ renderer->debugMode = (flags & D3D11_CREATE_DEVICE_DEBUG); + /* Create command buffers to initialize the pool */ + D3D11_INTERNAL_AllocateCommandBuffers(renderer, 2); + /* Create the Refresh Device */ result = (Refresh_Device*) SDL_malloc(sizeof(Refresh_Device)); ASSIGN_DRIVER(D3D11)