diff options
author | Zack Rusin <[email protected]> | 2013-08-02 01:39:35 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-08-02 20:11:18 -0400 |
commit | 05487ef88ded5fea0b1de7bc08d44846648d1ce2 (patch) | |
tree | 5a97df0f2d48c4c6e008be4eba0922d99a5304fb /src/gallium/auxiliary/draw/draw_pipe.h | |
parent | 2e46a1dcb33618f2873ebaaeb3ffe238f11a31a3 (diff) |
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 <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe.h')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe.h b/src/gallium/auxiliary/draw/draw_pipe.h index 479250729ff..547e4bf4d05 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.h +++ b/src/gallium/auxiliary/draw/draw_pipe.h @@ -35,6 +35,7 @@ #include "pipe/p_compiler.h" #include "draw_private.h" /* for sizeof(vertex_header) */ +#include "draw_context.h" /** @@ -117,7 +118,7 @@ dup_vert( struct draw_stage *stage, { struct vertex_header *tmp = stage->tmp[idx]; const uint vsize = sizeof(struct vertex_header) - + stage->draw->vs.num_vs_outputs * 4 * sizeof(float); + + draw_num_shader_outputs(stage->draw) * 4 * sizeof(float); memcpy(tmp, vert, vsize); tmp->vertex_id = UNDEFINED_VERTEX_ID; return tmp; |