diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 0071530c534..c61a2ab632b 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -563,23 +563,27 @@ agx_ra(agx_context *ctx) agx_remove_instruction(ins); continue; } else if (ins->op == AGX_OPCODE_SPLIT) { - assert(ins->src[0].type == AGX_INDEX_REGISTER); - unsigned base = ins->src[0].value; - unsigned width = agx_size_align_16(agx_split_width(ins)); + assert(ins->src[0].type == AGX_INDEX_REGISTER || + ins->src[0].type == AGX_INDEX_UNIFORM); struct agx_copy copies[4]; assert(ins->nr_dests <= ARRAY_SIZE(copies)); unsigned n = 0; + unsigned width = agx_size_align_16(agx_split_width(ins)); /* Move the sources */ agx_foreach_dest(ins, i) { if (ins->dest[i].type != AGX_INDEX_REGISTER) continue; + agx_index src = ins->src[0]; + src.size = ins->dest[i].size; + src.value += (i * width); + copies[n++] = (struct agx_copy){ .dest = ins->dest[i].value, - .src = agx_register(base + (i * width), ins->dest[i].size), + .src = src, }; }