diff options
| author | 2021-11-05 15:52:31 +0100 | |
|---|---|---|
| committer | 2022-10-06 21:00:51 +0200 | |
| commit | 139ea93512aeead8a4aee3910a3de86eb109a838 (patch) | |
| tree | 857643fc08617b7035656a51728c399f30c8c2cb /src/video_core/gpu_thread.cpp | |
| parent | NVASGPU: Fix Remap. (diff) | |
| download | yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.tar.gz yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.tar.xz yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.zip | |
VideoCore: implement channels on gpu caches.
Diffstat (limited to 'src/video_core/gpu_thread.cpp')
| -rw-r--r-- | src/video_core/gpu_thread.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index f0e48cfbd..9844cde43 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "common/thread.h" | 8 | #include "common/thread.h" |
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/frontend/emu_window.h" | 10 | #include "core/frontend/emu_window.h" |
| 11 | #include "video_core/control/scheduler.h" | ||
| 11 | #include "video_core/dma_pusher.h" | 12 | #include "video_core/dma_pusher.h" |
| 12 | #include "video_core/gpu.h" | 13 | #include "video_core/gpu.h" |
| 13 | #include "video_core/gpu_thread.h" | 14 | #include "video_core/gpu_thread.h" |
| @@ -18,7 +19,7 @@ namespace VideoCommon::GPUThread { | |||
| 18 | /// Runs the GPU thread | 19 | /// Runs the GPU thread |
| 19 | static void RunThread(std::stop_token stop_token, Core::System& system, | 20 | static void RunThread(std::stop_token stop_token, Core::System& system, |
| 20 | VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context, | 21 | VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context, |
| 21 | Tegra::DmaPusher& dma_pusher, SynchState& state) { | 22 | Tegra::Control::Scheduler& scheduler, SynchState& state) { |
| 22 | std::string name = "GPU"; | 23 | std::string name = "GPU"; |
| 23 | MicroProfileOnThreadCreate(name.c_str()); | 24 | MicroProfileOnThreadCreate(name.c_str()); |
| 24 | SCOPE_EXIT({ MicroProfileOnThreadExit(); }); | 25 | SCOPE_EXIT({ MicroProfileOnThreadExit(); }); |
| @@ -36,8 +37,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system, | |||
| 36 | break; | 37 | break; |
| 37 | } | 38 | } |
| 38 | if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) { | 39 | if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) { |
| 39 | dma_pusher.Push(std::move(submit_list->entries)); | 40 | scheduler.Push(submit_list->channel, std::move(submit_list->entries)); |
| 40 | dma_pusher.DispatchCalls(); | ||
| 41 | } else if (const auto* data = std::get_if<SwapBuffersCommand>(&next.data)) { | 41 | } else if (const auto* data = std::get_if<SwapBuffersCommand>(&next.data)) { |
| 42 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); | 42 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); |
| 43 | } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) { | 43 | } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) { |
| @@ -68,14 +68,14 @@ ThreadManager::~ThreadManager() = default; | |||
| 68 | 68 | ||
| 69 | void ThreadManager::StartThread(VideoCore::RendererBase& renderer, | 69 | void ThreadManager::StartThread(VideoCore::RendererBase& renderer, |
| 70 | Core::Frontend::GraphicsContext& context, | 70 | Core::Frontend::GraphicsContext& context, |
| 71 | Tegra::DmaPusher& dma_pusher) { | 71 | Tegra::Control::Scheduler& scheduler) { |
| 72 | rasterizer = renderer.ReadRasterizer(); | 72 | rasterizer = renderer.ReadRasterizer(); |
| 73 | thread = std::jthread(RunThread, std::ref(system), std::ref(renderer), std::ref(context), | 73 | thread = std::jthread(RunThread, std::ref(system), std::ref(renderer), std::ref(context), |
| 74 | std::ref(dma_pusher), std::ref(state)); | 74 | std::ref(scheduler), std::ref(state)); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void ThreadManager::SubmitList(Tegra::CommandList&& entries) { | 77 | void ThreadManager::SubmitList(s32 channel, Tegra::CommandList&& entries) { |
| 78 | PushCommand(SubmitListCommand(std::move(entries))); | 78 | PushCommand(SubmitListCommand(channel, std::move(entries))); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { | 81 | void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { |