diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c index f03da17c4d4..f5c4a2105b4 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c @@ -181,8 +181,10 @@ calc_centroid_offsets(struct lp_build_interp_soa_context *bld, LLVMValueRef x_val_idx = lp_build_const_int32(gallivm, s * 2); LLVMValueRef y_val_idx = lp_build_const_int32(gallivm, s * 2 + 1); - x_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, x_val_idx); - y_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, y_val_idx); + x_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, x_val_idx); + y_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, y_val_idx); x_val_idx = lp_build_broadcast_scalar(coeff_bld, x_val_idx); y_val_idx = lp_build_broadcast_scalar(coeff_bld, y_val_idx); centroid_x_offset = lp_build_select(coeff_bld, sample_cov, x_val_idx, centroid_x_offset); @@ -338,7 +340,8 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld, dadx = coeff_bld->one; if (sample_id) { LLVMValueRef x_val_idx = LLVMBuildMul(gallivm->builder, sample_id, lp_build_const_int32(gallivm, 2), ""); - x_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, x_val_idx); + x_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, x_val_idx); a = lp_build_broadcast_scalar(coeff_bld, x_val_idx); } else { a = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset); @@ -349,7 +352,8 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld, if (sample_id) { LLVMValueRef y_val_idx = LLVMBuildMul(gallivm->builder, sample_id, lp_build_const_int32(gallivm, 2), ""); y_val_idx = LLVMBuildAdd(gallivm->builder, y_val_idx, lp_build_const_int32(gallivm, 1), ""); - y_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, y_val_idx); + y_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, y_val_idx); a = lp_build_broadcast_scalar(coeff_bld, y_val_idx); } else { a = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset); @@ -373,8 +377,10 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld, LLVMValueRef x_val_idx = LLVMBuildMul(gallivm->builder, sample_id, lp_build_const_int32(gallivm, 2), ""); LLVMValueRef y_val_idx = LLVMBuildAdd(gallivm->builder, x_val_idx, lp_build_const_int32(gallivm, 1), ""); - x_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, x_val_idx); - y_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, y_val_idx); + x_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, x_val_idx); + y_val_idx = lp_build_array_get2(gallivm, bld->sample_pos_array_type, + bld->sample_pos_array, y_val_idx); xoffset = lp_build_broadcast_scalar(coeff_bld, x_val_idx); yoffset = lp_build_broadcast_scalar(coeff_bld, y_val_idx); } else if (loc == TGSI_INTERPOLATE_LOC_CENTROID) { @@ -678,6 +684,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, const struct lp_shader_input *inputs, boolean pixel_center_integer, unsigned coverage_samples, + LLVMTypeRef sample_pos_array_type, LLVMValueRef sample_pos_array, LLVMValueRef num_loop, LLVMBuilderRef builder, @@ -750,6 +757,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, } bld->coverage_samples = coverage_samples; bld->num_loop = num_loop; + bld->sample_pos_array_type = sample_pos_array_type; bld->sample_pos_array = sample_pos_array; pos_init(bld, x0, y0); diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h index acd55461184..445c8655d4d 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h @@ -90,6 +90,7 @@ struct lp_build_interp_soa_context double pos_offset; unsigned coverage_samples; LLVMValueRef num_loop; + LLVMTypeRef sample_pos_array_type; LLVMValueRef sample_pos_array; LLVMValueRef x; @@ -124,6 +125,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, const struct lp_shader_input *inputs, boolean pixel_center_integer, unsigned coverage_samples, + LLVMTypeRef sample_pos_array_type, LLVMValueRef sample_pos_array, LLVMValueRef num_loop, LLVMBuilderRef builder, diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 1aef483fd64..7e554662bdd 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -3319,7 +3319,9 @@ generate_fragment(struct llvmpipe_context *lp, shader->info.base.num_inputs, inputs, pixel_center_integer, - key->coverage_samples, glob_sample_pos, + key->coverage_samples, + LLVMTypeOf(sample_pos_array), + glob_sample_pos, num_loop, builder, fs_type, a0_ptr, dadx_ptr, dady_ptr,