diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 3fe4629be5e..c2b82a7b0c9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -2711,10 +2711,10 @@ get_register_type(struct lp_build_nir_context *bld_base, 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; } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c index 3a01549e2f3..0ea4f4b67b7 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c @@ -227,7 +227,7 @@ get_soa_array_offsets(struct lp_build_context *uint_bld, 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);