aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-07-13 15:44:24 +1000
committerDave Airlie <[email protected]>2020-07-17 05:09:54 +1000
commite16f59c31621cdba819d7aed07d1457c838121bd (patch)
tree626fa14aa503d2a299aedb69837a756b2288ee4d /src/gallium/drivers
parent87e27543fe9a96bf4fd9555361ec66e3918aa3b3 (diff)
llvmpipe: fix position offset interpolation
pos offset only applies to the gl_FragPos input, when I refactored I messed that up, only use pos_offset for the position inputs and use 0.5 otherwise. This fixes: GTF-GL45.gtf30.GL3Tests.fragment_coord_conventions.fragment_coord_conventions_multisample Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5926>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
index 52ba7dbdd2a..7ec8bd13cbc 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
@@ -291,7 +291,7 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld,
LLVMValueRef pixoffx;
LLVMValueRef pixoffy;
LLVMValueRef ptr;
- LLVMValueRef pix_center_offset = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset);
+ LLVMValueRef pix_center_offset = lp_build_const_vec(gallivm, coeff_bld->type, 0.5);
/* could do this with code-generated passed in pixel offsets too */
@@ -333,7 +333,7 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld,
x_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, x_val_idx);
a = lp_build_broadcast_scalar(coeff_bld, x_val_idx);
} else {
- a = pix_center_offset;
+ a = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset);
}
}
else if (attrib == 0 && chan == 1) {
@@ -344,7 +344,7 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld,
y_val_idx = lp_build_array_get(gallivm, bld->sample_pos_array, y_val_idx);
a = lp_build_broadcast_scalar(coeff_bld, y_val_idx);
} else {
- a = pix_center_offset;
+ a = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset);
}
}
else {
@@ -534,7 +534,7 @@ lp_build_interp_soa(struct lp_build_interp_soa_context *bld,
pixoffy = LLVMBuildFAdd(builder, pixoffy,
lp_build_broadcast_scalar(coeff_bld, bld->y), "");
- LLVMValueRef pix_center_offset = lp_build_const_vec(gallivm, coeff_bld->type, bld->pos_offset);
+ LLVMValueRef pix_center_offset = lp_build_const_vec(gallivm, coeff_bld->type, 0.5);
if (loc == TGSI_INTERPOLATE_LOC_CENTER) {
if (bld->coverage_samples > 1) {