diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-10-06 08:02:05 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | f8339cd703c2e6d24477be211e1fd91a6e1ef334 (patch) | |
tree | f02b34bbbbbabe6a5c1f4a8a7cdacbe13a39731f | |
parent | video_core: Misc resolution scaling related refactoring (diff) | |
download | yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.gz yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.bz2 yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.lz yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.xz yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.zst yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 28 | ||||
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 2 |
2 files changed, 11 insertions, 19 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 930c7d569..1ab2b1fe9 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1130,13 +1130,19 @@ bool Image::ScaleUp() { return false; } ASSERT(info.type != ImageType::Linear); - flags |= ImageFlagBits::Rescaled; - const auto& resolution = runtime->resolution; if (!resolution.active) { - return true; + return false; } const auto& device = runtime->device; + const PixelFormat format = StorageFormat(info.format); + const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); + const auto similar = device.GetSupportedFormat( + format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), + FormatType::Optimal); + if (similar != format_info.format) { + return true; + } if (!scaled_image) { const u32 up = resolution.up_scale; const u32 down = resolution.down_shift; @@ -1155,23 +1161,9 @@ bool Image::ScaleUp() { if (aspect_mask == 0) { aspect_mask = ImageAspectMask(info.format); } - if (info.num_samples > 1) { - return true; - } - const PixelFormat format = StorageFormat(info.format); - const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); - const auto similar = device.GetSupportedFormat( - format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), - FormatType::Optimal); - - if (similar != format_info.format) { - return true; - } - if (aspect_mask == 0) { - aspect_mask = ImageAspectMask(info.format); - } BlitScale(*scheduler, *original_image, *scaled_image, info, aspect_mask, resolution, true); current_image = *scaled_image; + flags |= ImageFlagBits::Rescaled; return true; } diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 630c73005..de522cc43 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -857,7 +857,7 @@ u64 TextureCache<P>::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<u64>(image_size_bytes * std::abs(add_to_size)); + const u64 tentative_size = image_size_bytes * static_cast<u32>(std::abs(add_to_size)); const u64 fitted_size = Common::AlignUp(tentative_size, 1024); return sign ? -fitted_size : fitted_size; } |