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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17029>
This commit is contained in:
Mike Blumenkrantz 2022-06-14 09:55:25 -04:00 committed by Marge Bot
parent 1effd3be67
commit 46b4017b37
1 changed files with 6 additions and 4 deletions

View File

@ -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;