summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_gs.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-08-06 01:07:18 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-08-06 18:01:33 +0200
commit11bd6f0e9b348b67f73f39dfd2b8b6b9a8452bc4 (patch)
tree206a69b1e7bd93aed74f9e63b1f64592bf2c992e /src/gallium/auxiliary/draw/draw_gs.c
parentc40d7d6d948912a4d51cbf8f0854cf2ebe916636 (diff)
downloadexternal_mesa3d-11bd6f0e9b348b67f73f39dfd2b8b6b9a8452bc4.tar.gz
external_mesa3d-11bd6f0e9b348b67f73f39dfd2b8b6b9a8452bc4.tar.bz2
external_mesa3d-11bd6f0e9b348b67f73f39dfd2b8b6b9a8452bc4.zip
draw: don't run pipeline stages when gs has no position output
The clip stage may crash if there's no position output, for this reason code was added to avoid running the pipeline stages in this case (c7c7186045ec617c53f7899280cbe12e59503e4d). However, this failed to actually work when there was a geometry shader, since unlike the vertex shader it did not initialize the position output to -1, hence the code trying to detect this didn't trigger. So simply initialize the position output to -1 just like the vs does. This fixes piglit glsl-1.50-transform-feedback-type-and-size (segfault->pass). clip-distance-out-values.shader_test goes from segfault to assertion failure, suggesting more fixes are needed, no other piglit changes. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Zack Rusin <zackr@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index fc4f69792f..f6228229b4 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -791,6 +791,7 @@ draw_create_geometry_shader(struct draw_context *draw,
*/
gs->primitive_boundary = gs->max_output_vertices + 1;
+ gs->position_output = -1;
for (i = 0; i < gs->info.num_outputs; i++) {
if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_POSITION &&
gs->info.output_semantic_index[i] == 0)