diff options
| author | 2018-03-18 15:15:05 -0500 | |
|---|---|---|
| committer | 2018-03-18 15:23:24 -0500 | |
| commit | a64b936cbe6e779627f69ebde85a3055ccd6c2de (patch) | |
| tree | 134b00ab118a890e7903688f1e13289ddba9344e /src/video_core | |
| parent | Merge pull request #246 from Subv/gpu_macro_calls (diff) | |
| download | yuzu-a64b936cbe6e779627f69ebde85a3055ccd6c2de.tar.gz yuzu-a64b936cbe6e779627f69ebde85a3055ccd6c2de.tar.xz yuzu-a64b936cbe6e779627f69ebde85a3055ccd6c2de.zip | |
GPU: Move the GPU's class constructor and destructors to a cpp file.
This should reduce recompile times when editing the Maxwell3D register structure.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/video_core/gpu.cpp | 21 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 18 |
3 files changed, 30 insertions, 10 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index ed87f8ff1..2f946e7be 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -7,6 +7,7 @@ add_library(video_core STATIC | |||
| 7 | engines/maxwell_3d.h | 7 | engines/maxwell_3d.h |
| 8 | engines/maxwell_compute.cpp | 8 | engines/maxwell_compute.cpp |
| 9 | engines/maxwell_compute.h | 9 | engines/maxwell_compute.h |
| 10 | gpu.cpp | ||
| 10 | gpu.h | 11 | gpu.h |
| 11 | memory_manager.cpp | 12 | memory_manager.cpp |
| 12 | memory_manager.h | 13 | memory_manager.h |
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp new file mode 100644 index 000000000..c384d236e --- /dev/null +++ b/src/video_core/gpu.cpp | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "video_core/engines/fermi_2d.h" | ||
| 6 | #include "video_core/engines/maxwell_3d.h" | ||
| 7 | #include "video_core/engines/maxwell_compute.h" | ||
| 8 | #include "video_core/gpu.h" | ||
| 9 | |||
| 10 | namespace Tegra { | ||
| 11 | |||
| 12 | GPU::GPU() { | ||
| 13 | memory_manager = std::make_unique<MemoryManager>(); | ||
| 14 | maxwell_3d = std::make_unique<Engines::Maxwell3D>(*memory_manager); | ||
| 15 | fermi_2d = std::make_unique<Engines::Fermi2D>(); | ||
| 16 | maxwell_compute = std::make_unique<Engines::MaxwellCompute>(); | ||
| 17 | } | ||
| 18 | |||
| 19 | GPU::~GPU() = default; | ||
| 20 | |||
| 21 | } // namespace Tegra | ||
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index d2e4ff52d..2a9064ba3 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -8,13 +8,16 @@ | |||
| 8 | #include <unordered_map> | 8 | #include <unordered_map> |
| 9 | #include <vector> | 9 | #include <vector> |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "video_core/engines/fermi_2d.h" | ||
| 12 | #include "video_core/engines/maxwell_3d.h" | ||
| 13 | #include "video_core/engines/maxwell_compute.h" | ||
| 14 | #include "video_core/memory_manager.h" | 11 | #include "video_core/memory_manager.h" |
| 15 | 12 | ||
| 16 | namespace Tegra { | 13 | namespace Tegra { |
| 17 | 14 | ||
| 15 | namespace Engines { | ||
| 16 | class Fermi2D; | ||
| 17 | class Maxwell3D; | ||
| 18 | class MaxwellCompute; | ||
| 19 | } // namespace Engines | ||
| 20 | |||
| 18 | enum class EngineID { | 21 | enum class EngineID { |
| 19 | FERMI_TWOD_A = 0x902D, // 2D Engine | 22 | FERMI_TWOD_A = 0x902D, // 2D Engine |
| 20 | MAXWELL_B = 0xB197, // 3D Engine | 23 | MAXWELL_B = 0xB197, // 3D Engine |
| @@ -25,13 +28,8 @@ enum class EngineID { | |||
| 25 | 28 | ||
| 26 | class GPU final { | 29 | class GPU final { |
| 27 | public: | 30 | public: |
| 28 | GPU() { | 31 | GPU(); |
| 29 | memory_manager = std::make_unique<MemoryManager>(); | 32 | ~GPU(); |
| 30 | maxwell_3d = std::make_unique<Engines::Maxwell3D>(*memory_manager); | ||
| 31 | fermi_2d = std::make_unique<Engines::Fermi2D>(); | ||
| 32 | maxwell_compute = std::make_unique<Engines::MaxwellCompute>(); | ||
| 33 | } | ||
| 34 | ~GPU() = default; | ||
| 35 | 33 | ||
| 36 | /// Processes a command list stored at the specified address in GPU memory. | 34 | /// Processes a command list stored at the specified address in GPU memory. |
| 37 | void ProcessCommandList(GPUVAddr address, u32 size); | 35 | void ProcessCommandList(GPUVAddr address, u32 size); |