From b69ab37bdc269879e6b3bd4ec2647292916fc6e3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 6 Oct 2023 15:23:51 -0400 Subject: [PATCH] asahi: Pack non-border colour sampler desc Apparently custom border colours don't work properly with bindless. Needs investigation. Patch this out so we don't fault. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 5 +++++ src/gallium/drivers/asahi/agx_state.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 4e87783f434..5b474a81f3f 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -505,12 +505,17 @@ agx_create_sampler_state(struct pipe_context *pctx, } } + memcpy(&so->desc_without_custom_border, &so->desc, sizeof(so->desc)); + if (so->uses_custom_border) { union pipe_color_union border = state->border_color; enum pipe_format format = fixup_border_zs(state->border_color_format, &border); agx_pack_border(&so->border, border.ui, format); + + /* Neutralize the bindless-safe descriptor. XXX: This is a hack. */ + so->desc_without_custom_border.opaque[1] &= ~(1u << 23); } return so; diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index ce9e4827e5d..719ae09e021 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -591,7 +591,7 @@ struct agx_sampler_state { struct pipe_sampler_state base; /* Prepared descriptor */ - struct agx_sampler_packed desc; + struct agx_sampler_packed desc, desc_without_custom_border; /* Whether a custom border colour is required */ bool uses_custom_border;