draw: stop crashing with extra shader outputs
authorZack Rusin <zackr@vmware.com>
Fri, 2 Aug 2013 05:39:35 +0000 (01:39 -0400)
committerZack Rusin <zackr@vmware.com>
Sat, 3 Aug 2013 00:11:18 +0000 (20:11 -0400)
commit05487ef88ded5fea0b1de7bc08d44846648d1ce2
tree5a97df0f2d48c4c6e008be4eba0922d99a5304fb
parent2e46a1dcb33618f2873ebaaeb3ffe238f11a31a3
draw: stop crashing with extra shader outputs

Draw sometimes injects extra shader outputs (aa points, lines or
front face), unfortunately most of the pipeline and llvm code
didn't handle them at all. It only worked if number of inputs
happened to be bigger or equal to the number of shader outputs
plus the extra injected outputs. In particular when running
the pipeline which depends on the vertex_id in the vertex_header
things were completely broken. The patch adjust the code to
correctly use the total number of shader outputs (the standard
ones plus the injected ones) to make it all stop crashing and
work.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_context.h
src/gallium/auxiliary/draw/draw_gs.c
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/draw/draw_pipe.h
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
src/gallium/auxiliary/draw/draw_vs_variant.c