summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/surface_params.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-07-11 21:15:21 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-14 18:00:31 +0200
commit5818959e543041fdff8965e71e52d55a05ee22de (patch)
tree1e168ded74b7b29a1822a8f5b0f07241db2c68d4 /src/video_core/texture_cache/surface_params.cpp
parentGPU: Add a microprofile for macro interpreter (diff)
downloadyuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar.gz
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar.bz2
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar.lz
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar.xz
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.tar.zst
yuzu-5818959e543041fdff8965e71e52d55a05ee22de.zip
Diffstat (limited to 'src/video_core/texture_cache/surface_params.cpp')
-rw-r--r--src/video_core/texture_cache/surface_params.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 9c56e2b4f..df9260859 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -290,12 +290,19 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co
std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size,
bool uncompressed) const {
- const bool tiled{as_host_size ? false : is_tiled};
const u32 width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())};
const u32 height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())};
const u32 depth{is_layered ? 1U : GetMipDepth(level)};
- return Tegra::Texture::CalculateSize(tiled, GetBytesPerPixel(), width, height, depth,
- GetMipBlockHeight(level), GetMipBlockDepth(level));
+ if (is_tiled) {
+ return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), width, height, depth,
+ GetMipBlockHeight(level), GetMipBlockDepth(level));
+ } else {
+ if (as_host_size || IsBuffer()) {
+ return GetBytesPerPixel()*width*height*depth;
+ } else {
+ return pitch*height*depth;
+ }
+ }
}
bool SurfaceParams::operator==(const SurfaceParams& rhs) const {