summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_asynch.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-10-26 23:02:42 -0700
committerGravatar GitHub2020-10-26 23:02:42 -0700
commitd33399e1f46a10490b586196c6d0db0f04be4206 (patch)
tree8b2e1d98bf832049936ab931fc3a120e70bc36c2 /src/video_core/gpu_asynch.cpp
parentMerge pull request #4832 from bunnei/cpu-manager-microprofile-fix (diff)
parentvideo_core: NVDEC Implementation (diff)
downloadyuzu-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_asynch.cpp')
-rw-r--r--src/video_core/gpu_asynch.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp
index 70a3d5738..a9baaf7ef 100644
--- a/src/video_core/gpu_asynch.cpp
+++ b/src/video_core/gpu_asynch.cpp
@@ -10,12 +10,13 @@
10 10
11namespace VideoCommon { 11namespace VideoCommon {
12 12
13GPUAsynch::GPUAsynch(Core::System& system) : GPU{system, true}, gpu_thread{system} {} 13GPUAsynch::GPUAsynch(Core::System& system, bool use_nvdec)
14 : GPU{system, true, use_nvdec}, gpu_thread{system} {}
14 15
15GPUAsynch::~GPUAsynch() = default; 16GPUAsynch::~GPUAsynch() = default;
16 17
17void GPUAsynch::Start() { 18void GPUAsynch::Start() {
18 gpu_thread.StartThread(*renderer, renderer->Context(), *dma_pusher); 19 gpu_thread.StartThread(*renderer, renderer->Context(), *dma_pusher, *cdma_pusher);
19 cpu_context = renderer->GetRenderWindow().CreateSharedContext(); 20 cpu_context = renderer->GetRenderWindow().CreateSharedContext();
20 cpu_context->MakeCurrent(); 21 cpu_context->MakeCurrent();
21} 22}
@@ -32,6 +33,27 @@ void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) {
32 gpu_thread.SubmitList(std::move(entries)); 33 gpu_thread.SubmitList(std::move(entries));
33} 34}
34 35
36void GPUAsynch::PushCommandBuffer(Tegra::ChCommandHeaderList& entries) {
37 if (!use_nvdec) {
38 return;
39 }
40 // This condition fires when a video stream ends, clear all intermediary data
41 if (entries[0].raw == 0xDEADB33F) {
42 cdma_pusher.reset();
43 return;
44 }
45 if (!cdma_pusher) {
46 cdma_pusher = std::make_unique<Tegra::CDmaPusher>(*this);
47 }
48
49 // SubmitCommandBuffer would make the nvdec operations async, this is not currently working
50 // TODO(ameerj): RE proper async nvdec operation
51 // gpu_thread.SubmitCommandBuffer(std::move(entries));
52
53 cdma_pusher->Push(std::move(entries));
54 cdma_pusher->DispatchCalls();
55}
56
35void GPUAsynch::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { 57void GPUAsynch::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
36 gpu_thread.SwapBuffers(framebuffer); 58 gpu_thread.SwapBuffers(framebuffer);
37} 59}