diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 6d9a4d337a6..40148ec2d90 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -5985,12 +5985,10 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler, * know what we might have to wait on when coming in from VS chsh. */ if (so->type == MESA_SHADER_TESS_CTRL || so->type == MESA_SHADER_GEOMETRY) { - foreach_block (block, &ir->block_list) { - foreach_instr (instr, &block->instr_list) { - instr->flags |= IR3_INSTR_SS | IR3_INSTR_SY; - break; - } - } + 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 (ctx->compiler->gen >= 7 && so->type == MESA_SHADER_COMPUTE) {