Mesa (master): radeonsi: make cs_preamble_state optional
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jul 22 16:58:21 UTC 2020
Module: Mesa
Branch: master
Commit: babd87f2e0865fde1386c4797131c26265b2da09
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=babd87f2e0865fde1386c4797131c26265b2da09
Author: Marek Olšák <marek.olsak at amd.com>
Date: Thu Jun 18 00:51:19 2020 -0400
radeonsi: make cs_preamble_state optional
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5798>
---
src/gallium/drivers/radeonsi/si_gfx_cs.c | 3 ++-
src/gallium/drivers/radeonsi/si_pipe.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c
index 8ad95cba8af..fe175769f80 100644
--- a/src/gallium/drivers/radeonsi/si_gfx_cs.c
+++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 9501cb7c123..e366b6b5458 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -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++)
More information about the mesa-commit
mailing list