diff options
| author | 2019-04-05 23:44:27 -0400 | |
|---|---|---|
| committer | 2019-04-05 23:44:27 -0400 | |
| commit | e3402d976d1ae0f3861d3d393b87c072047c6125 (patch) | |
| tree | 21ed57282f9c8165d95612c149da583039f7253f /src | |
| parent | Merge pull request #2350 from lioncash/vmem (diff) | |
| parent | video_core/engines: Make memory manager members private (diff) | |
| download | yuzu-e3402d976d1ae0f3861d3d393b87c072047c6125.tar.gz yuzu-e3402d976d1ae0f3861d3d393b87c072047c6125.tar.xz yuzu-e3402d976d1ae0f3861d3d393b87c072047c6125.zip | |
Merge pull request #2346 from lioncash/header
video_core/engines: Remove unnecessary inclusions where applicable
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 8 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.h | 10 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.h | 7 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 8 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.cpp | 1 |
10 files changed, 39 insertions, 22 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 03b7ee5d8..55966eef1 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -6,12 +6,13 @@ | |||
| 6 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "common/math_util.h" | 7 | #include "common/math_util.h" |
| 8 | #include "video_core/engines/fermi_2d.h" | 8 | #include "video_core/engines/fermi_2d.h" |
| 9 | #include "video_core/memory_manager.h" | ||
| 9 | #include "video_core/rasterizer_interface.h" | 10 | #include "video_core/rasterizer_interface.h" |
| 10 | 11 | ||
| 11 | namespace Tegra::Engines { | 12 | namespace Tegra::Engines { |
| 12 | 13 | ||
| 13 | Fermi2D::Fermi2D(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager) | 14 | Fermi2D::Fermi2D(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager) |
| 14 | : memory_manager(memory_manager), rasterizer{rasterizer} {} | 15 | : rasterizer{rasterizer}, memory_manager{memory_manager} {} |
| 15 | 16 | ||
| 16 | void Fermi2D::CallMethod(const GPU::MethodCall& method_call) { | 17 | void Fermi2D::CallMethod(const GPU::MethodCall& method_call) { |
| 17 | ASSERT_MSG(method_call.method < Regs::NUM_REGS, | 18 | ASSERT_MSG(method_call.method < Regs::NUM_REGS, |
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index 80523e320..2e51b7f13 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -10,7 +10,10 @@ | |||
| 10 | #include "common/common_funcs.h" | 10 | #include "common/common_funcs.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | 13 | |
| 14 | namespace Tegra { | ||
| 15 | class MemoryManager; | ||
| 16 | } | ||
| 14 | 17 | ||
| 15 | namespace VideoCore { | 18 | namespace VideoCore { |
| 16 | class RasterizerInterface; | 19 | class RasterizerInterface; |
| @@ -115,10 +118,9 @@ public: | |||
| 115 | }; | 118 | }; |
| 116 | } regs{}; | 119 | } regs{}; |
| 117 | 120 | ||
| 118 | MemoryManager& memory_manager; | ||
| 119 | |||
| 120 | private: | 121 | private: |
| 121 | VideoCore::RasterizerInterface& rasterizer; | 122 | VideoCore::RasterizerInterface& rasterizer; |
| 123 | MemoryManager& memory_manager; | ||
| 122 | 124 | ||
| 123 | /// Performs the copy from the source surface to the destination surface as configured in the | 125 | /// Performs the copy from the source surface to the destination surface as configured in the |
| 124 | /// registers. | 126 | /// registers. |
diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index 6575afd0f..fb6cdf432 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h | |||
| @@ -9,7 +9,10 @@ | |||
| 9 | #include "common/common_funcs.h" | 9 | #include "common/common_funcs.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "video_core/gpu.h" | 11 | #include "video_core/gpu.h" |
| 12 | #include "video_core/memory_manager.h" | 12 | |
| 13 | namespace Tegra { | ||
| 14 | class MemoryManager; | ||
| 15 | } | ||
| 13 | 16 | ||
| 14 | namespace Tegra::Engines { | 17 | namespace Tegra::Engines { |
| 15 | 18 | ||
| @@ -40,10 +43,11 @@ public: | |||
| 40 | static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), | 43 | static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), |
| 41 | "KeplerCompute Regs has wrong size"); | 44 | "KeplerCompute Regs has wrong size"); |
| 42 | 45 | ||
| 43 | MemoryManager& memory_manager; | ||
| 44 | |||
| 45 | /// Write the value to the register identified by method. | 46 | /// Write the value to the register identified by method. |
| 46 | void CallMethod(const GPU::MethodCall& method_call); | 47 | void CallMethod(const GPU::MethodCall& method_call); |
| 48 | |||
| 49 | private: | ||
| 50 | MemoryManager& memory_manager; | ||
| 47 | }; | 51 | }; |
| 48 | 52 | ||
| 49 | #define ASSERT_REG_POSITION(field_name, position) \ | 53 | #define ASSERT_REG_POSITION(field_name, position) \ |
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index e259bf46b..cd51a31d7 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/memory.h" | ||
| 9 | #include "video_core/engines/kepler_memory.h" | 8 | #include "video_core/engines/kepler_memory.h" |
| 10 | #include "video_core/engines/maxwell_3d.h" | 9 | #include "video_core/engines/maxwell_3d.h" |
| 10 | #include "video_core/memory_manager.h" | ||
| 11 | #include "video_core/rasterizer_interface.h" | 11 | #include "video_core/rasterizer_interface.h" |
| 12 | #include "video_core/renderer_base.h" | 12 | #include "video_core/renderer_base.h" |
| 13 | 13 | ||
| @@ -15,7 +15,7 @@ namespace Tegra::Engines { | |||
| 15 | 15 | ||
| 16 | KeplerMemory::KeplerMemory(Core::System& system, VideoCore::RasterizerInterface& rasterizer, | 16 | KeplerMemory::KeplerMemory(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
| 17 | MemoryManager& memory_manager) | 17 | MemoryManager& memory_manager) |
| 18 | : system{system}, memory_manager(memory_manager), rasterizer{rasterizer} {} | 18 | : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager} {} |
| 19 | 19 | ||
| 20 | KeplerMemory::~KeplerMemory() = default; | 20 | KeplerMemory::~KeplerMemory() = default; |
| 21 | 21 | ||
diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.h index 9181e9d80..78b6c3e45 100644 --- a/src/video_core/engines/kepler_memory.h +++ b/src/video_core/engines/kepler_memory.h | |||
| @@ -10,12 +10,15 @@ | |||
| 10 | #include "common/common_funcs.h" | 10 | #include "common/common_funcs.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | ||
| 14 | 13 | ||
| 15 | namespace Core { | 14 | namespace Core { |
| 16 | class System; | 15 | class System; |
| 17 | } | 16 | } |
| 18 | 17 | ||
| 18 | namespace Tegra { | ||
| 19 | class MemoryManager; | ||
| 20 | } | ||
| 21 | |||
| 19 | namespace VideoCore { | 22 | namespace VideoCore { |
| 20 | class RasterizerInterface; | 23 | class RasterizerInterface; |
| 21 | } | 24 | } |
| @@ -82,8 +85,8 @@ public: | |||
| 82 | 85 | ||
| 83 | private: | 86 | private: |
| 84 | Core::System& system; | 87 | Core::System& system; |
| 85 | MemoryManager& memory_manager; | ||
| 86 | VideoCore::RasterizerInterface& rasterizer; | 88 | VideoCore::RasterizerInterface& rasterizer; |
| 89 | MemoryManager& memory_manager; | ||
| 87 | 90 | ||
| 88 | void ProcessData(u32 data); | 91 | void ProcessData(u32 data); |
| 89 | }; | 92 | }; |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index defcfbd3f..3c3ac8f81 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -7,11 +7,10 @@ | |||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/core_timing.h" | 9 | #include "core/core_timing.h" |
| 10 | #include "core/memory.h" | ||
| 11 | #include "video_core/debug_utils/debug_utils.h" | 10 | #include "video_core/debug_utils/debug_utils.h" |
| 12 | #include "video_core/engines/maxwell_3d.h" | 11 | #include "video_core/engines/maxwell_3d.h" |
| 12 | #include "video_core/memory_manager.h" | ||
| 13 | #include "video_core/rasterizer_interface.h" | 13 | #include "video_core/rasterizer_interface.h" |
| 14 | #include "video_core/renderer_base.h" | ||
| 15 | #include "video_core/textures/texture.h" | 14 | #include "video_core/textures/texture.h" |
| 16 | 15 | ||
| 17 | namespace Tegra::Engines { | 16 | namespace Tegra::Engines { |
| @@ -21,8 +20,8 @@ constexpr u32 MacroRegistersStart = 0xE00; | |||
| 21 | 20 | ||
| 22 | Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer, | 21 | Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
| 23 | MemoryManager& memory_manager) | 22 | MemoryManager& memory_manager) |
| 24 | : memory_manager(memory_manager), system{system}, rasterizer{rasterizer}, | 23 | : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager}, macro_interpreter{ |
| 25 | macro_interpreter(*this) { | 24 | *this} { |
| 26 | InitializeRegisterDefaults(); | 25 | InitializeRegisterDefaults(); |
| 27 | } | 26 | } |
| 28 | 27 | ||
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 7fbf1026e..b352060a1 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -16,13 +16,16 @@ | |||
| 16 | #include "common/math_util.h" | 16 | #include "common/math_util.h" |
| 17 | #include "video_core/gpu.h" | 17 | #include "video_core/gpu.h" |
| 18 | #include "video_core/macro_interpreter.h" | 18 | #include "video_core/macro_interpreter.h" |
| 19 | #include "video_core/memory_manager.h" | ||
| 20 | #include "video_core/textures/texture.h" | 19 | #include "video_core/textures/texture.h" |
| 21 | 20 | ||
| 22 | namespace Core { | 21 | namespace Core { |
| 23 | class System; | 22 | class System; |
| 24 | } | 23 | } |
| 25 | 24 | ||
| 25 | namespace Tegra { | ||
| 26 | class MemoryManager; | ||
| 27 | } | ||
| 28 | |||
| 26 | namespace VideoCore { | 29 | namespace VideoCore { |
| 27 | class RasterizerInterface; | 30 | class RasterizerInterface; |
| 28 | } | 31 | } |
| @@ -1093,7 +1096,6 @@ public: | |||
| 1093 | }; | 1096 | }; |
| 1094 | 1097 | ||
| 1095 | State state{}; | 1098 | State state{}; |
| 1096 | MemoryManager& memory_manager; | ||
| 1097 | 1099 | ||
| 1098 | struct DirtyFlags { | 1100 | struct DirtyFlags { |
| 1099 | std::bitset<8> color_buffer{0xFF}; | 1101 | std::bitset<8> color_buffer{0xFF}; |
| @@ -1141,6 +1143,8 @@ private: | |||
| 1141 | 1143 | ||
| 1142 | VideoCore::RasterizerInterface& rasterizer; | 1144 | VideoCore::RasterizerInterface& rasterizer; |
| 1143 | 1145 | ||
| 1146 | MemoryManager& memory_manager; | ||
| 1147 | |||
| 1144 | /// Start offsets of each macro in macro_memory | 1148 | /// Start offsets of each macro in macro_memory |
| 1145 | std::unordered_map<u32, u32> macro_offsets; | 1149 | std::unordered_map<u32, u32> macro_offsets; |
| 1146 | 1150 | ||
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 5cca5c29a..2426d0067 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/memory.h" | ||
| 9 | #include "video_core/engines/maxwell_3d.h" | 8 | #include "video_core/engines/maxwell_3d.h" |
| 10 | #include "video_core/engines/maxwell_dma.h" | 9 | #include "video_core/engines/maxwell_dma.h" |
| 10 | #include "video_core/memory_manager.h" | ||
| 11 | #include "video_core/rasterizer_interface.h" | 11 | #include "video_core/rasterizer_interface.h" |
| 12 | #include "video_core/renderer_base.h" | 12 | #include "video_core/renderer_base.h" |
| 13 | #include "video_core/textures/decoders.h" | 13 | #include "video_core/textures/decoders.h" |
| @@ -16,7 +16,7 @@ namespace Tegra::Engines { | |||
| 16 | 16 | ||
| 17 | MaxwellDMA::MaxwellDMA(Core::System& system, VideoCore::RasterizerInterface& rasterizer, | 17 | MaxwellDMA::MaxwellDMA(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
| 18 | MemoryManager& memory_manager) | 18 | MemoryManager& memory_manager) |
| 19 | : memory_manager(memory_manager), system{system}, rasterizer{rasterizer} {} | 19 | : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager} {} |
| 20 | 20 | ||
| 21 | void MaxwellDMA::CallMethod(const GPU::MethodCall& method_call) { | 21 | void MaxwellDMA::CallMethod(const GPU::MethodCall& method_call) { |
| 22 | ASSERT_MSG(method_call.method < Regs::NUM_REGS, | 22 | ASSERT_MSG(method_call.method < Regs::NUM_REGS, |
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 34c369320..c6b649842 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -10,12 +10,15 @@ | |||
| 10 | #include "common/common_funcs.h" | 10 | #include "common/common_funcs.h" |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | ||
| 14 | 13 | ||
| 15 | namespace Core { | 14 | namespace Core { |
| 16 | class System; | 15 | class System; |
| 17 | } | 16 | } |
| 18 | 17 | ||
| 18 | namespace Tegra { | ||
| 19 | class MemoryManager; | ||
| 20 | } | ||
| 21 | |||
| 19 | namespace VideoCore { | 22 | namespace VideoCore { |
| 20 | class RasterizerInterface; | 23 | class RasterizerInterface; |
| 21 | } | 24 | } |
| @@ -139,13 +142,13 @@ public: | |||
| 139 | }; | 142 | }; |
| 140 | } regs{}; | 143 | } regs{}; |
| 141 | 144 | ||
| 142 | MemoryManager& memory_manager; | ||
| 143 | |||
| 144 | private: | 145 | private: |
| 145 | Core::System& system; | 146 | Core::System& system; |
| 146 | 147 | ||
| 147 | VideoCore::RasterizerInterface& rasterizer; | 148 | VideoCore::RasterizerInterface& rasterizer; |
| 148 | 149 | ||
| 150 | MemoryManager& memory_manager; | ||
| 151 | |||
| 149 | /// Performs the copy from the source buffer to the destination buffer as configured in the | 152 | /// Performs the copy from the source buffer to the destination buffer as configured in the |
| 150 | /// registers. | 153 | /// registers. |
| 151 | void HandleCopy(); | 154 | void HandleCopy(); |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 388b5ffd5..02a9f5ecb 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "common/alignment.h" | 10 | #include "common/alignment.h" |
| 11 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 12 | #include "core/memory.h" | 12 | #include "core/memory.h" |
| 13 | #include "video_core/memory_manager.h" | ||
| 13 | #include "video_core/renderer_vulkan/declarations.h" | 14 | #include "video_core/renderer_vulkan/declarations.h" |
| 14 | #include "video_core/renderer_vulkan/vk_buffer_cache.h" | 15 | #include "video_core/renderer_vulkan/vk_buffer_cache.h" |
| 15 | #include "video_core/renderer_vulkan/vk_scheduler.h" | 16 | #include "video_core/renderer_vulkan/vk_scheduler.h" |