diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/rasterizer_cache.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 |
3 files changed, 8 insertions, 12 deletions
diff --git a/src/video_core/rasterizer_cache.h b/src/video_core/rasterizer_cache.h index b239dff84..a7bcf26fb 100644 --- a/src/video_core/rasterizer_cache.h +++ b/src/video_core/rasterizer_cache.h | |||
| @@ -104,7 +104,7 @@ protected: | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | /// Register an object into the cache | 106 | /// Register an object into the cache |
| 107 | virtual void Register(const T& object) { | 107 | void Register(const T& object) { |
| 108 | object->SetIsRegistered(true); | 108 | object->SetIsRegistered(true); |
| 109 | interval_cache.add({GetInterval(object), ObjectSet{object}}); | 109 | interval_cache.add({GetInterval(object), ObjectSet{object}}); |
| 110 | map_cache.insert({object->GetAddr(), object}); | 110 | map_cache.insert({object->GetAddr(), object}); |
| @@ -112,7 +112,7 @@ protected: | |||
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | /// Unregisters an object from the cache | 114 | /// Unregisters an object from the cache |
| 115 | virtual void Unregister(const T& object) { | 115 | void Unregister(const T& object) { |
| 116 | object->SetIsRegistered(false); | 116 | object->SetIsRegistered(false); |
| 117 | rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1); | 117 | rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1); |
| 118 | // Only flush if use_accurate_gpu_emulation is enabled, as it incurs a performance hit | 118 | // Only flush if use_accurate_gpu_emulation is enabled, as it incurs a performance hit |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 1f84026cd..5fdf1164d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -1009,7 +1009,7 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool pres | |||
| 1009 | // If surface parameters changed and we care about keeping the previous data, recreate | 1009 | // If surface parameters changed and we care about keeping the previous data, recreate |
| 1010 | // the surface from the old one | 1010 | // the surface from the old one |
| 1011 | Surface new_surface{RecreateSurface(surface, params)}; | 1011 | Surface new_surface{RecreateSurface(surface, params)}; |
| 1012 | Unregister(surface); | 1012 | UnregisterSurface(surface); |
| 1013 | Register(new_surface); | 1013 | Register(new_surface); |
| 1014 | if (new_surface->IsUploaded()) { | 1014 | if (new_surface->IsUploaded()) { |
| 1015 | RegisterReinterpretSurface(new_surface); | 1015 | RegisterReinterpretSurface(new_surface); |
| @@ -1017,7 +1017,7 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool pres | |||
| 1017 | return new_surface; | 1017 | return new_surface; |
| 1018 | } else { | 1018 | } else { |
| 1019 | // Delete the old surface before creating a new one to prevent collisions. | 1019 | // Delete the old surface before creating a new one to prevent collisions. |
| 1020 | Unregister(surface); | 1020 | UnregisterSurface(surface); |
| 1021 | } | 1021 | } |
| 1022 | } | 1022 | } |
| 1023 | 1023 | ||
| @@ -1368,12 +1368,12 @@ static bool IsReinterpretInvalidSecond(const Surface render_surface, | |||
| 1368 | bool RasterizerCacheOpenGL::PartialReinterpretSurface(Surface triggering_surface, | 1368 | bool RasterizerCacheOpenGL::PartialReinterpretSurface(Surface triggering_surface, |
| 1369 | Surface intersect) { | 1369 | Surface intersect) { |
| 1370 | if (IsReinterpretInvalid(triggering_surface, intersect)) { | 1370 | if (IsReinterpretInvalid(triggering_surface, intersect)) { |
| 1371 | Unregister(intersect); | 1371 | UnregisterSurface(intersect); |
| 1372 | return false; | 1372 | return false; |
| 1373 | } | 1373 | } |
| 1374 | if (!LayerFitReinterpretSurface(*this, triggering_surface, intersect)) { | 1374 | if (!LayerFitReinterpretSurface(*this, triggering_surface, intersect)) { |
| 1375 | if (IsReinterpretInvalidSecond(triggering_surface, intersect)) { | 1375 | if (IsReinterpretInvalidSecond(triggering_surface, intersect)) { |
| 1376 | Unregister(intersect); | 1376 | UnregisterSurface(intersect); |
| 1377 | return false; | 1377 | return false; |
| 1378 | } | 1378 | } |
| 1379 | FlushObject(intersect); | 1379 | FlushObject(intersect); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index d530d64d4..797bbdc9c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -544,17 +544,13 @@ private: | |||
| 544 | return nullptr; | 544 | return nullptr; |
| 545 | } | 545 | } |
| 546 | 546 | ||
| 547 | void Register(const Surface& object) { | ||
| 548 | RasterizerCache<Surface>::Register(object); | ||
| 549 | } | ||
| 550 | |||
| 551 | /// Unregisters an object from the cache | 547 | /// Unregisters an object from the cache |
| 552 | void Unregister(const Surface& object) { | 548 | void UnregisterSurface(const Surface& object) { |
| 553 | if (object->IsReinterpreted()) { | 549 | if (object->IsReinterpreted()) { |
| 554 | auto interval = GetReinterpretInterval(object); | 550 | auto interval = GetReinterpretInterval(object); |
| 555 | reinterpreted_surfaces.erase(interval); | 551 | reinterpreted_surfaces.erase(interval); |
| 556 | } | 552 | } |
| 557 | RasterizerCache<Surface>::Unregister(object); | 553 | Unregister(object); |
| 558 | } | 554 | } |
| 559 | }; | 555 | }; |
| 560 | 556 | ||