} else if (path.path[idx_lvl]->deref_type == nir_deref_type_array) {
unsigned size = glsl_count_attribute_slots(path.path[idx_lvl]->type, vs_in);
if (nir_src_is_const(path.path[idx_lvl]->arr.index)) {
- const_offset += nir_src_comp_as_int(path.path[idx_lvl]->arr.index, 0) * size;
+ const_offset += nir_src_comp_as_int(path.path[idx_lvl]->arr.index, 0) * size;
} else {
- LLVMValueRef idx_src = get_src(bld_base, path.path[idx_lvl]->arr.index);
- idx_src = cast_type(bld_base, idx_src, nir_type_uint, 32);
- LLVMValueRef array_off = lp_build_mul(&bld_base->uint_bld, lp_build_const_int_vec(bld_base->base.gallivm, bld_base->base.type, size),
- idx_src);
- if (offset)
- offset = lp_build_add(&bld_base->uint_bld, offset, array_off);
- else
- offset = array_off;
+ LLVMValueRef idx_src = get_src(bld_base, path.path[idx_lvl]->arr.index);
+ idx_src = cast_type(bld_base, idx_src, nir_type_uint, 32);
+ LLVMValueRef array_off = lp_build_mul(&bld_base->uint_bld, lp_build_const_int_vec(bld_base->base.gallivm, bld_base->base.type, size),
+ idx_src);
+ if (offset)
+ offset = lp_build_add(&bld_base->uint_bld, offset, array_off);
+ else
+ offset = array_off;
}
} else
unreachable("Uhandled deref type in get_deref_instr_offset");