diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index e9a577a9b36..5651bb9055c 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -677,6 +677,8 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs) */ ctx->force_shader_coherency.with_cb = true; ctx->force_shader_coherency.with_db = true; + + ctx->task_state_init_emitted = false; } void si_trace_emit(struct si_context *sctx) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index a826da0e912..6170aae624a 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -391,6 +391,13 @@ static void si_destroy_context(struct pipe_context *context) _mesa_hash_table_u64_destroy(sctx->ps_resolve_shaders); } + si_resource_reference(&sctx->task_wait_buf, NULL); + si_resource_reference(&sctx->task_ring, NULL); + si_resource_reference(&sctx->task_scratch_buffer, NULL); + si_resource_reference(&sctx->mesh_scratch_ring, NULL); + if (sctx->task_preamble_state) + si_pm4_free_state(sctx, sctx->task_preamble_state, ~0); + FREE(sctx); } diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index f8997fc41e8..09cdca151e3 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1362,6 +1362,18 @@ struct si_context { struct si_ds_queue ds_queue; uint32_t *last_timestamp_cmd; unsigned int last_timestamp_cmd_cdw; + + /* For mesh shader */ + struct si_resource *task_wait_buf; + uint32_t task_wait_count; + uint32_t last_task_wait_count; + bool task_state_init_emitted; + struct si_resource *task_ring; + struct si_resource *task_scratch_buffer; + unsigned max_seen_task_scratch_bytes_per_wave; + uint32_t task_tmpring_size; + struct si_pm4_state *task_preamble_state; + struct si_resource *mesh_scratch_ring; }; /* si_barrier.c */