diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-25 02:19:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 02:19:25 +0100 |
commit | 33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21 (patch) | |
tree | 576f2ec49f576388879ab25e223feb90b675295a | |
parent | kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154) (diff) | |
parent | gpu_thread: Don't spin wait if there are no GPU commands. (diff) | |
download | yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.gz yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.bz2 yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.lz yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.xz yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.zst yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.zip |
-rw-r--r-- | src/video_core/gpu_thread.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 758a37f14..3efa3d8d0 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -31,24 +31,22 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p CommandDataContainer next; while (state.is_running) { - while (!state.queue.Empty()) { - state.queue.Pop(next); - if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { - dma_pusher.Push(std::move(submit_list->entries)); - dma_pusher.DispatchCalls(); - } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { - renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); - } else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) { - renderer.Rasterizer().FlushRegion(data->addr, data->size); - } else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) { - renderer.Rasterizer().InvalidateRegion(data->addr, data->size); - } else if (std::holds_alternative<EndProcessingCommand>(next.data)) { - return; - } else { - UNREACHABLE(); - } - state.signaled_fence.store(next.fence); + next = state.queue.PopWait(); + if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { + dma_pusher.Push(std::move(submit_list->entries)); + dma_pusher.DispatchCalls(); + } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { + renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); + } else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) { + renderer.Rasterizer().FlushRegion(data->addr, data->size); + } else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) { + renderer.Rasterizer().InvalidateRegion(data->addr, data->size); + } else if (std::holds_alternative<EndProcessingCommand>(next.data)) { + return; + } else { + UNREACHABLE(); } + state.signaled_fence.store(next.fence); } } |