diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-12-23 07:57:01 -0800 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-12-24 09:12:27 -0800 |
commit | b31f62c9074cb88fbb2e0b327e053778dea5b83f (patch) | |
tree | 27c7016e570742cb207d1b471314cecc29082a8a /src/mesa/drivers/dri/i965/brw_gs.h | |
parent | 5c818c6277247468ccf69abda00f5bc220b59644 (diff) | |
download | external_mesa3d-b31f62c9074cb88fbb2e0b327e053778dea5b83f.zip external_mesa3d-b31f62c9074cb88fbb2e0b327e053778dea5b83f.tar.gz external_mesa3d-b31f62c9074cb88fbb2e0b327e053778dea5b83f.tar.bz2 |
i965 gen6: Fix transform feedback of triangle strips.
When rendering triangle strips, vertices come down the pipeline in the
order specified, even though this causes alternate triangles to have
reversed winding order. For example, if the vertices are ABCDE, then
the GS is invoked on triangles ABC, BCD, and CDE, even though this
means that triangle BCD is in the reverse of the normal winding order.
The hardware automatically flags the triangles with reversed winding
order as _3DPRIM_TRISTRIP_REVERSE, so that face culling and two-sided
coloring can be adjusted to account for the reversed order.
In order to ensure that winding order is correct when streaming
vertices out to a transform feedback buffer, we need to alter the
ordering of BCD to BDC when the first provoking vertex convention is
in use, and to CBD when the last provoking vertex convention is in
use.
To do this, we precompute an array of indices indicating where each
vertex will be placed in the transform feedback buffer; normally this
is SVBI[0] + (0, 1, 2), indicating that vertex order should be
preserved. When the primitive type is _3DPRIM_TRISTRIP_REVERSE, we
change this order to either SVBI[0] + (0, 2, 1) or SVBI[0] + (1, 0,
2), depending on the provoking vertex convention.
Fixes piglit tests "EXT_transform_feedback/tessellation
triangle_strip" on Gen6.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.h b/src/mesa/drivers/dri/i965/brw_gs.h index 7bf2248..2ab8b72 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.h +++ b/src/mesa/drivers/dri/i965/brw_gs.h @@ -83,6 +83,12 @@ struct brw_gs_compile { struct brw_reg vertex[MAX_GS_VERTS]; struct brw_reg header; struct brw_reg temp; + + /** + * Register holding destination indices for streamed buffer writes. + * Only used for SOL programs. + */ + struct brw_reg destination_indices; } reg; /* Number of registers used to store vertex data */ |