diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-21 01:01:26 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:11 +0200 |
commit | 2787a0c2875c6c686a50a03e446099124824b17f (patch) | |
tree | a025917ee353401e5880089e0038a0ea953ffb37 /src/video_core/texture_cache.cpp | |
parent | gl_texture_cache: Minor changes (diff) | |
download | yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar.gz yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar.bz2 yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar.lz yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar.xz yuzu-2787a0c2875c6c686a50a03e446099124824b17f.tar.zst yuzu-2787a0c2875c6c686a50a03e446099124824b17f.zip |
Diffstat (limited to 'src/video_core/texture_cache.cpp')
-rw-r--r-- | src/video_core/texture_cache.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/texture_cache.cpp b/src/video_core/texture_cache.cpp index b47ce6b98..b78a7d951 100644 --- a/src/video_core/texture_cache.cpp +++ b/src/video_core/texture_cache.cpp @@ -154,8 +154,8 @@ bool SurfaceParams::IsLayered() const { switch (target) { case SurfaceTarget::Texture1DArray: case SurfaceTarget::Texture2DArray: - case SurfaceTarget::TextureCubeArray: case SurfaceTarget::TextureCubemap: + case SurfaceTarget::TextureCubeArray: return true; default: return false; @@ -192,9 +192,11 @@ u32 SurfaceParams::GetMipBlockDepth(u32 level) const { while (block_depth > 1 && depth * 2 <= block_depth) { block_depth >>= 1; } + if (block_depth == 32 && GetMipBlockHeight(level) >= 4) { return 16; } + return block_depth; } @@ -227,7 +229,7 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co for (u32 level = 0; level < num_levels; ++level) { size += GetInnerMipmapMemorySize(level, as_host_size, uncompressed); } - if (is_tiled && IsLayered()) { + if (is_tiled && (IsLayered() || target == SurfaceTarget::Texture3D)) { return Common::AlignUp(size, Tegra::Texture::GetGOBSize() * block_height * block_depth); } return size; @@ -312,9 +314,10 @@ void SurfaceParams::CalculateCachedValues() { guest_size_in_bytes = GetInnerMemorySize(false, false, false); - // ASTC is uncompressed in software, in emulated as RGBA8 if (IsPixelFormatASTC(pixel_format)) { - host_size_in_bytes = static_cast<std::size_t>(width * height * depth * 4U); + // ASTC is uncompressed in software, in emulated as RGBA8 + host_size_in_bytes = static_cast<std::size_t>(width) * static_cast<std::size_t>(height) * + static_cast<std::size_t>(depth) * 4ULL; } else { host_size_in_bytes = GetInnerMemorySize(true, false, false); } |