diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index d17c3a4bbe8..245ebbd41ae 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -4669,7 +4669,9 @@ lp_build_do_atomic_soa(struct gallivm_state *gallivm, LLVMVectorType(ref_type, type.length); LLVMValueRef atom_res = lp_build_alloca(gallivm, atom_res_elem_type, ""); - offset = LLVMBuildGEP(gallivm->builder, base_ptr, &offset, 1, ""); + offset = LLVMBuildGEP2(gallivm->builder, + LLVMInt8TypeInContext(gallivm->context), + base_ptr, &offset, 1, ""); struct lp_build_loop_state loop_state; lp_build_loop_begin(&loop_state, gallivm, lp_build_const_int32(gallivm, 0));