summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-03 19:56:33 +0200
committerLioncash <mathew1800@gmail.com>2018-08-04 08:36:58 +0200
commit2665457f4ab3562525543f8e474bfb93ce3416ad (patch)
tree16166950cebde8f7ac99d51a3bcdcfa2869cf627
parentvideo_core: Eliminate the g_renderer global variable (diff)
downloadyuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.gz
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.bz2
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.lz
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.xz
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.zst
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.zip
-rw-r--r--src/core/core.cpp2
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp4
-rw-r--r--src/core/memory.cpp8
-rw-r--r--src/video_core/renderer_base.h8
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp4
5 files changed, 15 insertions, 11 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 29222baba..1045d8089 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -187,7 +187,7 @@ System::ResultStatus System::Init(EmuWindow& emu_window) {
return ResultStatus::ErrorVideoCore;
}
- gpu_core = std::make_unique<Tegra::GPU>(*renderer->Rasterizer());
+ gpu_core = std::make_unique<Tegra::GPU>(renderer->Rasterizer());
// Create threads for CPU cores 1-3, and build thread_to_cpu map
// CPU core 0 is run on the main thread
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
index 06151a1ea..4b601781f 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
@@ -156,8 +156,8 @@ u32 nvhost_as_gpu::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& ou
auto& system_instance = Core::System::GetInstance();
// Remove this memory region from the rasterizer cache.
- system_instance.Renderer().Rasterizer()->FlushAndInvalidateRegion(params.offset,
- itr->second.size);
+ system_instance.Renderer().Rasterizer().FlushAndInvalidateRegion(params.offset,
+ itr->second.size);
auto& gpu = system_instance.GPU();
params.offset = gpu.memory_manager->UnmapBuffer(params.offset, itr->second.size);
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index a8f08e1da..1133bcbaf 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -355,16 +355,16 @@ void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) {
const u64 overlap_size = overlap_end - overlap_start;
for (const auto& gpu_address : gpu_addresses) {
- auto* rasterizer = system_instance.Renderer().Rasterizer();
+ auto& rasterizer = system_instance.Renderer().Rasterizer();
switch (mode) {
case FlushMode::Flush:
- rasterizer->FlushRegion(gpu_address, overlap_size);
+ rasterizer.FlushRegion(gpu_address, overlap_size);
break;
case FlushMode::Invalidate:
- rasterizer->InvalidateRegion(gpu_address, overlap_size);
+ rasterizer.InvalidateRegion(gpu_address, overlap_size);
break;
case FlushMode::FlushAndInvalidate:
- rasterizer->FlushAndInvalidateRegion(gpu_address, overlap_size);
+ rasterizer.FlushAndInvalidateRegion(gpu_address, overlap_size);
break;
}
}
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index effb9aed3..235de23a1 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -46,8 +46,12 @@ public:
return m_current_frame;
}
- RasterizerInterface* Rasterizer() const {
- return rasterizer.get();
+ RasterizerInterface& Rasterizer() {
+ return *rasterizer;
+ }
+
+ const RasterizerInterface& Rasterizer() const {
+ return *rasterizer;
}
void RefreshRasterizerSetting();
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 50846975f..bf9131193 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -160,8 +160,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuf
// only allows rows to have a memory alignement of 4.
ASSERT(framebuffer.stride % 4 == 0);
- if (!Rasterizer()->AccelerateDisplay(framebuffer, framebuffer_addr, framebuffer.stride,
- screen_info)) {
+ if (!rasterizer->AccelerateDisplay(framebuffer, framebuffer_addr, framebuffer.stride,
+ screen_info)) {
// Reset the screen info's display texture to its own permanent texture
screen_info.display_texture = screen_info.texture.resource.handle;