draw/llvm: fix generation of the VS with GS present
authorZack Rusin <zackr@vmware.com>
Tue, 4 Mar 2014 03:53:51 +0000 (22:53 -0500)
committerZack Rusin <zackr@vmware.com>
Tue, 4 Mar 2014 20:37:52 +0000 (15:37 -0500)
commit08f174daa41b89c41a87c350f407307e2ba258eb
tree464c634531a1b58fbe843240c66ab3781f8b3d4b
parent079bff5a99fa19029fc0caba92fe57046ee29b23
draw/llvm: fix generation of the VS with GS present

draw_current_shader_* functions return a final output when considering
both the geometry shader and the vertex shader. But when code generating
vertex shader we can not be using output slots from the geometry shader
because, obviously, those can be completely different. This fixes a
number of very non-obvious crashes.
A side-effect of this bug was that sometimes the vertex shading code
could save some random outputs as position/clip when the geometry
shader was writing them and vertex shader had different outputs at
those slots (sometimes writing garbage and sometimes something correct).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c