aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache/surface_params.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-05-24 15:34:31 -0400
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-20 21:38:33 -0300
commit228f516bb4426a41a4d1c1756751557f7a0eecda (patch)
tree36ece73b658929c2878bdc1c7f4592fed8c595da /src/video_core/texture_cache/surface_params.h
parent92513541529e90f4f79a1f2c3f8ccf5a199e4c20 (diff)
texture_cache uncompress-compress is untopological.
This makes conflicts between non compress and compress textures to be auto recycled. It also limits the amount of mipmaps a texture can have if it goes above it's limit.
Diffstat (limited to 'src/video_core/texture_cache/surface_params.h')
-rw-r--r--src/video_core/texture_cache/surface_params.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h
index c3affd621..5fde695b6 100644
--- a/src/video_core/texture_cache/surface_params.h
+++ b/src/video_core/texture_cache/surface_params.h
@@ -160,6 +160,19 @@ public:
return std::min(t_src_height, t_dst_height);
}
+ u32 MaxPossibleMipmap() const {
+ const u32 max_mipmap_w = Common::Log2Ceil32(width) + 1U;
+ const u32 max_mipmap_h = Common::Log2Ceil32(height) + 1U;
+ const u32 max_mipmap = std::max(max_mipmap_w, max_mipmap_h);
+ if (target != VideoCore::Surface::SurfaceTarget::Texture3D)
+ return max_mipmap;
+ return std::max(max_mipmap, Common::Log2Ceil32(depth) + 1U);
+ }
+
+ bool IsCompressed() const {
+ return GetDefaultBlockHeight() > 1 || GetDefaultBlockWidth() > 1;
+ }
+
/// Returns the default block width.
u32 GetDefaultBlockWidth() const {
return VideoCore::Surface::GetDefaultBlockWidth(pixel_format);
@@ -205,6 +218,7 @@ public:
u32 depth;
u32 pitch;
u32 num_levels;
+ u32 emulated_levels;
VideoCore::Surface::PixelFormat pixel_format;
VideoCore::Surface::ComponentType component_type;
VideoCore::Surface::SurfaceType type;