diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index af87be75c19..aa279abda26 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -4547,6 +4547,18 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info, batch->cdm = agx_encoder_allocate(batch, dev); } + agx_upload_draw_params(batch, indirect, draws, info); + agx_upload_vbos(batch); + agx_update_vs(batch, info->index_size); + agx_update_tcs(ctx, info); + /* XXX */ + ctx->stage[MESA_SHADER_TESS_CTRL].dirty = ~0; + ctx->stage[MESA_SHADER_TESS_EVAL].dirty = ~0; + agx_update_descriptors(batch, ctx->vs); + agx_update_descriptors(batch, ctx->tcs); + + batch->uniforms.vertex_outputs = ctx->vs->b.info.outputs; + uint64_t ib = 0; size_t ib_extent = 0; @@ -4560,8 +4572,6 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info, .outputs = ctx->vs->b.info.outputs, }; - agx_upload_draw_params(batch, indirect, draws, info); - /* Setup parameters */ uint64_t heap = agx_batch_heap(batch); assert((tcs->tess.output_stride & 3) == 0 && "must be aligned"); @@ -4592,17 +4602,6 @@ agx_draw_patches(struct agx_context *ctx, const struct pipe_draw_info *info, struct agx_grid vs_grid, tcs_grid, tess_grid; - agx_upload_vbos(batch); - agx_update_vs(batch, info->index_size); - agx_update_tcs(ctx, info); - /* XXX */ - ctx->stage[MESA_SHADER_TESS_CTRL].dirty = ~0; - ctx->stage[MESA_SHADER_TESS_EVAL].dirty = ~0; - agx_update_descriptors(batch, ctx->vs); - agx_update_descriptors(batch, ctx->tcs); - - batch->uniforms.vertex_outputs = ctx->vs->b.info.outputs; - if (indirect == NULL) { unsigned in_patches = draws->count / patch_vertices; if (in_patches == 0)