diff options
| author | 2021-09-17 21:31:50 -0400 | |
|---|---|---|
| committer | 2021-11-16 22:11:30 +0100 | |
| commit | c8a971be919158a265ec4c0f934ba368b8a3f315 (patch) | |
| tree | 32edeb7dd3cd3b7b777fa59eced19692145ff10a /src | |
| parent | rescaling_pass: Fix and simplify shuffle/fragcoord pass (diff) | |
| download | yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.gz yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.tar.xz yuzu-c8a971be919158a265ec4c0f934ba368b8a3f315.zip | |
vk_texture_cache: Minor cleanup
Diffstat (limited to 'src')
| -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 | |||
| 739 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, | 739 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, |
| 740 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, | 740 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, |
| 741 | astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_}, | 741 | astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_}, |
| 742 | resolution{Settings::values.resolution_info}, | 742 | resolution{Settings::values.resolution_info} {} |
| 743 | is_rescaling_on(resolution.up_scale != 1 || resolution.down_shift != 0) {} | ||
| 744 | 743 | ||
| 745 | void TextureCacheRuntime::Finish() { | 744 | void TextureCacheRuntime::Finish() { |
| 746 | scheduler.Finish(); | 745 | scheduler.Finish(); |
| @@ -1141,11 +1140,11 @@ bool Image::ScaleUp(bool save_as_backup) { | |||
| 1141 | ASSERT(info.type != ImageType::Linear); | 1140 | ASSERT(info.type != ImageType::Linear); |
| 1142 | scaling_count++; | 1141 | scaling_count++; |
| 1143 | flags |= ImageFlagBits::Rescaled; | 1142 | flags |= ImageFlagBits::Rescaled; |
| 1144 | if (!runtime->is_rescaling_on) { | ||
| 1145 | return true; | ||
| 1146 | } | ||
| 1147 | 1143 | ||
| 1148 | const auto& resolution = runtime->resolution; | 1144 | const auto& resolution = runtime->resolution; |
| 1145 | if (!resolution.active) { | ||
| 1146 | return true; | ||
| 1147 | } | ||
| 1149 | vk::Image rescaled_image = | 1148 | vk::Image rescaled_image = |
| 1150 | has_backup ? std::move(backup_image) | 1149 | has_backup ? std::move(backup_image) |
| 1151 | : MakeImage(runtime->device, info, resolution.up_scale, resolution.down_shift); | 1150 | : MakeImage(runtime->device, info, resolution.up_scale, resolution.down_shift); |
| @@ -1188,7 +1187,7 @@ bool Image::ScaleUp(bool save_as_backup) { | |||
| 1188 | } | 1187 | } |
| 1189 | 1188 | ||
| 1190 | void Image::SwapBackup() { | 1189 | void Image::SwapBackup() { |
| 1191 | if (!runtime->is_rescaling_on) { | 1190 | if (!runtime->resolution.active) { |
| 1192 | return; | 1191 | return; |
| 1193 | } | 1192 | } |
| 1194 | ASSERT(has_backup); | 1193 | ASSERT(has_backup); |
| @@ -1206,17 +1205,16 @@ bool Image::ScaleDown(bool save_as_backup) { | |||
| 1206 | ASSERT(info.type != ImageType::Linear); | 1205 | ASSERT(info.type != ImageType::Linear); |
| 1207 | flags &= ~ImageFlagBits::Rescaled; | 1206 | flags &= ~ImageFlagBits::Rescaled; |
| 1208 | scaling_count++; | 1207 | scaling_count++; |
| 1209 | if (!runtime->is_rescaling_on) { | ||
| 1210 | return true; | ||
| 1211 | } | ||
| 1212 | 1208 | ||
| 1213 | const auto& resolution = runtime->resolution; | 1209 | const auto& resolution = runtime->resolution; |
| 1210 | if (!resolution.active) { | ||
| 1211 | return true; | ||
| 1212 | } | ||
| 1214 | vk::Image downscaled_image = | 1213 | vk::Image downscaled_image = |
| 1215 | has_backup ? std::move(backup_image) : MakeImage(runtime->device, info); | 1214 | has_backup ? std::move(backup_image) : MakeImage(runtime->device, info); |
| 1216 | MemoryCommit new_commit = has_backup ? std::move(backup_commit) | 1215 | MemoryCommit new_commit = has_backup ? std::move(backup_commit) |
| 1217 | : MemoryCommit(runtime->memory_allocator.Commit( | 1216 | : MemoryCommit(runtime->memory_allocator.Commit( |
| 1218 | downscaled_image, MemoryUsage::DeviceLocal)); | 1217 | downscaled_image, MemoryUsage::DeviceLocal)); |
| 1219 | |||
| 1220 | has_backup = false; | 1218 | has_backup = false; |
| 1221 | if (aspect_mask == 0) { | 1219 | if (aspect_mask == 0) { |
| 1222 | aspect_mask = ImageAspectMask(info.format); | 1220 | 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: | |||
| 94 | DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images; | 94 | DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images; |
| 95 | DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits; | 95 | DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits; |
| 96 | Settings::ResolutionScalingInfo resolution; | 96 | Settings::ResolutionScalingInfo resolution; |
| 97 | bool is_rescaling_on{}; | ||
| 98 | }; | 97 | }; |
| 99 | 98 | ||
| 100 | class Image : public VideoCommon::ImageBase { | 99 | class Image : public VideoCommon::ImageBase { |