summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/video_core/gpu.cpp1
-rw-r--r--src/video_core/rasterizer_interface.h2
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h2
-rw-r--r--src/video_core/texture_cache/texture_cache.h18
5 files changed, 7 insertions, 20 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 619e06a0e..52706505b 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -32,7 +32,6 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) : renderer{renderer} {
auto& rasterizer{renderer.Rasterizer()};
memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer);
- rasterizer.InitMemoryMananger(*memory_manager);
dma_pusher = std::make_unique<Tegra::DmaPusher>(*this);
maxwell_3d = std::make_unique<Engines::Maxwell3D>(system, rasterizer, *memory_manager);
fermi_2d = std::make_unique<Engines::Fermi2D>(rasterizer, *memory_manager);
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h
index 6007e8c2e..5ee4f8e8e 100644
--- a/src/video_core/rasterizer_interface.h
+++ b/src/video_core/rasterizer_interface.h
@@ -28,8 +28,6 @@ class RasterizerInterface {
public:
virtual ~RasterizerInterface() {}
- virtual void InitMemoryMananger(Tegra::MemoryManager& memory_manager) = 0;
-
/// Draw the current batch of vertex arrays
virtual void DrawArrays() = 0;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index c9f3a35e6..f45a3c5ef 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -97,10 +97,6 @@ RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWind
RasterizerOpenGL::~RasterizerOpenGL() {}
-void RasterizerOpenGL::InitMemoryMananger(Tegra::MemoryManager& memory_manager) {
- texture_cache.InitMemoryMananger(memory_manager);
-}
-
void RasterizerOpenGL::CheckExtensions() {
if (!GLAD_GL_ARB_texture_filter_anisotropic && !GLAD_GL_EXT_texture_filter_anisotropic) {
LOG_WARNING(
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 33582ac42..bf67e3a70 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -57,8 +57,6 @@ public:
ScreenInfo& info);
~RasterizerOpenGL() override;
- void InitMemoryMananger(Tegra::MemoryManager& memory_manager) override;
-
void DrawArrays() override;
void Clear() override;
void FlushAll() override;
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index a91b2a220..1516fcea3 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -52,10 +52,6 @@ class TextureCache {
using IntervalType = typename IntervalMap::interval_type;
public:
- void InitMemoryMananger(Tegra::MemoryManager& memory_manager) {
- this->memory_manager = &memory_manager;
- }
-
void InvalidateRegion(CacheAddr addr, std::size_t size) {
std::lock_guard lock{mutex};
@@ -278,15 +274,16 @@ protected:
void Register(TSurface surface) {
const GPUVAddr gpu_addr = surface->GetGpuAddr();
- const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr));
+ const CacheAddr cache_ptr = ToCacheAddr(system.GPU().MemoryManager().GetPointer(gpu_addr));
const std::size_t size = surface->GetSizeInBytes();
- const std::optional<VAddr> cpu_addr = memory_manager->GpuToCpuAddress(gpu_addr);
+ const std::optional<VAddr> cpu_addr =
+ system.GPU().MemoryManager().GpuToCpuAddress(gpu_addr);
if (!cache_ptr || !cpu_addr) {
LOG_CRITICAL(HW_GPU, "Failed to register surface with unmapped gpu_address 0x{:016x}",
gpu_addr);
return;
}
- bool continuouty = memory_manager->IsBlockContinuous(gpu_addr, size);
+ bool continuouty = system.GPU().MemoryManager().IsBlockContinuous(gpu_addr, size);
surface->MarkAsContinuous(continuouty);
surface->SetCacheAddr(cache_ptr);
surface->SetCpuAddr(*cpu_addr);
@@ -552,7 +549,7 @@ private:
std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const SurfaceParams& params,
bool preserve_contents, bool is_render) {
- const auto host_ptr{memory_manager->GetPointer(gpu_addr)};
+ const auto host_ptr{system.GPU().MemoryManager().GetPointer(gpu_addr)};
const auto cache_addr{ToCacheAddr(host_ptr)};
// Step 0: guarantee a valid surface
@@ -693,7 +690,7 @@ private:
void LoadSurface(const TSurface& surface) {
staging_cache.GetBuffer(0).resize(surface->GetHostSizeInBytes());
- surface->LoadBuffer(*memory_manager, staging_cache);
+ surface->LoadBuffer(system.GPU().MemoryManager(), staging_cache);
surface->UploadTexture(staging_cache.GetBuffer(0));
surface->MarkAsModified(false, Tick());
}
@@ -704,7 +701,7 @@ private:
}
staging_cache.GetBuffer(0).resize(surface->GetHostSizeInBytes());
surface->DownloadTexture(staging_cache.GetBuffer(0));
- surface->FlushBuffer(*memory_manager, staging_cache);
+ surface->FlushBuffer(system.GPU().MemoryManager(), staging_cache);
surface->MarkAsModified(false, Tick());
}
@@ -778,7 +775,6 @@ private:
};
VideoCore::RasterizerInterface& rasterizer;
- Tegra::MemoryManager* memory_manager;
u64 ticks{};