diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-10-12 06:54:28 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:31 +0100 |
commit | b1ae935f114e1011b19d4ada352c401e6655279a (patch) | |
tree | 65047ea2ac1816d0292df89a20e974445dfb8bc9 /src | |
parent | video_core: Refactor resolution scale function (diff) | |
download | yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar.gz yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar.bz2 yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar.lz yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar.xz yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.tar.zst yuzu-b1ae935f114e1011b19d4ada352c401e6655279a.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index caefce5fc..ccfdf64ea 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -592,9 +592,8 @@ struct RangedBarrierRange { } void BlitScale(VKScheduler& scheduler, VkImage src_image, VkImage dst_image, const ImageInfo& info, - VkImageAspectFlags aspect_mask, const Settings::ResolutionScalingInfo& resolution, - bool scaling) { - const auto type = info.type; + VkImageAspectFlags aspect_mask, const Settings::ResolutionScalingInfo& resolution) { + const bool is_2d = info.type == ImageType::e2D; const auto resources = info.resources; const VkExtent2D extent{ .width = info.size.width, @@ -605,15 +604,15 @@ void BlitScale(VKScheduler& scheduler, VkImage src_image, VkImage dst_image, con const VkFilter vk_filter = (is_zeta || is_int_format) ? VK_FILTER_NEAREST : VK_FILTER_LINEAR; scheduler.RequestOutsideRenderPassOperationContext(); - scheduler.Record([dst_image, src_image, extent, resources, aspect_mask, resolution, type, - scaling, vk_filter](vk::CommandBuffer cmdbuf) { + scheduler.Record([dst_image, src_image, extent, resources, aspect_mask, resolution, is_2d, + vk_filter](vk::CommandBuffer cmdbuf) { const VkOffset2D src_size{ - .x = static_cast<s32>(scaling ? extent.width : resolution.ScaleUp(extent.width)), - .y = static_cast<s32>(scaling ? extent.height : resolution.ScaleUp(extent.height)), + .x = static_cast<s32>(extent.width), + .y = static_cast<s32>(extent.height), }; const VkOffset2D dst_size{ - .x = static_cast<s32>(scaling ? resolution.ScaleUp(extent.width) : extent.width), - .y = static_cast<s32>(scaling ? resolution.ScaleUp(extent.height) : extent.height), + .x = static_cast<s32>(resolution.ScaleUp(extent.width)), + .y = static_cast<s32>(is_2d ? resolution.ScaleUp(extent.height) : extent.height), }; boost::container::small_vector<VkImageBlit, 4> regions; regions.reserve(resources.levels); @@ -1154,7 +1153,7 @@ bool Image::ScaleUp() { if (aspect_mask == 0) { aspect_mask = ImageAspectMask(info.format); } - BlitScale(*scheduler, *original_image, *scaled_image, info, aspect_mask, resolution, true); + BlitScale(*scheduler, *original_image, *scaled_image, info, aspect_mask, resolution); current_image = *scaled_image; flags |= ImageFlagBits::Rescaled; return true; |