This now matches how they get dereffed by get_soa_array_offsets() -- each
array element has num_components vecs inside of it, rather than each
components has an array in it.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
get_int_bld(bld_base, true, reg->bit_size == 1 ? 32 : reg->bit_size);
LLVMTypeRef type = int_bld->vec_type;
- if (reg->num_array_elems)
- type = LLVMArrayType(type, reg->num_array_elems);
if (reg->num_components > 1)
type = LLVMArrayType(type, reg->num_components);
+ if (reg->num_array_elems)
+ type = LLVMArrayType(type, reg->num_array_elems);
return type;
}
lp_build_const_int_vec(gallivm, uint_bld->type, uint_bld->type.length);
LLVMValueRef index_vec;
- /* index_vec = (indirect_index * 4 + chan_index) * length + offsets */
+ /* index_vec = (indirect_index * num_components + chan_index) * length + offsets */
index_vec = lp_build_mul(uint_bld, indirect_index, lp_build_const_int_vec(uint_bld->gallivm, uint_bld->type, num_components));
index_vec = lp_build_add(uint_bld, index_vec, chan_vec);
index_vec = lp_build_mul(uint_bld, index_vec, length_vec);