From 05487ef88ded5fea0b1de7bc08d44846648d1ce2 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 2 Aug 2013 01:39:35 -0400 Subject: 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 Reviewed-by: Roland Scheidegger Reviewed-by: Jose Fonseca Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_llvm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/draw/draw_llvm.h') 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]; }; -- cgit v1.1