Revert "zink: always init bordercolor value for sampler"
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 27 Aug 2021 08:32:41 +0000 (10:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Aug 2021 18:09:51 +0000 (18:09 +0000)
This reverts commit 336dea90f09c5cefc46de5240da28950fdca0723.

This change was incorrect for two reasons:

1. We already initialize this field on line 334
2. Unconditionally setting this to
   VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK breaks rendering with e.g
   opaque white borders, because we've already matched those to a
   non-custom enum value first.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12591>

src/gallium/drivers/zink/zink_context.c

index 9a6317880052449984dedd9e4cd986a2aae46444..9f33d35a69923832cf2957715bb1ef5048f6d9d9 100644 (file)
@@ -345,8 +345,7 @@ zink_create_sampler_state(struct pipe_context *pctx,
          assert(check <= screen->info.border_color_props.maxCustomBorderColorSamplers);
       } else
          sci.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; // TODO with custom shader if we're super interested?
-   } else
-      sci.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
+   }
 
    sci.unnormalizedCoordinates = !state->normalized_coords;