intel/fs: Generalize the unlit centroid workaround

This generalizes the unlit centroid workaround so it's less code and now
supports SIMD32.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Francisco Jerez
2017-01-13 15:33:45 -08:00
committed by Jason Ekstrand
parent 1d381731e0
commit 40fe108e2b

View File

@@ -281,21 +281,15 @@ fs_visitor::emit_interpolation_setup_gen6()
*/ */
bld.emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS); bld.emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
set_predicate_inv(BRW_PREDICATE_NORMAL, true, for (unsigned q = 0; q < dispatch_width / 8; q++) {
bld.half(0).MOV(horiz_offset(delta_xy[i], 0), for (unsigned c = 0; c < 2; c++) {
horiz_offset(pixel_delta_xy, 0))); const unsigned idx = c + (q & 2) + (q & 1) * dispatch_width / 8;
set_predicate_inv(BRW_PREDICATE_NORMAL, true, set_predicate_inv(
bld.half(0).MOV(horiz_offset(delta_xy[i], 8), BRW_PREDICATE_NORMAL, true,
horiz_offset(pixel_delta_xy, 8))); bld.half(q).MOV(horiz_offset(delta_xy[i], idx * 8),
if (dispatch_width == 16) { horiz_offset(pixel_delta_xy, idx * 8)));
set_predicate_inv(BRW_PREDICATE_NORMAL, true, }
bld.half(1).MOV(horiz_offset(delta_xy[i], 16),
horiz_offset(pixel_delta_xy, 16)));
set_predicate_inv(BRW_PREDICATE_NORMAL, true,
bld.half(1).MOV(horiz_offset(delta_xy[i], 24),
horiz_offset(pixel_delta_xy, 24)));
} }
assert(dispatch_width != 32); /* not implemented yet */
} }
} }
} }