From dc960936fc00b73715b16f882ed4e390e5243f72 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sat, 9 Aug 2025 22:09:17 -0700 Subject: [PATCH] brw: Move resize_sources() earlier when lowering FIND_LIVE_CHANNELS Move it before the new source is used. This currently works because all instructions have a minimum amount of sources allocated, but a later commit will change that. Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_opt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_opt.cpp b/src/intel/compiler/brw_opt.cpp index 7e27bbccdae..b452292504c 100644 --- a/src/intel/compiler/brw_opt.cpp +++ b/src/intel/compiler/brw_opt.cpp @@ -498,6 +498,8 @@ brw_opt_eliminate_find_live_channel(brw_shader &s) case SHADER_OPCODE_FIND_LIVE_CHANNEL: if (depth == 0) { inst->opcode = BRW_OPCODE_MOV; + + inst->resize_sources(1); inst->src[0] = brw_imm_ud(0u); inst->force_writemask_all = true; @@ -508,7 +510,6 @@ brw_opt_eliminate_find_live_channel(brw_shader &s) if (inst->size_written == inst->dst.component_size(8 * reg_unit(s.devinfo))) inst->exec_size = 8 * reg_unit(s.devinfo); - inst->resize_sources(1); progress = true; /* emit_uniformize() frequently emits FIND_LIVE_CHANNEL paired