From e53316615297aef5dbed9eceaf98dcfa002ec8aa Mon Sep 17 00:00:00 2001 From: Rua Date: Tue, 15 Feb 2022 09:10:06 +0100 Subject: [PATCH] Only include `SamplerReductionModeCreateInfo` if needed --- vulkano/src/sampler/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vulkano/src/sampler/mod.rs b/vulkano/src/sampler/mod.rs index 1e6167e512..f74870678a 100644 --- a/vulkano/src/sampler/mod.rs +++ b/vulkano/src/sampler/mod.rs @@ -561,15 +561,10 @@ impl SamplerBuilder { } let mut sampler_reduction_mode_create_info = - if device.enabled_features().sampler_filter_minmax - || device.enabled_extensions().ext_sampler_filter_minmax - { - Some(ash::vk::SamplerReductionModeCreateInfo { - reduction_mode: reduction_mode.into(), - ..Default::default() - }) - } else { - if reduction_mode != SamplerReductionMode::WeightedAverage { + if reduction_mode != SamplerReductionMode::WeightedAverage { + if !(device.enabled_features().sampler_filter_minmax + || device.enabled_extensions().ext_sampler_filter_minmax) + { if device .physical_device() .supported_features() @@ -587,6 +582,11 @@ impl SamplerBuilder { } } + Some(ash::vk::SamplerReductionModeCreateInfo { + reduction_mode: reduction_mode.into(), + ..Default::default() + }) + } else { None };