diff options
author | Zack Rusin <zackr@vmware.com> | 2013-08-02 01:39:35 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2013-08-02 20:11:18 -0400 |
commit | 05487ef88ded5fea0b1de7bc08d44846648d1ce2 (patch) | |
tree | 5a97df0f2d48c4c6e008be4eba0922d99a5304fb /src/gallium/auxiliary/draw/draw_llvm.h | |
parent | 2e46a1dcb33618f2873ebaaeb3ffe238f11a31a3 (diff) | |
download | external_mesa3d-05487ef88ded5fea0b1de7bc08d44846648d1ce2.zip external_mesa3d-05487ef88ded5fea0b1de7bc08d44846648d1ce2.tar.gz external_mesa3d-05487ef88ded5fea0b1de7bc08d44846648d1ce2.tar.bz2 |
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>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.h')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h index 0675e3b..1d238a2 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.h +++ b/src/gallium/auxiliary/draw/draw_llvm.h @@ -301,12 +301,13 @@ struct draw_llvm_variant_key unsigned bypass_viewport:1; unsigned need_edgeflags:1; unsigned has_gs:1; + unsigned num_outputs:8; /* * it is important there are no holes in this struct * (and all padding gets zeroed). */ unsigned ucp_enable:PIPE_MAX_CLIP_PLANES; - unsigned pad1:32-PIPE_MAX_CLIP_PLANES; + unsigned pad1:24-PIPE_MAX_CLIP_PLANES; /* Variable number of vertex elements: */ @@ -321,6 +322,7 @@ struct draw_gs_llvm_variant_key { unsigned nr_samplers:8; unsigned nr_sampler_views:8; + unsigned num_outputs:8; struct draw_sampler_static_state samplers[1]; }; |