From 757fd8be563beaa878488a34b828ac8f77ccf3dd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 22 Jan 2024 16:37:45 -0400 Subject: [PATCH] asahi: fix instance count with indirect draw Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 597a77aaa3b..2121fd05d54 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -5159,11 +5159,11 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, agx_push(out, INDEX_LIST, cfg) { cfg.primitive = prim; - cfg.instance_count_present = true; if (indirect != NULL) { cfg.indirect_buffer_present = true; } else { + cfg.instance_count_present = true; cfg.index_count_present = true; cfg.start_present = true; } @@ -5186,10 +5186,10 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, if (!indirect) { agx_push(out, INDEX_LIST_COUNT, cfg) cfg.count = draws->count; - } - agx_push(out, INDEX_LIST_INSTANCES, cfg) - cfg.count = info->instance_count; + agx_push(out, INDEX_LIST_INSTANCES, cfg) + cfg.count = info->instance_count; + } if (indirect) { struct agx_resource *indirect_rsrc = agx_resource(indirect->buffer);