summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core.cpp2
-rw-r--r--src/video_core/gpu.cpp5
-rw-r--r--src/video_core/gpu.h34
3 files changed, 23 insertions, 18 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 11094a87a..9e5d167c3 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -131,7 +131,7 @@ struct System::Impl {
131 131
132 is_powered_on = true; 132 is_powered_on = true;
133 133
134 gpu_core = std::make_unique<Tegra::GPU>(system, renderer->Rasterizer()); 134 gpu_core = std::make_unique<Tegra::GPU>(system, *renderer);
135 135
136 cpu_core_manager.Initialize(system); 136 cpu_core_manager.Initialize(system);
137 137
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index ac30d1a89..08abf8ac9 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -12,7 +12,7 @@
12#include "video_core/engines/maxwell_3d.h" 12#include "video_core/engines/maxwell_3d.h"
13#include "video_core/engines/maxwell_dma.h" 13#include "video_core/engines/maxwell_dma.h"
14#include "video_core/gpu.h" 14#include "video_core/gpu.h"
15#include "video_core/rasterizer_interface.h" 15#include "video_core/renderer_base.h"
16 16
17namespace Tegra { 17namespace Tegra {
18 18
@@ -28,7 +28,8 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
28 UNREACHABLE(); 28 UNREACHABLE();
29} 29}
30 30
31GPU::GPU(Core::System& system, VideoCore::RasterizerInterface& rasterizer) { 31GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{renderer} {
32 auto& rasterizer{renderer.Rasterizer()};
32 memory_manager = std::make_unique<Tegra::MemoryManager>(); 33 memory_manager = std::make_unique<Tegra::MemoryManager>();
33 dma_pusher = std::make_unique<Tegra::DmaPusher>(*this); 34 dma_pusher = std::make_unique<Tegra::DmaPusher>(*this);
34 maxwell_3d = std::make_unique<Engines::Maxwell3D>(system, rasterizer, *memory_manager); 35 maxwell_3d = std::make_unique<Engines::Maxwell3D>(system, rasterizer, *memory_manager);
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 6313702f2..ac7aec6a4 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -16,8 +16,8 @@ class System;
16} 16}
17 17
18namespace VideoCore { 18namespace VideoCore {
19class RasterizerInterface; 19class RendererBase;
20} 20} // namespace VideoCore
21 21
22namespace Tegra { 22namespace Tegra {
23 23
@@ -121,7 +121,8 @@ enum class EngineID {
121 121
122class GPU final { 122class GPU final {
123public: 123public:
124 explicit GPU(Core::System& system, VideoCore::RasterizerInterface& rasterizer); 124 explicit GPU(Core::System& system, VideoCore::RendererBase& renderer);
125
125 ~GPU(); 126 ~GPU();
126 127
127 struct MethodCall { 128 struct MethodCall {
@@ -201,8 +202,23 @@ public:
201 } regs{}; 202 } regs{};
202 203
203private: 204private:
205 void ProcessBindMethod(const MethodCall& method_call);
206 void ProcessSemaphoreTriggerMethod();
207 void ProcessSemaphoreRelease();
208 void ProcessSemaphoreAcquire();
209
210 // Calls a GPU puller method.
211 void CallPullerMethod(const MethodCall& method_call);
212 // Calls a GPU engine method.
213 void CallEngineMethod(const MethodCall& method_call);
214 // Determines where the method should be executed.
215 bool ExecuteMethodOnEngine(const MethodCall& method_call);
216
217private:
204 std::unique_ptr<Tegra::DmaPusher> dma_pusher; 218 std::unique_ptr<Tegra::DmaPusher> dma_pusher;
205 std::unique_ptr<Tegra::MemoryManager> memory_manager; 219 std::unique_ptr<Tegra::MemoryManager> memory_manager;
220
221 VideoCore::RendererBase& renderer;
206 222
207 /// Mapping of command subchannels to their bound engine ids. 223 /// Mapping of command subchannels to their bound engine ids.
208 std::array<EngineID, 8> bound_engines = {}; 224 std::array<EngineID, 8> bound_engines = {};
@@ -217,18 +233,6 @@ private:
217 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma; 233 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma;
218 /// Inline memory engine 234 /// Inline memory engine
219 std::unique_ptr<Engines::KeplerMemory> kepler_memory; 235 std::unique_ptr<Engines::KeplerMemory> kepler_memory;
220
221 void ProcessBindMethod(const MethodCall& method_call);
222 void ProcessSemaphoreTriggerMethod();
223 void ProcessSemaphoreRelease();
224 void ProcessSemaphoreAcquire();
225
226 // Calls a GPU puller method.
227 void CallPullerMethod(const MethodCall& method_call);
228 // Calls a GPU engine method.
229 void CallEngineMethod(const MethodCall& method_call);
230 // Determines where the method should be executed.
231 bool ExecuteMethodOnEngine(const MethodCall& method_call);
232}; 236};
233 237
234#define ASSERT_REG_POSITION(field_name, position) \ 238#define ASSERT_REG_POSITION(field_name, position) \