2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

gpu_thread: Don't spin wait if there are no GPU commands.

This commit is contained in:
bunnei 2019-11-23 15:17:28 -05:00
parent 6a3fc5d2ff
commit 9ec84fc592

View file

@ -31,8 +31,7 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p
CommandDataContainer next; CommandDataContainer next;
while (state.is_running) { while (state.is_running) {
while (!state.queue.Empty()) { next = state.queue.PopWait();
state.queue.Pop(next);
if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) {
dma_pusher.Push(std::move(submit_list->entries)); dma_pusher.Push(std::move(submit_list->entries));
dma_pusher.DispatchCalls(); dma_pusher.DispatchCalls();
@ -49,7 +48,6 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p
} }
state.signaled_fence.store(next.fence); state.signaled_fence.store(next.fence);
} }
}
} }
ThreadManager::ThreadManager(Core::System& system) : system{system} {} ThreadManager::ThreadManager(Core::System& system) : system{system} {}