From fca09eb8f390e202a18a964a3816a0b3729938cc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 21 Apr 2021 18:22:37 -0400 Subject: [PATCH] zink: Fix format query for minmax reduction support All the rest of the filters here are written as "if asking for this feature and it's not there, return false", with an implicit fallthrough to the next test. There's no good reason to treat minmax differently. Fixes: 22e1ed57221 zink: support format queries for VK_EXT_sampler_filter_minmax Reviewed-By: Mike Blumenkrantz Reviewed-by: Ilia Mirkin Part-of: --- src/gallium/drivers/zink/zink_screen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 8cd0d804209..20c01d37c9c 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -879,8 +879,9 @@ zink_is_format_supported(struct pipe_screen *pscreen, !(props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) return false; - if (bind & PIPE_BIND_SAMPLER_REDUCTION_MINMAX) - return props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT; + if (bind & PIPE_BIND_SAMPLER_REDUCTION_MINMAX && + !(props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT)) + return false; if ((bind & PIPE_BIND_SAMPLER_VIEW) || (bind & PIPE_BIND_RENDER_TARGET)) { /* if this is a 3-component texture, force gallium to give us 4 components by rejecting this one */