diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index c2602cdf85a..52bacb01b31 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -195,7 +195,12 @@ panfrost_create_sampler_state(struct pipe_context *pctx, * swizzle derived from the format, to allow more formats than the * hardware otherwise supports. When packing border colours, we need to * undo this bijection, by swizzling with its inverse. + * On v10+, watch out for depth+stencil formats, because those have a + * swizzle that doesn't really apply to the border color */ +#if PAN_ARCH >= 10 + if (!util_format_is_depth_and_stencil(cso->border_color_format)) { +#endif unsigned mali_format = GENX(panfrost_format_from_pipe_format)(cso->border_color_format)->hw; enum mali_rgb_component_order order = mali_format & BITFIELD_MASK(12); @@ -207,6 +212,10 @@ panfrost_create_sampler_state(struct pipe_context *pctx, util_format_apply_color_swizzle(&so->base.border_color, &cso->border_color, inverted_swizzle, false /* is_integer (irrelevant) */); +#if PAN_ARCH >= 10 + } +#endif + #endif bool using_nearest = cso->min_img_filter == PIPE_TEX_MIPFILTER_NEAREST; diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 5cca2d69713..8717a422053 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -208,7 +208,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) * handles this but we need to fix up the border colour. */ case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK: - if (dev->arch == 7) + if (dev->arch == 7 || dev->arch >= 10) return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO; else return 0;