diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-05-10 09:17:48 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:12 +0200 |
commit | 345e73f2feb0701e3c3099d002a1c21fb524eae4 (patch) | |
tree | c8c934dfec804d04a29f8ee27124274f5f999fb8 /src/video_core/texture_cache/surface_params.h | |
parent | texture_cache: Change internal cache from lists to vectors (diff) | |
download | yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.gz yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.bz2 yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.lz yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.xz yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.zst yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.zip |
Diffstat (limited to 'src/video_core/texture_cache/surface_params.h')
-rw-r--r-- | src/video_core/texture_cache/surface_params.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h index e0ec1be0e..7c48782c7 100644 --- a/src/video_core/texture_cache/surface_params.h +++ b/src/video_core/texture_cache/surface_params.h @@ -54,12 +54,12 @@ public: constexpr std::size_t rgb8_bpp = 4ULL; // ASTC is uncompressed in software, in emulated as RGBA8 host_size_in_bytes = 0; - for (std::size_t level = 0; level < num_levels; level++) { + for (u32 level = 0; level < num_levels; ++level) { const std::size_t width = Common::AlignUp(GetMipWidth(level), GetDefaultBlockWidth()); const std::size_t height = Common::AlignUp(GetMipHeight(level), GetDefaultBlockHeight()); - const std::size_t depth = is_layered ? depth : GetMipDepth(level); + const std::size_t depth = is_layered ? this->depth : GetMipDepth(level); host_size_in_bytes += width * height * depth * rgb8_bpp; } } else { @@ -96,7 +96,8 @@ public: // Helper used for out of class size calculations static std::size_t AlignLayered(const std::size_t out_size, const u32 block_height, const u32 block_depth) { - return Common::AlignUp(out_size, Tegra::Texture::GetGOBSize() * block_height * block_depth); + return Common::AlignBits(out_size, + Tegra::Texture::GetGOBSizeShift() + block_height + block_depth); } /// Returns the offset in bytes in guest memory of a given mipmap level. |