Mesa (master): zink: Fix format query for minmax reduction support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 22 16:58:11 UTC 2021


Module: Mesa
Branch: master
Commit: fca09eb8f390e202a18a964a3816a0b3729938cc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fca09eb8f390e202a18a964a3816a0b3729938cc

Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Apr 21 18:22:37 2021 -0400

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 <michael.blumenkrantz at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10397>

---

 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 */



More information about the mesa-commit mailing list