zink: support PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17189>
This commit is contained in:
Mike Blumenkrantz 2022-06-22 09:16:17 -04:00 committed by Marge Bot
parent 2f46495ac0
commit 3f11ae93be
2 changed files with 4 additions and 2 deletions

View file

@ -379,7 +379,7 @@ zink_create_sampler_state(struct pipe_context *pctx,
warn_missing_feature(warned, "customBorderColorWithoutFormat");
}
if (screen->info.have_EXT_custom_border_color &&
screen->info.border_color_feats.customBorderColorWithoutFormat) {
(screen->info.border_color_feats.customBorderColorWithoutFormat || state->border_color_format)) {
if (!screen->info.have_EXT_border_color_swizzle) {
static bool warned = false;
warn_missing_feature(warned, "VK_EXT_border_color_swizzle");
@ -401,7 +401,7 @@ zink_create_sampler_state(struct pipe_context *pctx,
}
}
cbci.sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT;
cbci.format = VK_FORMAT_UNDEFINED;
cbci.format = screen->info.border_color_feats.customBorderColorWithoutFormat ? VK_FORMAT_UNDEFINED : zink_get_format(screen, state->border_color_format);
/* these are identical unions */
memcpy(&cbci.customBorderColor, &state->border_color, sizeof(union pipe_color_union));
cbci.pNext = sci.pNext;

View file

@ -532,6 +532,8 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 0;
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
if (!screen->info.border_color_feats.customBorderColorWithoutFormat)
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO;
/* assume that if drivers don't implement this extension they either:
* - don't support custom border colors
* - handle things correctly