summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp18
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h1
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 {