diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-18 03:31:50 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | c8a971be919158a265ec4c0f934ba368b8a3f315 (patch) | |
tree | 32edeb7dd3cd3b7b777fa59eced19692145ff10a /src/video_core | |
parent | rescaling_pass: Fix and simplify shuffle/fragcoord pass (diff) | |
download | yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.gz yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.bz2 yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.lz yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.xz yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.zst yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 18 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 1 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 9afe49387..855f0a5d7 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -739,8 +739,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, VKScheduler& sch : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_}, - resolution{Settings::values.resolution_info}, - is_rescaling_on(resolution.up_scale != 1 || resolution.down_shift != 0) {} + resolution{Settings::values.resolution_info} {} void TextureCacheRuntime::Finish() { scheduler.Finish(); @@ -1141,11 +1140,11 @@ bool Image::ScaleUp(bool save_as_backup) { ASSERT(info.type != ImageType::Linear); scaling_count++; flags |= ImageFlagBits::Rescaled; - if (!runtime->is_rescaling_on) { - return true; - } const auto& resolution = runtime->resolution; + if (!resolution.active) { + return true; + } vk::Image rescaled_image = has_backup ? std::move(backup_image) : MakeImage(runtime->device, info, resolution.up_scale, resolution.down_shift); @@ -1188,7 +1187,7 @@ bool Image::ScaleUp(bool save_as_backup) { } void Image::SwapBackup() { - if (!runtime->is_rescaling_on) { + if (!runtime->resolution.active) { return; } ASSERT(has_backup); @@ -1206,17 +1205,16 @@ bool Image::ScaleDown(bool save_as_backup) { ASSERT(info.type != ImageType::Linear); flags &= ~ImageFlagBits::Rescaled; scaling_count++; - if (!runtime->is_rescaling_on) { - return true; - } const auto& resolution = runtime->resolution; + if (!resolution.active) { + return true; + } vk::Image downscaled_image = has_backup ? std::move(backup_image) : MakeImage(runtime->device, info); MemoryCommit new_commit = has_backup ? std::move(backup_commit) : MemoryCommit(runtime->memory_allocator.Commit( downscaled_image, MemoryUsage::DeviceLocal)); - has_backup = false; if (aspect_mask == 0) { aspect_mask = ImageAspectMask(info.format); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 9c39a6d99..84194b833 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -94,7 +94,6 @@ public: DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images; DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits; Settings::ResolutionScalingInfo resolution; - bool is_rescaling_on{}; }; class Image : public VideoCommon::ImageBase { |