summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-03 13:56:33 -0400
committerGravatar Lioncash2018-08-04 02:36:58 -0400
commit2665457f4ab3562525543f8e474bfb93ce3416ad (patch)
tree16166950cebde8f7ac99d51a3bcdcfa2869cf627 /src/core/memory.cpp
parentvideo_core: Eliminate the g_renderer global variable (diff)
downloadyuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.gz
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.tar.xz
yuzu-2665457f4ab3562525543f8e474bfb93ce3416ad.zip
renderer_base: Make Rasterizer() return the rasterizer by reference
All calling code assumes that the rasterizer will be in a valid state, which is a totally fine assumption. The only way the rasterizer wouldn't be is if initialization is done incorrectly or fails, which is checked against in System::Init().
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp8
1 files changed, 4 insertions, 4 deletions
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) {
355 const u64 overlap_size = overlap_end - overlap_start; 355 const u64 overlap_size = overlap_end - overlap_start;
356 356
357 for (const auto& gpu_address : gpu_addresses) { 357 for (const auto& gpu_address : gpu_addresses) {
358 auto* rasterizer = system_instance.Renderer().Rasterizer(); 358 auto& rasterizer = system_instance.Renderer().Rasterizer();
359 switch (mode) { 359 switch (mode) {
360 case FlushMode::Flush: 360 case FlushMode::Flush:
361 rasterizer->FlushRegion(gpu_address, overlap_size); 361 rasterizer.FlushRegion(gpu_address, overlap_size);
362 break; 362 break;
363 case FlushMode::Invalidate: 363 case FlushMode::Invalidate:
364 rasterizer->InvalidateRegion(gpu_address, overlap_size); 364 rasterizer.InvalidateRegion(gpu_address, overlap_size);
365 break; 365 break;
366 case FlushMode::FlushAndInvalidate: 366 case FlushMode::FlushAndInvalidate:
367 rasterizer->FlushAndInvalidateRegion(gpu_address, overlap_size); 367 rasterizer.FlushAndInvalidateRegion(gpu_address, overlap_size);
368 break; 368 break;
369 } 369 }
370 } 370 }