diff options
author | bunnei <bunneidev@gmail.com> | 2019-01-08 05:32:02 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-03-07 03:09:09 +0100 |
commit | 4483089d704cd4913a748d2198359cc0cf7b32c5 (patch) | |
tree | eed7cefc13f9c5bfc169f37e0499d6d79a1884c7 /src | |
parent | settings: Add new graphics setting for use_asynchronous_gpu_emulation. (diff) | |
download | yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar.gz yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar.bz2 yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar.lz yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar.xz yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.tar.zst yuzu-4483089d704cd4913a748d2198359cc0cf7b32c5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/core.cpp | 2 | ||||
-rw-r--r-- | src/video_core/gpu.cpp | 5 | ||||
-rw-r--r-- | src/video_core/gpu.h | 34 |
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 { is_powered_on = true; - gpu_core = std::make_unique<Tegra::GPU>(system, renderer->Rasterizer()); + gpu_core = std::make_unique<Tegra::GPU>(system, *renderer); cpu_core_manager.Initialize(system); 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 @@ #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_dma.h" #include "video_core/gpu.h" -#include "video_core/rasterizer_interface.h" +#include "video_core/renderer_base.h" namespace Tegra { @@ -28,7 +28,8 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) { UNREACHABLE(); } -GPU::GPU(Core::System& system, VideoCore::RasterizerInterface& rasterizer) { +GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{renderer} { + auto& rasterizer{renderer.Rasterizer()}; memory_manager = std::make_unique<Tegra::MemoryManager>(); dma_pusher = std::make_unique<Tegra::DmaPusher>(*this); 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; } namespace VideoCore { -class RasterizerInterface; -} +class RendererBase; +} // namespace VideoCore namespace Tegra { @@ -121,7 +121,8 @@ enum class EngineID { class GPU final { public: - explicit GPU(Core::System& system, VideoCore::RasterizerInterface& rasterizer); + explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); + ~GPU(); struct MethodCall { @@ -201,8 +202,23 @@ public: } regs{}; private: + void ProcessBindMethod(const MethodCall& method_call); + void ProcessSemaphoreTriggerMethod(); + void ProcessSemaphoreRelease(); + void ProcessSemaphoreAcquire(); + + // Calls a GPU puller method. + void CallPullerMethod(const MethodCall& method_call); + // Calls a GPU engine method. + void CallEngineMethod(const MethodCall& method_call); + // Determines where the method should be executed. + bool ExecuteMethodOnEngine(const MethodCall& method_call); + +private: std::unique_ptr<Tegra::DmaPusher> dma_pusher; std::unique_ptr<Tegra::MemoryManager> memory_manager; + + VideoCore::RendererBase& renderer; /// Mapping of command subchannels to their bound engine ids. std::array<EngineID, 8> bound_engines = {}; @@ -217,18 +233,6 @@ private: std::unique_ptr<Engines::MaxwellDMA> maxwell_dma; /// Inline memory engine std::unique_ptr<Engines::KeplerMemory> kepler_memory; - - void ProcessBindMethod(const MethodCall& method_call); - void ProcessSemaphoreTriggerMethod(); - void ProcessSemaphoreRelease(); - void ProcessSemaphoreAcquire(); - - // Calls a GPU puller method. - void CallPullerMethod(const MethodCall& method_call); - // Calls a GPU engine method. - void CallEngineMethod(const MethodCall& method_call); - // Determines where the method should be executed. - bool ExecuteMethodOnEngine(const MethodCall& method_call); }; #define ASSERT_REG_POSITION(field_name, position) \ |