Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions UnleashedRecomp/gpu/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ static std::unique_ptr<RenderCommandFence> g_commandFences[NUM_FRAMES];
static std::unique_ptr<RenderQueryPool> g_queryPools[NUM_FRAMES];
static bool g_commandListStates[NUM_FRAMES];

static std::unique_ptr<RenderCommandList> g_waitCommandList;
static std::unique_ptr<RenderCommandFence> g_waitCommandFence;

static Mutex g_copyMutex;
static std::unique_ptr<RenderCommandQueue> g_copyQueue;
static std::unique_ptr<RenderCommandList> g_copyCommandList;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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<uint32_t>* a6)
Expand Down