u_blitter: Add an option to draw the triangles using an index buffer.
authorEric Anholt <eric@anholt.net>
Wed, 11 Jul 2018 21:53:57 +0000 (14:53 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 12 Jul 2018 18:49:22 +0000 (11:49 -0700)
commite8dc3c0c36e830f4b134151ac1e18d979e70f0c6
tree867e74e7e52668698039c151769b52cf0d13f1d8
parentc17dac0534b445937a6e13fea3dabd59aac139ff
u_blitter: Add an option to draw the triangles using an index buffer.

For V3D, the HW will interpolate slightly differently along the shared
edge of the trifan.  The conformance tests manage to catch this in the
nearest_consistency_* group.  To get interpolation to match, we need the
last vertex of the triangle to be shared.

I first tried implementing draw_rectangle to do triangles instead, but
that was quite a bit (147 lines) of code duplication from u_blitter, and
this seems much simpler and less likely to break as u_blitter changes.

Fixes dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_* on V3D.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/drivers/v3d/v3d_context.c