diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-24 21:34:31 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | 228f516bb4426a41a4d1c1756751557f7a0eecda (patch) | |
tree | 36ece73b658929c2878bdc1c7f4592fed8c595da /src/video_core/texture_cache/surface_params.h | |
parent | texture_cache: Correct copying between compressed and uncompressed formats (diff) | |
download | yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.gz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.bz2 yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.lz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.xz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.zst yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/surface_params.h | 14 |
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; |