summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-02-08 23:21:53 -0500
committerGravatar bunnei2019-03-06 21:48:57 -0500
commitaaa373585cd55bd03fcc589d2ad9f749e2cb99d4 (patch)
tree1da617fd05d84d59910d585a6b01af2c89f3ed36 /src/video_core/gpu.cpp
parentgpu: Move command processing to another thread. (diff)
downloadyuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.tar.gz
yuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.tar.xz
yuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.zip
gpu: Refactor a/synchronous implementations into their own classes.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 0d7a052dd..08abf8ac9 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -6,14 +6,12 @@
6#include "core/core.h" 6#include "core/core.h"
7#include "core/core_timing.h" 7#include "core/core_timing.h"
8#include "core/memory.h" 8#include "core/memory.h"
9#include "core/settings.h"
10#include "video_core/engines/fermi_2d.h" 9#include "video_core/engines/fermi_2d.h"
11#include "video_core/engines/kepler_compute.h" 10#include "video_core/engines/kepler_compute.h"
12#include "video_core/engines/kepler_memory.h" 11#include "video_core/engines/kepler_memory.h"
13#include "video_core/engines/maxwell_3d.h" 12#include "video_core/engines/maxwell_3d.h"
14#include "video_core/engines/maxwell_dma.h" 13#include "video_core/engines/maxwell_dma.h"
15#include "video_core/gpu.h" 14#include "video_core/gpu.h"
16#include "video_core/gpu_thread.h"
17#include "video_core/renderer_base.h" 15#include "video_core/renderer_base.h"
18 16
19namespace Tegra { 17namespace Tegra {
@@ -39,10 +37,6 @@ GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{ren
39 kepler_compute = std::make_unique<Engines::KeplerCompute>(*memory_manager); 37 kepler_compute = std::make_unique<Engines::KeplerCompute>(*memory_manager);
40 maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, rasterizer, *memory_manager); 38 maxwell_dma = std::make_unique<Engines::MaxwellDMA>(system, rasterizer, *memory_manager);
41 kepler_memory = std::make_unique<Engines::KeplerMemory>(system, rasterizer, *memory_manager); 39 kepler_memory = std::make_unique<Engines::KeplerMemory>(system, rasterizer, *memory_manager);
42
43 if (Settings::values.use_asynchronous_gpu_emulation) {
44 gpu_thread = std::make_unique<VideoCommon::GPUThread::ThreadManager>(renderer, *dma_pusher);
45 }
46} 40}
47 41
48GPU::~GPU() = default; 42GPU::~GPU() = default;
@@ -71,48 +65,6 @@ const DmaPusher& GPU::DmaPusher() const {
71 return *dma_pusher; 65 return *dma_pusher;
72} 66}
73 67
74void GPU::PushGPUEntries(Tegra::CommandList&& entries) {
75 if (Settings::values.use_asynchronous_gpu_emulation) {
76 gpu_thread->SubmitList(std::move(entries));
77 } else {
78 dma_pusher->Push(std::move(entries));
79 dma_pusher->DispatchCalls();
80 }
81}
82
83void GPU::SwapBuffers(
84 std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) {
85 if (Settings::values.use_asynchronous_gpu_emulation) {
86 gpu_thread->SwapBuffers(std::move(framebuffer));
87 } else {
88 renderer.SwapBuffers(std::move(framebuffer));
89 }
90}
91
92void GPU::FlushRegion(VAddr addr, u64 size) {
93 if (Settings::values.use_asynchronous_gpu_emulation) {
94 gpu_thread->FlushRegion(addr, size);
95 } else {
96 renderer.Rasterizer().FlushRegion(addr, size);
97 }
98}
99
100void GPU::InvalidateRegion(VAddr addr, u64 size) {
101 if (Settings::values.use_asynchronous_gpu_emulation) {
102 gpu_thread->InvalidateRegion(addr, size);
103 } else {
104 renderer.Rasterizer().InvalidateRegion(addr, size);
105 }
106}
107
108void GPU::FlushAndInvalidateRegion(VAddr addr, u64 size) {
109 if (Settings::values.use_asynchronous_gpu_emulation) {
110 gpu_thread->FlushAndInvalidateRegion(addr, size);
111 } else {
112 renderer.Rasterizer().FlushAndInvalidateRegion(addr, size);
113 }
114}
115
116u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { 68u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
117 ASSERT(format != RenderTargetFormat::NONE); 69 ASSERT(format != RenderTargetFormat::NONE);
118 70