diff options
| author | 2020-10-26 23:02:42 -0700 | |
|---|---|---|
| committer | 2020-10-26 23:02:42 -0700 | |
| commit | d33399e1f46a10490b586196c6d0db0f04be4206 (patch) | |
| tree | 8b2e1d98bf832049936ab931fc3a120e70bc36c2 /src/video_core/gpu_thread.cpp | |
| parent | Merge pull request #4832 from bunnei/cpu-manager-microprofile-fix (diff) | |
| parent | video_core: NVDEC Implementation (diff) | |
| download | yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.gz yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.xz yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.zip | |
Merge pull request #4729 from ameerj/nvdec-prod
video_core: NVDEC Implementation
Diffstat (limited to 'src/video_core/gpu_thread.cpp')
| -rw-r--r-- | src/video_core/gpu_thread.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index bf761abf2..4b8f58283 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp | |||
| @@ -18,7 +18,7 @@ namespace VideoCommon::GPUThread { | |||
| 18 | /// Runs the GPU thread | 18 | /// Runs the GPU thread |
| 19 | static void RunThread(Core::System& system, VideoCore::RendererBase& renderer, | 19 | static void RunThread(Core::System& system, VideoCore::RendererBase& renderer, |
| 20 | Core::Frontend::GraphicsContext& context, Tegra::DmaPusher& dma_pusher, | 20 | Core::Frontend::GraphicsContext& context, Tegra::DmaPusher& dma_pusher, |
| 21 | SynchState& state) { | 21 | SynchState& state, Tegra::CDmaPusher& cdma_pusher) { |
| 22 | std::string name = "yuzu:GPU"; | 22 | std::string name = "yuzu:GPU"; |
| 23 | MicroProfileOnThreadCreate(name.c_str()); | 23 | MicroProfileOnThreadCreate(name.c_str()); |
| 24 | Common::SetCurrentThreadName(name.c_str()); | 24 | Common::SetCurrentThreadName(name.c_str()); |
| @@ -42,6 +42,10 @@ static void RunThread(Core::System& system, VideoCore::RendererBase& renderer, | |||
| 42 | if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { | 42 | if (const auto submit_list = std::get_if<SubmitListCommand>(&next.data)) { |
| 43 | dma_pusher.Push(std::move(submit_list->entries)); | 43 | dma_pusher.Push(std::move(submit_list->entries)); |
| 44 | dma_pusher.DispatchCalls(); | 44 | dma_pusher.DispatchCalls(); |
| 45 | } else if (const auto command_list = std::get_if<SubmitChCommandEntries>(&next.data)) { | ||
| 46 | // NVDEC | ||
| 47 | cdma_pusher.Push(std::move(command_list->entries)); | ||
| 48 | cdma_pusher.DispatchCalls(); | ||
| 45 | } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { | 49 | } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) { |
| 46 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); | 50 | renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); |
| 47 | } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) { | 51 | } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) { |
| @@ -75,15 +79,19 @@ ThreadManager::~ThreadManager() { | |||
| 75 | 79 | ||
| 76 | void ThreadManager::StartThread(VideoCore::RendererBase& renderer, | 80 | void ThreadManager::StartThread(VideoCore::RendererBase& renderer, |
| 77 | Core::Frontend::GraphicsContext& context, | 81 | Core::Frontend::GraphicsContext& context, |
| 78 | Tegra::DmaPusher& dma_pusher) { | 82 | Tegra::DmaPusher& dma_pusher, Tegra::CDmaPusher& cdma_pusher) { |
| 79 | thread = std::thread{RunThread, std::ref(system), std::ref(renderer), | 83 | thread = std::thread(RunThread, std::ref(system), std::ref(renderer), std::ref(context), |
| 80 | std::ref(context), std::ref(dma_pusher), std::ref(state)}; | 84 | std::ref(dma_pusher), std::ref(state), std::ref(cdma_pusher)); |
| 81 | } | 85 | } |
| 82 | 86 | ||
| 83 | void ThreadManager::SubmitList(Tegra::CommandList&& entries) { | 87 | void ThreadManager::SubmitList(Tegra::CommandList&& entries) { |
| 84 | PushCommand(SubmitListCommand(std::move(entries))); | 88 | PushCommand(SubmitListCommand(std::move(entries))); |
| 85 | } | 89 | } |
| 86 | 90 | ||
| 91 | void ThreadManager::SubmitCommandBuffer(Tegra::ChCommandHeaderList&& entries) { | ||
| 92 | PushCommand(SubmitChCommandEntries(std::move(entries))); | ||
| 93 | } | ||
| 94 | |||
| 87 | void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { | 95 | void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { |
| 88 | PushCommand(SwapBuffersCommand(framebuffer ? std::make_optional(*framebuffer) : std::nullopt)); | 96 | PushCommand(SwapBuffersCommand(framebuffer ? std::make_optional(*framebuffer) : std::nullopt)); |
| 89 | } | 97 | } |