diff options
author | Zack Rusin <[email protected]> | 2010-06-09 11:13:34 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-06-09 11:13:34 -0400 |
commit | d4ef0f6c67aefe06d8dd647acf8d9005df39a709 (patch) | |
tree | 00ac70cad31762c1dbc4a99abcfa985e6fe77946 /src/gallium/auxiliary/draw/draw_pt.c | |
parent | cec9955acc03d292c67815371415edc3fc3fc4b0 (diff) |
geometry shaders: make gs work with changable primitives and variable number of vertices
lots and lots of fixes for geometry shaders. in particular now we work when the gs
emits a different primitive than the one the pipeline was started with and also
we work when gs emits more vertices than would fit in the original buffer.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index c7eb1567837..02c97fec817 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -31,6 +31,7 @@ */ #include "draw/draw_context.h" +#include "draw/draw_gs.h" #include "draw/draw_private.h" #include "draw/draw_pt.h" #include "tgsi/tgsi_dump.h" @@ -68,35 +69,39 @@ draw_pt_arrays(struct draw_context *draw, struct draw_pt_front_end *frontend = NULL; struct draw_pt_middle_end *middle = NULL; unsigned opt = 0; + unsigned out_prim = prim; /* Sanitize primitive length: */ { unsigned first, incr; draw_pt_split_prim(prim, &first, &incr); - count = trim(count, first, incr); + count = trim(count, first, incr); if (count < first) return TRUE; } + if (draw->gs.geometry_shader) { + out_prim = draw->gs.geometry_shader->output_primitive; + } if (!draw->force_passthrough) { if (!draw->render) { opt |= PT_PIPELINE; } - + if (draw_need_pipeline(draw, draw->rasterizer, - prim)) { + out_prim)) { opt |= PT_PIPELINE; } if (!draw->bypass_clipping && !draw->pt.test_fse) { opt |= PT_CLIPTEST; } - + opt |= PT_SHADE; } - + if (draw->pt.middle.llvm && !draw->gs.geometry_shader) { middle = draw->pt.middle.llvm; } else { @@ -117,9 +122,9 @@ draw_pt_arrays(struct draw_context *draw, frontend = draw->pt.front.varray; } - frontend->prepare( frontend, prim, middle, opt ); + frontend->prepare( frontend, prim, out_prim, middle, opt ); - frontend->run(frontend, + frontend->run(frontend, draw_pt_elt_func(draw), draw_pt_elt_ptr(draw, start), draw->pt.user.eltBias, |