diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-19 02:50:00 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | 16017ac4503603bcf8189583120ad8888242b0e1 (patch) | |
tree | 6ce351a11c53df3134efde1ca821aa2145bd9342 /src/video_core/renderer_vulkan/vk_texture_cache.cpp | |
parent | gl_texture_cache: Fix depth and integer format scaling blits (diff) | |
download | yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar.gz yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar.bz2 yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar.lz yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar.xz yuzu-16017ac4503603bcf8189583120ad8888242b0e1.tar.zst yuzu-16017ac4503603bcf8189583120ad8888242b0e1.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 855f0a5d7..a34cd31f0 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -37,6 +37,7 @@ using VideoCommon::ImageInfo; using VideoCommon::ImageType; using VideoCommon::SubresourceRange; using VideoCore::Surface::IsPixelFormatASTC; +using VideoCore::Surface::IsPixelFormatInteger; namespace { constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { @@ -603,9 +604,13 @@ void BlitScale(VKScheduler& scheduler, VkImage src_image, VkImage dst_image, con .width = info.size.width, .height = info.size.height, }; + const bool is_zeta = (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != 0; + const bool is_int_format = IsPixelFormatInteger(info.format); + 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::CommandBuffer cmdbuf) { + scaling, vk_filter](vk::CommandBuffer cmdbuf) { const auto scale_up = [&](u32 value) { return std::max<u32>((value * resolution.up_scale) >> resolution.down_shift, 1U); }; @@ -723,7 +728,7 @@ void BlitScale(VKScheduler& scheduler, VkImage src_image, VkImage dst_image, con cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, nullptr, nullptr, read_barriers); cmdbuf.BlitImage(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, regions, VK_FILTER_NEAREST); + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, regions, vk_filter); cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, nullptr, nullptr, write_barriers); }); |