Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Only include SamplerReductionModeCreateInfo if needed #1827

Merged
merged 1 commit into from
Feb 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions vulkano/src/sampler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -587,6 +582,11 @@ impl SamplerBuilder {
}
}

Some(ash::vk::SamplerReductionModeCreateInfo {
reduction_mode: reduction_mode.into(),
..Default::default()
})
} else {
None
};

Expand Down