Mesa (main): zink: handle custom border color without matching wrap mode case

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 21 15:11:54 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jun 21 09:49:18 2021 -0400

zink: handle custom border color without matching wrap mode case

this is just default border color and the custom color is ignored

Fixes: 36f4e61403a ("zink: rework border color handling")

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11495>

---

 src/gallium/drivers/zink/zink_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 2a740e54b93..5b5dbea650c 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -256,7 +256,7 @@ wrap_needs_border_color(unsigned wrap)
 }
 
 static VkBorderColor
-get_border_color(const union pipe_color_union *color, bool is_integer)
+get_border_color(const union pipe_color_union *color, bool is_integer, bool need_custom)
 {
    if (is_integer) {
       if (color->ui[0] == 0 && color->ui[1] == 0 && color->ui[2] == 0 && color->ui[3] == 0)
@@ -265,7 +265,7 @@ get_border_color(const union pipe_color_union *color, bool is_integer)
          return VK_BORDER_COLOR_INT_OPAQUE_BLACK;
       if (color->ui[0] == 1 && color->ui[1] == 1 && color->ui[2] == 1 && color->ui[3] == 1)
          return VK_BORDER_COLOR_INT_OPAQUE_WHITE;
-      return VK_BORDER_COLOR_INT_CUSTOM_EXT;
+      return need_custom ? VK_BORDER_COLOR_INT_CUSTOM_EXT : VK_BORDER_COLOR_INT_TRANSPARENT_BLACK;
    }
 
    if (color->f[0] == 0 && color->f[1] == 0 && color->f[2] == 0 && color->f[3] == 0)
@@ -274,7 +274,7 @@ get_border_color(const union pipe_color_union *color, bool is_integer)
       return VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK;
    if (color->f[0] == 1 && color->f[1] == 1 && color->f[2] == 1 && color->f[3] == 1)
       return VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
-   return VK_BORDER_COLOR_FLOAT_CUSTOM_EXT;
+   return need_custom ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
 }
 
 static void *
@@ -335,7 +335,7 @@ zink_create_sampler_state(struct pipe_context *pctx,
 
    bool is_integer = state->border_color_is_integer;
 
-   sci.borderColor = get_border_color(&state->border_color, is_integer);
+   sci.borderColor = get_border_color(&state->border_color, is_integer, need_custom);
    if (sci.borderColor > VK_BORDER_COLOR_INT_OPAQUE_WHITE && need_custom) {
       if (screen->info.have_EXT_custom_border_color &&
           screen->info.border_color_feats.customBorderColorWithoutFormat) {



More information about the mesa-commit mailing list