From 98de1b1b9586b1d2f6cb37b620a14316b160f95c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 26 Jun 2023 16:23:01 -0400 Subject: [PATCH] asahi: Assert we don't transition shared resources This is an invariant maintained by all current callers and subtly required for the BO swapping to work. Assert it to make it obvious. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 7da9a0a8ba7..b0a2547f17b 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -1077,6 +1077,7 @@ transition_resource(struct pipe_context *pctx, struct agx_resource *rsrc, agx_resource(pctx->screen->resource_create(pctx->screen, templ)); assert(new_res); + assert(!(rsrc->base.bind & PIPE_BIND_SHARED) && "cannot swap BOs if shared"); int level; BITSET_FOREACH_SET(level, rsrc->data_valid, PIPE_MAX_TEXTURE_LEVELS) {