diff options
author | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 18:19:32 +0200 |
---|---|---|
committer | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 18:19:32 +0200 |
commit | 42c944b250d8d5c8147b24b3a453cba29968d46c (patch) | |
tree | 6d156e8247219bf373edd848bd3a89bbd32eb546 /src/video_core/renderer_vulkan/pipeline_helper.h | |
parent | video_core: Apply AF only to samplers with normal LOD range [0, 1+x] (diff) | |
download | yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.gz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.bz2 yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.lz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.xz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.zst yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/pipeline_helper.h')
-rw-r--r-- | src/video_core/renderer_vulkan/pipeline_helper.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 983e1c2e1..1632a6f26 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -178,7 +178,7 @@ public: inline void PushImageDescriptors(TextureCache& texture_cache, GuestDescriptorQueue& guest_descriptor_queue, const Shader::Info& info, RescalingPushConstant& rescaling, - const VkSampler*& samplers, + const Sampler**& samplers, const VideoCommon::ImageViewInOut*& views) { const u32 num_texture_buffers = Shader::NumDescriptors(info.texture_buffer_descriptors); const u32 num_image_buffers = Shader::NumDescriptors(info.image_buffer_descriptors); @@ -187,10 +187,14 @@ inline void PushImageDescriptors(TextureCache& texture_cache, for (const auto& desc : info.texture_descriptors) { for (u32 index = 0; index < desc.count; ++index) { const VideoCommon::ImageViewId image_view_id{(views++)->id}; - const VkSampler sampler{*(samplers++)}; ImageView& image_view{texture_cache.GetImageView(image_view_id)}; const VkImageView vk_image_view{image_view.Handle(desc.type)}; - guest_descriptor_queue.AddSampledImage(vk_image_view, sampler); + const Sampler& sampler{**(samplers++)}; + const bool use_fallback_sampler{sampler.HasAddedAnisotropy() && + !image_view.SupportsAnisotropy()}; + const VkSampler vk_sampler{use_fallback_sampler ? sampler.HandleWithoutAnisotropy() + : sampler.Handle()}; + guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler); rescaling.PushTexture(texture_cache.IsRescaling(image_view)); } } |