From ef95ed1e2ee9212e35e57dae4edc858775d848c9 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 14 May 2025 15:07:37 -0700 Subject: [PATCH] freedreno/ir3: Fix tess/geom asan error Fixes: ee0ee2a31747 ("ir3: don't sync every TCS/GEOM block") Signed-off-by: Rob Clark Part-of: (cherry picked from commit d8ed4f14e6f7836b34a3d17ebfdf344ff5ed4f25) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_compiler_nir.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c2f370897a2..90b22fd4ef2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1714,7 +1714,7 @@ "description": "freedreno/ir3: Fix tess/geom asan error", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ee0ee2a3174775531dd6cc7663940e2acf48b7b8", "notes": null diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 1e54e0629b1..4cc32be3848 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -5951,9 +5951,11 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler, */ if (so->type == MESA_SHADER_TESS_CTRL || so->type == MESA_SHADER_GEOMETRY) { struct ir3_block *first_block = ir3_start_block(ir); - struct ir3_instruction *first_instr = list_first_entry( - &first_block->instr_list, struct ir3_instruction, node); - first_instr->flags |= IR3_INSTR_SS | IR3_INSTR_SY; + if (!list_is_empty(&first_block->instr_list)) { + struct ir3_instruction *first_instr = list_first_entry( + &first_block->instr_list, struct ir3_instruction, node); + first_instr->flags |= IR3_INSTR_SS | IR3_INSTR_SY; + } } if (ctx->compiler->gen >= 7 && so->type == MESA_SHADER_COMPUTE) {