radeonsi: make cs_preamble_state optional

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5798>
This commit is contained in:
Marek Olšák
2020-06-18 00:51:19 -04:00
parent 7a6af4c5ed
commit babd87f2e0
2 changed files with 4 additions and 2 deletions

View File

@@ -426,7 +426,8 @@ void si_begin_new_gfx_cs(struct si_context *ctx)
si_pm4_reset_emitted(ctx);
/* The CS initialization should be emitted before everything else. */
si_pm4_emit(ctx, ctx->cs_preamble_state);
if (ctx->cs_preamble_state)
si_pm4_emit(ctx, ctx->cs_preamble_state);
if (ctx->cs_preamble_gs_rings)
si_pm4_emit(ctx, ctx->cs_preamble_gs_rings);

View File

@@ -195,7 +195,8 @@ static void si_destroy_context(struct pipe_context *context)
si_resource_reference(&sctx->wait_mem_scratch, NULL);
si_resource_reference(&sctx->small_prim_cull_info_buf, NULL);
si_pm4_free_state(sctx, sctx->cs_preamble_state, ~0);
if (sctx->cs_preamble_state)
si_pm4_free_state(sctx, sctx->cs_preamble_state, ~0);
if (sctx->cs_preamble_gs_rings)
si_pm4_free_state(sctx, sctx->cs_preamble_gs_rings, ~0);
for (i = 0; i < ARRAY_SIZE(sctx->vgt_shader_config); i++)