diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/gpu.h | 6 | ||||
| -rw-r--r-- | src/video_core/gpu_asynch.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/gpu_asynch.h | 2 | ||||
| -rw-r--r-- | src/video_core/gpu_synch.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/gpu_synch.h | 2 |
5 files changed, 25 insertions, 2 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index a1b4c305c..2c42483bd 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -284,6 +284,12 @@ public: | |||
| 284 | /// core timing events. | 284 | /// core timing events. |
| 285 | virtual void Start() = 0; | 285 | virtual void Start() = 0; |
| 286 | 286 | ||
| 287 | /// Obtain the CPU Context | ||
| 288 | virtual void ObtainContext() = 0; | ||
| 289 | |||
| 290 | /// Release the CPU Context | ||
| 291 | virtual void ReleaseContext() = 0; | ||
| 292 | |||
| 287 | /// Push GPU command entries to be processed | 293 | /// Push GPU command entries to be processed |
| 288 | virtual void PushGPUEntries(Tegra::CommandList&& entries) = 0; | 294 | virtual void PushGPUEntries(Tegra::CommandList&& entries) = 0; |
| 289 | 295 | ||
diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp index 53305ab43..7b855f63e 100644 --- a/src/video_core/gpu_asynch.cpp +++ b/src/video_core/gpu_asynch.cpp | |||
| @@ -19,10 +19,17 @@ GPUAsynch::GPUAsynch(Core::System& system, std::unique_ptr<VideoCore::RendererBa | |||
| 19 | GPUAsynch::~GPUAsynch() = default; | 19 | GPUAsynch::~GPUAsynch() = default; |
| 20 | 20 | ||
| 21 | void GPUAsynch::Start() { | 21 | void GPUAsynch::Start() { |
| 22 | cpu_context->MakeCurrent(); | ||
| 23 | gpu_thread.StartThread(*renderer, *gpu_context, *dma_pusher); | 22 | gpu_thread.StartThread(*renderer, *gpu_context, *dma_pusher); |
| 24 | } | 23 | } |
| 25 | 24 | ||
| 25 | void GPUAsynch::ObtainContext() { | ||
| 26 | cpu_context->MakeCurrent(); | ||
| 27 | } | ||
| 28 | |||
| 29 | void GPUAsynch::ReleaseContext() { | ||
| 30 | cpu_context->DoneCurrent(); | ||
| 31 | } | ||
| 32 | |||
| 26 | void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) { | 33 | void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) { |
| 27 | gpu_thread.SubmitList(std::move(entries)); | 34 | gpu_thread.SubmitList(std::move(entries)); |
| 28 | } | 35 | } |
diff --git a/src/video_core/gpu_asynch.h b/src/video_core/gpu_asynch.h index 517658612..15e9f1d38 100644 --- a/src/video_core/gpu_asynch.h +++ b/src/video_core/gpu_asynch.h | |||
| @@ -25,6 +25,8 @@ public: | |||
| 25 | ~GPUAsynch() override; | 25 | ~GPUAsynch() override; |
| 26 | 26 | ||
| 27 | void Start() override; | 27 | void Start() override; |
| 28 | void ObtainContext() override; | ||
| 29 | void ReleaseContext() override; | ||
| 28 | void PushGPUEntries(Tegra::CommandList&& entries) override; | 30 | void PushGPUEntries(Tegra::CommandList&& entries) override; |
| 29 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; | 31 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; |
| 30 | void FlushRegion(VAddr addr, u64 size) override; | 32 | void FlushRegion(VAddr addr, u64 size) override; |
diff --git a/src/video_core/gpu_synch.cpp b/src/video_core/gpu_synch.cpp index 6f38a672a..aaeb9811d 100644 --- a/src/video_core/gpu_synch.cpp +++ b/src/video_core/gpu_synch.cpp | |||
| @@ -13,10 +13,16 @@ GPUSynch::GPUSynch(Core::System& system, std::unique_ptr<VideoCore::RendererBase | |||
| 13 | 13 | ||
| 14 | GPUSynch::~GPUSynch() = default; | 14 | GPUSynch::~GPUSynch() = default; |
| 15 | 15 | ||
| 16 | void GPUSynch::Start() { | 16 | void GPUSynch::Start() {} |
| 17 | |||
| 18 | void GPUSynch::ObtainContext() { | ||
| 17 | context->MakeCurrent(); | 19 | context->MakeCurrent(); |
| 18 | } | 20 | } |
| 19 | 21 | ||
| 22 | void GPUSynch::ReleaseContext() { | ||
| 23 | context->DoneCurrent(); | ||
| 24 | } | ||
| 25 | |||
| 20 | void GPUSynch::PushGPUEntries(Tegra::CommandList&& entries) { | 26 | void GPUSynch::PushGPUEntries(Tegra::CommandList&& entries) { |
| 21 | dma_pusher->Push(std::move(entries)); | 27 | dma_pusher->Push(std::move(entries)); |
| 22 | dma_pusher->DispatchCalls(); | 28 | dma_pusher->DispatchCalls(); |
diff --git a/src/video_core/gpu_synch.h b/src/video_core/gpu_synch.h index 4a6e9a01d..762c20aa5 100644 --- a/src/video_core/gpu_synch.h +++ b/src/video_core/gpu_synch.h | |||
| @@ -24,6 +24,8 @@ public: | |||
| 24 | ~GPUSynch() override; | 24 | ~GPUSynch() override; |
| 25 | 25 | ||
| 26 | void Start() override; | 26 | void Start() override; |
| 27 | void ObtainContext() override; | ||
| 28 | void ReleaseContext() override; | ||
| 27 | void PushGPUEntries(Tegra::CommandList&& entries) override; | 29 | void PushGPUEntries(Tegra::CommandList&& entries) override; |
| 28 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; | 30 | void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override; |
| 29 | void FlushRegion(VAddr addr, u64 size) override; | 31 | void FlushRegion(VAddr addr, u64 size) override; |