From 6a27a3838ced35bfc0bdc5b08f1ed8ecb325b2bc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 28 Oct 2024 20:25:17 -0400 Subject: [PATCH] asahi: assert guard previously-subtle code would've caught the bug in the previous patch. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index cc8add069a8..341e6a94b0a 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -5021,6 +5021,10 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, (ctx->dirty & AGX_DIRTY_VERTEX)) ctx->dirty |= AGX_DIRTY_VS; + /* This is subtle. But agx_update_vs will be true at least once per batch. */ + assert(agx_batch_uses_bo(batch, ctx->vs->bo)); + assert(!ctx->linked.vs || agx_batch_uses_bo(batch, ctx->linked.vs->bo)); + agx_update_gs(ctx, info, indirect); if (ctx->gs) { @@ -5065,6 +5069,10 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, ctx->dirty |= AGX_DIRTY_FS; } + /* This is subtle. But agx_update_fs will be true at least once per batch. */ + assert(!ctx->fs->bo || agx_batch_uses_bo(batch, ctx->fs->bo)); + assert(agx_batch_uses_bo(batch, ctx->linked.fs->bo)); + if (ctx->linked.vs->uses_base_param || ctx->gs) { agx_upload_draw_params(batch, indirect, draws, info);