diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index a9edd0b39..4b5a294a5 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -311,6 +311,9 @@ static std::unique_ptr g_commandFences[NUM_FRAMES]; static std::unique_ptr g_queryPools[NUM_FRAMES]; static bool g_commandListStates[NUM_FRAMES]; +static std::unique_ptr g_waitCommandList; +static std::unique_ptr g_waitCommandFence; + static Mutex g_copyMutex; static std::unique_ptr g_copyQueue; static std::unique_ptr g_copyCommandList; @@ -1846,6 +1849,9 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver, bool graphicsApiRetry) for (auto& queryPool : g_queryPools) queryPool = g_device->createQueryPool(NUM_QUERIES); + g_waitCommandList = g_queue->createCommandList(); + g_waitCommandFence = g_device->createCommandFence(); + g_copyQueue = g_device->createCommandQueue(RenderCommandListType::COPY); g_copyCommandList = g_copyQueue->createCommandList(); g_copyCommandFence = g_device->createCommandFence(); @@ -2086,10 +2092,10 @@ void Video::WaitForGPU() } // Execute an empty command list and wait for it to end to guarantee that any remaining presentation has finished. - g_commandLists[0]->begin(); - g_commandLists[0]->end(); - g_queue->executeCommandLists(g_commandLists[0].get(), g_commandFences[0].get()); - g_queue->waitForCommandFence(g_commandFences[0].get()); + g_waitCommandList->begin(); + g_waitCommandList->end(); + g_queue->executeCommandLists(g_waitCommandList.get(), g_waitCommandFence.get()); + g_queue->waitForCommandFence(g_waitCommandFence.get()); } static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, uint32_t a5, be* a6)