mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-26 15:10:07 +00:00
vk_texture_cache: Minor cleanup
This commit is contained in:
parent
edb5844240
commit
c8a971be91
@ -739,8 +739,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, VKScheduler& sch
|
|||||||
: device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_},
|
: device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_},
|
||||||
staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_},
|
staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_},
|
||||||
astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_},
|
astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_},
|
||||||
resolution{Settings::values.resolution_info},
|
resolution{Settings::values.resolution_info} {}
|
||||||
is_rescaling_on(resolution.up_scale != 1 || resolution.down_shift != 0) {}
|
|
||||||
|
|
||||||
void TextureCacheRuntime::Finish() {
|
void TextureCacheRuntime::Finish() {
|
||||||
scheduler.Finish();
|
scheduler.Finish();
|
||||||
@ -1141,11 +1140,11 @@ bool Image::ScaleUp(bool save_as_backup) {
|
|||||||
ASSERT(info.type != ImageType::Linear);
|
ASSERT(info.type != ImageType::Linear);
|
||||||
scaling_count++;
|
scaling_count++;
|
||||||
flags |= ImageFlagBits::Rescaled;
|
flags |= ImageFlagBits::Rescaled;
|
||||||
if (!runtime->is_rescaling_on) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& resolution = runtime->resolution;
|
const auto& resolution = runtime->resolution;
|
||||||
|
if (!resolution.active) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
vk::Image rescaled_image =
|
vk::Image rescaled_image =
|
||||||
has_backup ? std::move(backup_image)
|
has_backup ? std::move(backup_image)
|
||||||
: MakeImage(runtime->device, info, resolution.up_scale, resolution.down_shift);
|
: MakeImage(runtime->device, info, resolution.up_scale, resolution.down_shift);
|
||||||
@ -1188,7 +1187,7 @@ bool Image::ScaleUp(bool save_as_backup) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Image::SwapBackup() {
|
void Image::SwapBackup() {
|
||||||
if (!runtime->is_rescaling_on) {
|
if (!runtime->resolution.active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ASSERT(has_backup);
|
ASSERT(has_backup);
|
||||||
@ -1206,17 +1205,16 @@ bool Image::ScaleDown(bool save_as_backup) {
|
|||||||
ASSERT(info.type != ImageType::Linear);
|
ASSERT(info.type != ImageType::Linear);
|
||||||
flags &= ~ImageFlagBits::Rescaled;
|
flags &= ~ImageFlagBits::Rescaled;
|
||||||
scaling_count++;
|
scaling_count++;
|
||||||
if (!runtime->is_rescaling_on) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& resolution = runtime->resolution;
|
const auto& resolution = runtime->resolution;
|
||||||
|
if (!resolution.active) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
vk::Image downscaled_image =
|
vk::Image downscaled_image =
|
||||||
has_backup ? std::move(backup_image) : MakeImage(runtime->device, info);
|
has_backup ? std::move(backup_image) : MakeImage(runtime->device, info);
|
||||||
MemoryCommit new_commit = has_backup ? std::move(backup_commit)
|
MemoryCommit new_commit = has_backup ? std::move(backup_commit)
|
||||||
: MemoryCommit(runtime->memory_allocator.Commit(
|
: MemoryCommit(runtime->memory_allocator.Commit(
|
||||||
downscaled_image, MemoryUsage::DeviceLocal));
|
downscaled_image, MemoryUsage::DeviceLocal));
|
||||||
|
|
||||||
has_backup = false;
|
has_backup = false;
|
||||||
if (aspect_mask == 0) {
|
if (aspect_mask == 0) {
|
||||||
aspect_mask = ImageAspectMask(info.format);
|
aspect_mask = ImageAspectMask(info.format);
|
||||||
|
@ -94,7 +94,6 @@ public:
|
|||||||
DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images;
|
DelayedDestructionRing<vk::Image, TICKS_TO_DESTROY> prescaled_images;
|
||||||
DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits;
|
DelayedDestructionRing<MemoryCommit, TICKS_TO_DESTROY> prescaled_commits;
|
||||||
Settings::ResolutionScalingInfo resolution;
|
Settings::ResolutionScalingInfo resolution;
|
||||||
bool is_rescaling_on{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Image : public VideoCommon::ImageBase {
|
class Image : public VideoCommon::ImageBase {
|
||||||
|
Loading…
Reference in New Issue
Block a user