radeonsi: fix crash when AMD_DEBUG=cs,initnir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>
This commit is contained in:
Qiang Yu 2023-06-07 14:47:12 +08:00 committed by Marge Bot
parent 5f52f8a6ba
commit df4f84f806

View file

@ -227,9 +227,6 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
program->ir_type = cso->ir_type;
program->input_size = cso->req_input_mem;
if (si_can_dump_shader(sscreen, sel->stage, SI_DUMP_INIT_NIR))
nir_print_shader(sel->nir, stderr);
if (cso->ir_type != PIPE_SHADER_IR_NATIVE) {
if (cso->ir_type == PIPE_SHADER_IR_TGSI) {
program->ir_type = PIPE_SHADER_IR_NIR;
@ -239,6 +236,9 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
sel->nir = (struct nir_shader *)cso->prog;
}
if (si_can_dump_shader(sscreen, sel->stage, SI_DUMP_INIT_NIR))
nir_print_shader(sel->nir, stderr);
sel->compiler_ctx_state.debug = sctx->debug;
sel->compiler_ctx_state.is_debug_context = sctx->is_debug;
p_atomic_inc(&sscreen->num_shaders_created);