From 88ef04dbaf26ab83ec85bfa3c68434c283c66e50 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 5 Oct 2021 00:07:51 -0400 Subject: texture_cache: Refactor scaled image size calculation --- src/video_core/texture_cache/texture_cache.h | 24 +++++++++++------------ src/video_core/texture_cache/texture_cache_base.h | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 691198853..b708e41b5 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -852,18 +852,23 @@ void TextureCache
::InvalidateScale(Image& image) {
has_deleted_images = true;
}
+template ::GetScaledImageSizeBytes(Image& image) {
+ const f32 add_to_size = Settings::values.resolution_info.up_factor - 1.0f;
+ const bool sign = std::signbit(add_to_size);
+ const u32 image_size_bytes = std::max(image.guest_size_bytes, image.unswizzled_size_bytes);
+ const u64 tentative_size = static_cast ::ScaleUp(Image& image) {
const bool rescaled = image.ScaleUp();
if (!rescaled) {
return false;
}
- const auto& add_to_size = Settings::values.resolution_info.up_factor - 1.0f;
- const auto sign = std::signbit(add_to_size);
- const u64 tentative_size = static_cast ::ScaleDown(Image& image) {
if (!rescaled) {
return false;
}
- const auto& add_to_size = Settings::values.resolution_info.up_factor - 1.0f;
- const auto sign = std::signbit(add_to_size);
- const u64 tentative_size = static_cast