Compare commits

...

1 Commits

Author SHA1 Message Date
bunnei
77b2a82e41 Revert "gpu_thread: Don't spin wait if there are no GPU commands." 2019-11-25 20:11:42 -05:00

View File

@@ -31,22 +31,24 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p
CommandDataContainer next; CommandDataContainer next;
while (state.is_running) { while (state.is_running) {
next = state.queue.PopWait(); while (!state.queue.Empty()) {
if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { state.queue.Pop(next);
dma_pusher.Push(std::move(submit_list->entries)); if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) {
dma_pusher.DispatchCalls(); dma_pusher.Push(std::move(submit_list->entries));
} else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { dma_pusher.DispatchCalls();
renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) {
} else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) { renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr);
renderer.Rasterizer().FlushRegion(data->addr, data->size); } else if (const auto data = std::get_if<FlushRegionCommand>(&next.data)) {
} else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) { renderer.Rasterizer().FlushRegion(data->addr, data->size);
renderer.Rasterizer().InvalidateRegion(data->addr, data->size); } else if (const auto data = std::get_if<InvalidateRegionCommand>(&next.data)) {
} else if (std::holds_alternative<EndProcessingCommand>(next.data)) { renderer.Rasterizer().InvalidateRegion(data->addr, data->size);
return; } else if (std::holds_alternative<EndProcessingCommand>(next.data)) {
} else { return;
UNREACHABLE(); } else {
UNREACHABLE();
}
state.signaled_fence.store(next.fence);
} }
state.signaled_fence.store(next.fence);
} }
} }