diff options
author | Zack Rusin <zack@kde.org> | 2010-06-09 11:13:34 -0400 |
---|---|---|
committer | Zack Rusin <zack@kde.org> | 2010-06-09 11:13:34 -0400 |
commit | d4ef0f6c67aefe06d8dd647acf8d9005df39a709 (patch) | |
tree | 00ac70cad31762c1dbc4a99abcfa985e6fe77946 /src/gallium/auxiliary/draw/draw_gs.h | |
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_gs.h')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_gs.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.h b/src/gallium/auxiliary/draw/draw_gs.h index d8eb210343..6a9800c43f 100644 --- a/src/gallium/auxiliary/draw/draw_gs.h +++ b/src/gallium/auxiliary/draw/draw_gs.h @@ -54,18 +54,26 @@ struct draw_geometry_shader { unsigned input_primitive; unsigned output_primitive; + unsigned emitted_vertices; + unsigned emitted_primitives; + /* Extracted from shader: */ const float (*immediates)[4]; }; -void draw_geometry_shader_run(struct draw_geometry_shader *shader, - const float (*input)[4], - float (*output)[4], - const void *constants[PIPE_MAX_CONSTANT_BUFFERS], - unsigned count, - unsigned input_stride, - unsigned output_stride); +/* + * Returns the number of vertices emitted. + * The vertex shader can emit any number of vertices as long as it's + * smaller than the GS_MAX_OUTPUT_VERTICES shader property. + */ +int draw_geometry_shader_run(struct draw_geometry_shader *shader, + const float (*input)[4], + float (*output)[4], + const void *constants[PIPE_MAX_CONSTANT_BUFFERS], + unsigned count, + unsigned input_stride, + unsigned output_stride); void draw_geometry_shader_prepare(struct draw_geometry_shader *shader, struct draw_context *draw); |