radeonsi: generate GS prolog to (partially) fix triangle strip adjacency rotation
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Oct 2016 11:50:09 +0000 (12:50 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 3 Nov 2016 09:11:24 +0000 (10:11 +0100)
commit908f92ad1f8562490468716d789f4d78b543399c
treeb6e2e04f74c536f1a5966baaf348f7cdf5a232cc
parentffe4e829b0da8484ecc98ca4d31bfdbb8d667643
radeonsi: generate GS prolog to (partially) fix triangle strip adjacency rotation

Fixes GL45-CTS.geometry_shader.adjacency.adjacency_indiced_triangle_strip and
others.

This leaves the case of triangle strips with adjacency and primitive restarts
open. It seems that the only thing that cares about that is a piglit test.
Fixing this efficiently would be really involved, and I don't want to use the
hammer of degrading to software handling of indices because there may well
be software that uses this draw mode (without caring about the precise
rotation of triangles).

v2:
- skip the GS prolog entirely if workaround is not needed
- only check for TES (TES is always non-null when tessellation is used)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_draw.c
src/gallium/drivers/radeonsi/si_state_shaders.c