diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-11-21 06:48:51 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-12-05 21:35:35 +0100 |
commit | b387a26f303c5fe611bcdd71ca2afc050e8608aa (patch) | |
tree | 9087205eba9f08362a856f0bf58a628b8f0d6518 | |
parent | Revert "Merge pull request #7395 from Morph1984/resolve-comments" (diff) | |
download | yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar.gz yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar.bz2 yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar.lz yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar.xz yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.tar.zst yuzu-b387a26f303c5fe611bcdd71ca2afc050e8608aa.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.cpp | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 1e447e621..c71a1f44d 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp @@ -391,28 +391,23 @@ VkSemaphore VKBlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer, .offset = {0, 0}, .extent = size, }; - const auto filter = Settings::values.scaling_filter.GetValue(); cmdbuf.BeginRenderPass(renderpass_bi, VK_SUBPASS_CONTENTS_INLINE); - switch (filter) { - case Settings::ScalingFilter::NearestNeighbor: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *bilinear_pipeline); - break; - case Settings::ScalingFilter::Bilinear: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *bilinear_pipeline); - break; - case Settings::ScalingFilter::Bicubic: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *bicubic_pipeline); - break; - case Settings::ScalingFilter::Gaussian: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *gaussian_pipeline); - break; - case Settings::ScalingFilter::ScaleForce: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *scaleforce_pipeline); - break; - default: - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *bilinear_pipeline); - break; - } + auto graphics_pipeline = [this]() { + switch (Settings::values.scaling_filter.GetValue()) { + case Settings::ScalingFilter::NearestNeighbor: + case Settings::ScalingFilter::Bilinear: + return *bilinear_pipeline; + case Settings::ScalingFilter::Bicubic: + return *bicubic_pipeline; + case Settings::ScalingFilter::Gaussian: + return *gaussian_pipeline; + case Settings::ScalingFilter::ScaleForce: + return *scaleforce_pipeline; + default: + return *bilinear_pipeline; + } + }(); + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, graphics_pipeline); cmdbuf.SetViewport(0, viewport); cmdbuf.SetScissor(0, scissor); |