summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-06 05:30:18 +0200
committerbunnei <bunneidev@gmail.com>2018-08-06 05:40:03 +0200
commit57eb936200415ea3178445f7252bb0b0584cd557 (patch)
treef313b79a75250a01394e2f9eaa2b0b2da44b0efc /src/video_core/renderer_opengl/gl_rasterizer_cache.h
parentMerge pull request #932 from lioncash/func (diff)
downloadyuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar.gz
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar.bz2
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar.lz
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar.xz
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.tar.zst
yuzu-57eb936200415ea3178445f7252bb0b0584cd557.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 4e1e18d9c..39fcf22b4 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -9,6 +9,7 @@
#include <memory>
#include <vector>
#include <boost/icl/interval_map.hpp>
+
#include "common/common_types.h"
#include "common/math_util.h"
#include "video_core/engines/maxwell_3d.h"
@@ -546,6 +547,12 @@ struct SurfaceParams {
return !operator==(other);
}
+ /// Checks if surfaces are compatible for caching
+ bool IsCompatibleSurface(const SurfaceParams& other) const {
+ return std::tie(pixel_format, type, cache_width, cache_height) ==
+ std::tie(other.pixel_format, other.type, other.cache_width, other.cache_height);
+ }
+
Tegra::GPUVAddr addr;
bool is_tiled;
u32 block_height;
@@ -556,6 +563,10 @@ struct SurfaceParams {
u32 height;
u32 unaligned_height;
size_t size_in_bytes;
+
+ // Parameters used for caching only
+ u32 cache_width;
+ u32 cache_height;
};
class CachedSurface final {