summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_thread.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-02-28 22:03:00 -0500
committerGravatar ameerj2021-02-28 22:03:00 -0500
commit52e9d7fa49c1da30ece8909d80e3aeafeda2760e (patch)
tree39ae6f5764683db4ad4b04a36041ee7272f77246 /src/video_core/gpu_thread.cpp
parentMerge pull request #6007 from bunnei/ldn-error (diff)
downloadyuzu-52e9d7fa49c1da30ece8909d80e3aeafeda2760e.tar.gz
yuzu-52e9d7fa49c1da30ece8909d80e3aeafeda2760e.tar.xz
yuzu-52e9d7fa49c1da30ece8909d80e3aeafeda2760e.zip
gpu_thread: Remove Async NVDEC placeholders
This commit removes early placeholders for an implementation of async nvdec. With recent changes to the source code, the placeholders are no longer accurate, and can cause a nullptr dereference due to the nature of the cdma_pusher lifetime.
Diffstat (limited to 'src/video_core/gpu_thread.cpp')
-rw-r--r--src/video_core/gpu_thread.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp
index eb0e43c0c..99353f15f 100644
--- a/src/video_core/gpu_thread.cpp
+++ b/src/video_core/gpu_thread.cpp
@@ -19,7 +19,7 @@ namespace VideoCommon::GPUThread {
19/// Runs the GPU thread 19/// Runs the GPU thread
20static void RunThread(Core::System& system, VideoCore::RendererBase& renderer, 20static void RunThread(Core::System& system, VideoCore::RendererBase& renderer,
21 Core::Frontend::GraphicsContext& context, Tegra::DmaPusher& dma_pusher, 21 Core::Frontend::GraphicsContext& context, Tegra::DmaPusher& dma_pusher,
22 SynchState& state, Tegra::CDmaPusher& cdma_pusher) { 22 SynchState& state) {
23 std::string name = "yuzu:GPU"; 23 std::string name = "yuzu:GPU";
24 MicroProfileOnThreadCreate(name.c_str()); 24 MicroProfileOnThreadCreate(name.c_str());
25 SCOPE_EXIT({ MicroProfileOnThreadExit(); }); 25 SCOPE_EXIT({ MicroProfileOnThreadExit(); });
@@ -46,9 +46,6 @@ static void RunThread(Core::System& system, VideoCore::RendererBase& renderer,
46 if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) { 46 if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) {
47 dma_pusher.Push(std::move(submit_list->entries)); 47 dma_pusher.Push(std::move(submit_list->entries));
48 dma_pusher.DispatchCalls(); 48 dma_pusher.DispatchCalls();
49 } else if (auto* command_list = std::get_if<SubmitChCommandEntries>(&next.data)) {
50 // NVDEC
51 cdma_pusher.ProcessEntries(std::move(command_list->entries));
52 } else if (const auto* data = std::get_if<SwapBuffersCommand>(&next.data)) { 49 } else if (const auto* data = std::get_if<SwapBuffersCommand>(&next.data)) {
53 renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr); 50 renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr);
54 } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) { 51 } else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) {
@@ -83,20 +80,16 @@ ThreadManager::~ThreadManager() {
83 80
84void ThreadManager::StartThread(VideoCore::RendererBase& renderer, 81void ThreadManager::StartThread(VideoCore::RendererBase& renderer,
85 Core::Frontend::GraphicsContext& context, 82 Core::Frontend::GraphicsContext& context,
86 Tegra::DmaPusher& dma_pusher, Tegra::CDmaPusher& cdma_pusher) { 83 Tegra::DmaPusher& dma_pusher) {
87 rasterizer = renderer.ReadRasterizer(); 84 rasterizer = renderer.ReadRasterizer();
88 thread = std::thread(RunThread, std::ref(system), std::ref(renderer), std::ref(context), 85 thread = std::thread(RunThread, std::ref(system), std::ref(renderer), std::ref(context),
89 std::ref(dma_pusher), std::ref(state), std::ref(cdma_pusher)); 86 std::ref(dma_pusher), std::ref(state));
90} 87}
91 88
92void ThreadManager::SubmitList(Tegra::CommandList&& entries) { 89void ThreadManager::SubmitList(Tegra::CommandList&& entries) {
93 PushCommand(SubmitListCommand(std::move(entries))); 90 PushCommand(SubmitListCommand(std::move(entries)));
94} 91}
95 92
96void ThreadManager::SubmitCommandBuffer(Tegra::ChCommandHeaderList&& entries) {
97 PushCommand(SubmitChCommandEntries(std::move(entries)));
98}
99
100void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { 93void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
101 PushCommand(SwapBuffersCommand(framebuffer ? std::make_optional(*framebuffer) : std::nullopt)); 94 PushCommand(SwapBuffersCommand(framebuffer ? std::make_optional(*framebuffer) : std::nullopt));
102} 95}