summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-02-28 01:36:06 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-02-28 02:58:50 +0100
commit7ea097e5c25737e681ad8ba007e655a7c6bfba31 (patch)
treebec7ddf4e5956e2d993b49f8e736f8854664ed01 /src
parentCorrections and redesign. (diff)
downloadyuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar.gz
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar.bz2
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar.lz
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar.xz
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.tar.zst
yuzu-7ea097e5c25737e681ad8ba007e655a7c6bfba31.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/rasterizer_cache.h4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h8
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:
}
/// Register an object into the cache
- virtual void Register(const T& object) {
+ void Register(const T& object) {
object->SetIsRegistered(true);
interval_cache.add({GetInterval(object), ObjectSet{object}});
map_cache.insert({object->GetAddr(), object});
@@ -112,7 +112,7 @@ protected:
}
/// Unregisters an object from the cache
- virtual void Unregister(const T& object) {
+ void Unregister(const T& object) {
object->SetIsRegistered(false);
rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1);
// 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
// If surface parameters changed and we care about keeping the previous data, recreate
// the surface from the old one
Surface new_surface{RecreateSurface(surface, params)};
- Unregister(surface);
+ UnregisterSurface(surface);
Register(new_surface);
if (new_surface->IsUploaded()) {
RegisterReinterpretSurface(new_surface);
@@ -1017,7 +1017,7 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool pres
return new_surface;
} else {
// Delete the old surface before creating a new one to prevent collisions.
- Unregister(surface);
+ UnregisterSurface(surface);
}
}
@@ -1368,12 +1368,12 @@ static bool IsReinterpretInvalidSecond(const Surface render_surface,
bool RasterizerCacheOpenGL::PartialReinterpretSurface(Surface triggering_surface,
Surface intersect) {
if (IsReinterpretInvalid(triggering_surface, intersect)) {
- Unregister(intersect);
+ UnregisterSurface(intersect);
return false;
}
if (!LayerFitReinterpretSurface(*this, triggering_surface, intersect)) {
if (IsReinterpretInvalidSecond(triggering_surface, intersect)) {
- Unregister(intersect);
+ UnregisterSurface(intersect);
return false;
}
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:
return nullptr;
}
- void Register(const Surface& object) {
- RasterizerCache<Surface>::Register(object);
- }
-
/// Unregisters an object from the cache
- void Unregister(const Surface& object) {
+ void UnregisterSurface(const Surface& object) {
if (object->IsReinterpreted()) {
auto interval = GetReinterpretInterval(object);
reinterpreted_surfaces.erase(interval);
}
- RasterizerCache<Surface>::Unregister(object);
+ Unregister(object);
}
};