diff options
| author | 2019-11-24 20:19:25 -0500 | |
|---|---|---|
| committer | 2019-11-24 20:19:25 -0500 | |
| commit | 33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21 (patch) | |
| tree | 576f2ec49f576388879ab25e223feb90b675295a /src | |
| parent | kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel... (diff) | |
| parent | gpu_thread: Don't spin wait if there are no GPU commands. (diff) | |
| download | yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.gz yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.tar.xz yuzu-33a6b45a6cc9fef0cbb3b1f65372bb0641e57a21.zip | |
Merge pull request #3155 from bunnei/fix-asynch-gpu-wait
gpu_thread: Don't spin wait if there are no GPU commands.
Diffstat (limited to 'src')
| -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 | |||
| 31 | 31 | ||
| 32 | CommandDataContainer next; | 32 | CommandDataContainer next; |
| 33 | while (state.is_running) { | 33 | while (state.is_running) { |
| 34 | while (!state.queue.Empty()) { | 34 | next = state.queue.PopWait(); |
| 35 | state.queue.Pop(next); | 35 | if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { |
| 36 | if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { | 36 | dma_pusher.Push(std::move(submit_list->entries)); |
| 37 | dma_pusher.Push(std::move(submit_list->entries)); | 37 | dma_pusher.DispatchCalls(); |
| 38 | dma_pusher.DispatchCalls(); | 38 | } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { |
| 39 | } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { | 39 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); |
| 40 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); | 40 | } else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) { |
| 41 | } else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) { | 41 | renderer.Rasterizer().FlushRegion(data->addr, data->size); |
| 42 | renderer.Rasterizer().FlushRegion(data->addr, data->size); | 42 | } else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) { |
| 43 | } else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) { | 43 | renderer.Rasterizer().InvalidateRegion(data->addr, data->size); |
| 44 | renderer.Rasterizer().InvalidateRegion(data->addr, data->size); | 44 | } else if (std::holds_alternative<EndProcessingCommand>(next.data)) { |
| 45 | } else if (std::holds_alternative<EndProcessingCommand>(next.data)) { | 45 | return; |
| 46 | return; | 46 | } else { |
| 47 | } else { | 47 | UNREACHABLE(); |
| 48 | UNREACHABLE(); | ||
| 49 | } | ||
| 50 | state.signaled_fence.store(next.fence); | ||
| 51 | } | 48 | } |
| 49 | state.signaled_fence.store(next.fence); | ||
| 52 | } | 50 | } |
| 53 | } | 51 | } |
| 54 | 52 | ||