Mesa (main): zink: use VK_EXT_border_color_swizzle

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 17 01:46:16 UTC 2022


Module: Mesa
Branch: main
Commit: 46b4017b37e1a89d20670c9ea00eca0769701912
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=46b4017b37e1a89d20670c9ea00eca0769701912

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jun 14 09:55:25 2022 -0400

zink: use VK_EXT_border_color_swizzle

if borderColorSwizzleFromImage isn't supported, assume the border color
must be pre-swizzled

fixes #6651

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17029>

---

 src/gallium/drivers/zink/zink_screen.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 21a47629c67..84ba2add7ef 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -531,11 +531,13 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 0;
 
    case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
-      /* This is also broken on the other AMD drivers for old HW, but
-       * there's no obvious way to test for that.
+      /* assume that if drivers don't implement this extension they either:
+       * - don't support custom border colors
+       * - handle things correctly
+       * - hate border color accuracy
        */
-      if (screen->info.driver_props.driverID == VK_DRIVER_ID_MESA_RADV ||
-          screen->info.driver_props.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY)
+      if (screen->info.have_EXT_border_color_swizzle &&
+          !screen->info.border_swizzle_feats.borderColorSwizzleFromImage)
          return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50;
       return 0;
 



More information about the mesa-commit mailing list