aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache/surface_params.cpp
diff options
context:
space:
mode:
authorChloe <25727384+ogniK5377@users.noreply.github.com>2020-12-05 23:45:00 +1100
committerGitHub <noreply@github.com>2020-12-05 23:45:00 +1100
commitf2f346e1104106eb9323f0e141e0e67312c29849 (patch)
tree6eac8e13f3333c89d8c0f3428b8664cab63a484a /src/video_core/texture_cache/surface_params.cpp
parente6a896c4bdf9cc47c2002c115c9ff280e540fd1b (diff)
parent414a87a4f4570344140d77a7985b4d118b754341 (diff)
Merge pull request #5133 from lioncash/video-shadow2
video_core: Resolve more variable shadowing scenarios pt.2
Diffstat (limited to 'src/video_core/texture_cache/surface_params.cpp')
-rw-r--r--src/video_core/texture_cache/surface_params.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 13dd16356..305297719 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -356,18 +356,18 @@ 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 u32 width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())};
- const u32 height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())};
- const u32 depth{is_layered ? 1U : GetMipDepth(level)};
+ const u32 mip_width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())};
+ const u32 mip_height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())};
+ const u32 mip_depth{is_layered ? 1U : GetMipDepth(level)};
if (is_tiled) {
- return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), width, height,
- depth, GetMipBlockHeight(level),
+ return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), mip_width,
+ mip_height, mip_depth, GetMipBlockHeight(level),
GetMipBlockDepth(level));
} else if (as_host_size || IsBuffer()) {
- return GetBytesPerPixel() * width * height * depth;
+ return GetBytesPerPixel() * mip_width * mip_height * mip_depth;
} else {
// Linear Texture Case
- return pitch * height * depth;
+ return pitch * mip_height * mip_depth;
}
}