aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryuzubot <yuzu@yuzu-emu.org>2019-11-26 13:01:17 +0000
committeryuzubot <yuzu@yuzu-emu.org>2019-11-26 13:01:17 +0000
commitdcdbe4725cd76eed05e01c9c6171f9322b70f83e (patch)
treeabea7ccf1ed744af86194105f7ddc331e444be72 /src
parent59484442a0a7bf72f6b627a9b0672898314f2dad (diff)
"Merge Tagged PR 3163"
Diffstat (limited to 'src')
-rw-r--r--src/video_core/gpu_thread.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp
index 3efa3d8d0c..758a37f14c 100644
--- a/src/video_core/gpu_thread.cpp
+++ b/src/video_core/gpu_thread.cpp
@@ -31,22 +31,24 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p
CommandDataContainer next;
while (state.is_running) {
- 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();
+ 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);
}
- state.signaled_fence.store(next.fence);
}
}