Merge pull request #2346 from lioncash/header

video_core/engines: Remove unnecessary inclusions where applicable
This commit is contained in:
bunnei 2019-04-05 23:44:27 -04:00 committed by GitHub
commit e3402d976d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 39 additions and 22 deletions

View File

@ -6,12 +6,13 @@
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/math_util.h" #include "common/math_util.h"
#include "video_core/engines/fermi_2d.h" #include "video_core/engines/fermi_2d.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
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

@ -10,7 +10,10 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h"
namespace Tegra {
class MemoryManager;
}
namespace VideoCore { namespace VideoCore {
class RasterizerInterface; class RasterizerInterface;
@ -115,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

@ -9,7 +9,10 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h"
namespace Tegra {
class MemoryManager;
}
namespace Tegra::Engines { namespace Tegra::Engines {
@ -40,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

@ -5,9 +5,9 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/core.h" #include "core/core.h"
#include "core/memory.h"
#include "video_core/engines/kepler_memory.h" #include "video_core/engines/kepler_memory.h"
#include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_3d.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
@ -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

@ -10,12 +10,15 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Tegra {
class MemoryManager;
}
namespace VideoCore { namespace VideoCore {
class RasterizerInterface; class RasterizerInterface;
} }
@ -82,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

@ -7,11 +7,10 @@
#include "common/assert.h" #include "common/assert.h"
#include "core/core.h" #include "core/core.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/memory.h"
#include "video_core/debug_utils/debug_utils.h" #include "video_core/debug_utils/debug_utils.h"
#include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_3d.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace Tegra::Engines { namespace Tegra::Engines {
@ -21,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

@ -16,13 +16,16 @@
#include "common/math_util.h" #include "common/math_util.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/macro_interpreter.h" #include "video_core/macro_interpreter.h"
#include "video_core/memory_manager.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Tegra {
class MemoryManager;
}
namespace VideoCore { namespace VideoCore {
class RasterizerInterface; class RasterizerInterface;
} }
@ -1093,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};
@ -1141,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

@ -5,9 +5,9 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/core.h" #include "core/core.h"
#include "core/memory.h"
#include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/maxwell_dma.h" #include "video_core/engines/maxwell_dma.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
#include "video_core/textures/decoders.h" #include "video_core/textures/decoders.h"
@ -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

@ -10,12 +10,15 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/memory_manager.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Tegra {
class MemoryManager;
}
namespace VideoCore { namespace VideoCore {
class RasterizerInterface; class RasterizerInterface;
} }
@ -139,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();

View File

@ -10,6 +10,7 @@
#include "common/alignment.h" #include "common/alignment.h"
#include "common/assert.h" #include "common/assert.h"
#include "core/memory.h" #include "core/memory.h"
#include "video_core/memory_manager.h"
#include "video_core/renderer_vulkan/declarations.h" #include "video_core/renderer_vulkan/declarations.h"
#include "video_core/renderer_vulkan/vk_buffer_cache.h" #include "video_core/renderer_vulkan/vk_buffer_cache.h"
#include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/renderer_vulkan/vk_scheduler.h"