summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-11-23 21:17:28 +0100
committerbunnei <bunneidev@gmail.com>2019-11-23 21:17:28 +0100
commit9ec84fc592ca2dbe345123574ec4664186476aea (patch)
tree109c4bb7b5468fc79da6111acec3b8f04c956198 /src
parentMerge pull request #3114 from FernandoS27/cond-var (diff)
downloadyuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar.gz
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar.bz2
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar.lz
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar.xz
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.tar.zst
yuzu-9ec84fc592ca2dbe345123574ec4664186476aea.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/gpu_thread.cpp32
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);
}
}