forked from ShuriZma/suyu
1
0
Fork 0

video_core/engines: Make memory manager members private

These aren't used externally by anything, so they can be made private
data members.
This commit is contained in:
Lioncash 2019-04-05 18:25:20 -04:00
parent 26223f8124
commit 22f02076c6
9 changed files with 14 additions and 13 deletions

View File

@ -12,7 +12,7 @@
namespace Tegra::Engines { namespace Tegra::Engines {
Fermi2D::Fermi2D(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager) Fermi2D::Fermi2D(VideoCore::RasterizerInterface& rasterizer, MemoryManager& memory_manager)
: memory_manager(memory_manager), rasterizer{rasterizer} {} : rasterizer{rasterizer}, memory_manager{memory_manager} {}
void Fermi2D::CallMethod(const GPU::MethodCall& method_call) { void Fermi2D::CallMethod(const GPU::MethodCall& method_call) {
ASSERT_MSG(method_call.method < Regs::NUM_REGS, ASSERT_MSG(method_call.method < Regs::NUM_REGS,

View File

@ -118,10 +118,9 @@ public:
}; };
} regs{}; } regs{};
MemoryManager& memory_manager;
private: private:
VideoCore::RasterizerInterface& rasterizer; VideoCore::RasterizerInterface& rasterizer;
MemoryManager& memory_manager;
/// Performs the copy from the source surface to the destination surface as configured in the /// Performs the copy from the source surface to the destination surface as configured in the
/// registers. /// registers.

View File

@ -43,10 +43,11 @@ public:
static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32),
"KeplerCompute Regs has wrong size"); "KeplerCompute Regs has wrong size");
MemoryManager& memory_manager;
/// Write the value to the register identified by method. /// Write the value to the register identified by method.
void CallMethod(const GPU::MethodCall& method_call); void CallMethod(const GPU::MethodCall& method_call);
private:
MemoryManager& memory_manager;
}; };
#define ASSERT_REG_POSITION(field_name, position) \ #define ASSERT_REG_POSITION(field_name, position) \

View File

@ -15,7 +15,7 @@ namespace Tegra::Engines {
KeplerMemory::KeplerMemory(Core::System& system, VideoCore::RasterizerInterface& rasterizer, KeplerMemory::KeplerMemory(Core::System& system, VideoCore::RasterizerInterface& rasterizer,
MemoryManager& memory_manager) MemoryManager& memory_manager)
: system{system}, memory_manager(memory_manager), rasterizer{rasterizer} {} : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager} {}
KeplerMemory::~KeplerMemory() = default; KeplerMemory::~KeplerMemory() = default;

View File

@ -85,8 +85,8 @@ public:
private: private:
Core::System& system; Core::System& system;
MemoryManager& memory_manager;
VideoCore::RasterizerInterface& rasterizer; VideoCore::RasterizerInterface& rasterizer;
MemoryManager& memory_manager;
void ProcessData(u32 data); void ProcessData(u32 data);
}; };

View File

@ -20,8 +20,8 @@ constexpr u32 MacroRegistersStart = 0xE00;
Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer, Maxwell3D::Maxwell3D(Core::System& system, VideoCore::RasterizerInterface& rasterizer,
MemoryManager& memory_manager) MemoryManager& memory_manager)
: memory_manager(memory_manager), system{system}, rasterizer{rasterizer}, : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager}, macro_interpreter{
macro_interpreter(*this) { *this} {
InitializeRegisterDefaults(); InitializeRegisterDefaults();
} }

View File

@ -1096,7 +1096,6 @@ public:
}; };
State state{}; State state{};
MemoryManager& memory_manager;
struct DirtyFlags { struct DirtyFlags {
std::bitset<8> color_buffer{0xFF}; std::bitset<8> color_buffer{0xFF};
@ -1144,6 +1143,8 @@ private:
VideoCore::RasterizerInterface& rasterizer; VideoCore::RasterizerInterface& rasterizer;
MemoryManager& memory_manager;
/// Start offsets of each macro in macro_memory /// Start offsets of each macro in macro_memory
std::unordered_map<u32, u32> macro_offsets; std::unordered_map<u32, u32> macro_offsets;

View File

@ -16,7 +16,7 @@ namespace Tegra::Engines {
MaxwellDMA::MaxwellDMA(Core::System& system, VideoCore::RasterizerInterface& rasterizer, MaxwellDMA::MaxwellDMA(Core::System& system, VideoCore::RasterizerInterface& rasterizer,
MemoryManager& memory_manager) MemoryManager& memory_manager)
: memory_manager(memory_manager), system{system}, rasterizer{rasterizer} {} : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager} {}
void MaxwellDMA::CallMethod(const GPU::MethodCall& method_call) { void MaxwellDMA::CallMethod(const GPU::MethodCall& method_call) {
ASSERT_MSG(method_call.method < Regs::NUM_REGS, ASSERT_MSG(method_call.method < Regs::NUM_REGS,

View File

@ -142,13 +142,13 @@ public:
}; };
} regs{}; } regs{};
MemoryManager& memory_manager;
private: private:
Core::System& system; Core::System& system;
VideoCore::RasterizerInterface& rasterizer; VideoCore::RasterizerInterface& rasterizer;
MemoryManager& memory_manager;
/// Performs the copy from the source buffer to the destination buffer as configured in the /// Performs the copy from the source buffer to the destination buffer as configured in the
/// registers. /// registers.
void HandleCopy(); void HandleCopy();