summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-03-13 22:05:49 +0100
committerGitHub <noreply@github.com>2019-03-13 22:05:49 +0100
commit4e6c667586a65349c3734d24a3f3d3065aacf12f (patch)
treebcccd5256fb026c88a5aaa75eb5a63b22b29fd2b /src/video_core
parentMerge pull request #2226 from lioncash/private (diff)
parentrenderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign (diff)
downloadyuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar.gz
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar.bz2
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar.lz
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar.xz
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.tar.zst
yuzu-4e6c667586a65349c3734d24a3f3d3065aacf12f.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_global_cache.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_global_cache.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_global_cache.cpp b/src/video_core/renderer_opengl/gl_global_cache.cpp
index c7f32feaa..7161d1dea 100644
--- a/src/video_core/renderer_opengl/gl_global_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_global_cache.cpp
@@ -57,8 +57,8 @@ GlobalRegion GlobalRegionCacheOpenGL::GetUncachedGlobalRegion(VAddr addr, u32 si
return region;
}
-void GlobalRegionCacheOpenGL::ReserveGlobalRegion(const GlobalRegion& region) {
- reserve[region->GetAddr()] = region;
+void GlobalRegionCacheOpenGL::ReserveGlobalRegion(GlobalRegion region) {
+ reserve.insert_or_assign(region->GetAddr(), std::move(region));
}
GlobalRegionCacheOpenGL::GlobalRegionCacheOpenGL(RasterizerOpenGL& rasterizer)
diff --git a/src/video_core/renderer_opengl/gl_global_cache.h b/src/video_core/renderer_opengl/gl_global_cache.h
index 37830bb7c..ba2bdc60c 100644
--- a/src/video_core/renderer_opengl/gl_global_cache.h
+++ b/src/video_core/renderer_opengl/gl_global_cache.h
@@ -30,12 +30,12 @@ public:
explicit CachedGlobalRegion(VAddr addr, u32 size);
/// Gets the address of the shader in guest memory, required for cache management
- VAddr GetAddr() const {
+ VAddr GetAddr() const override {
return addr;
}
/// Gets the size of the shader in guest memory, required for cache management
- std::size_t GetSizeInBytes() const {
+ std::size_t GetSizeInBytes() const override {
return size;
}
@@ -70,7 +70,7 @@ public:
private:
GlobalRegion TryGetReservedGlobalRegion(VAddr addr, u32 size) const;
GlobalRegion GetUncachedGlobalRegion(VAddr addr, u32 size);
- void ReserveGlobalRegion(const GlobalRegion& region);
+ void ReserveGlobalRegion(GlobalRegion region);
std::unordered_map<VAddr, GlobalRegion> reserve;
};