summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_validate.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-08-02 02:25:42 -0400
committerZack Rusin <[email protected]>2013-08-03 00:38:58 -0400
commitc9c211fae194ac6bf50e0c579c8670590690dd6e (patch)
tree224e6f6d9fc6bc5979c5e9bc3bdd056a33458ed5 /src/gallium/auxiliary/draw/draw_pipe_validate.c
parent8a94d15fbaf46caf1a25034acbbdbed33f46f911 (diff)
draw: implement proper primitive assembler as a pipeline stage
we used to have a face primitive assembler that we ran after if the gs was missing but we had adjacency primitives in the pipeline, lets convert it to a pipeline stage, which allows us to use it to inject outputs (primitive id) into the vertices. it's also a lot cleaner because the decomposition is already handled for us. 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_validate.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_validate.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c
index 2dbb95c82ab..9b2f5845e09 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_validate.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c
@@ -76,6 +76,14 @@ draw_need_pipeline(const struct draw_context *draw,
prim );
}
+ /* If we need to decompose the primitives or inject
+ * primitive id information then we have to run
+ * the pipeline.
+ */
+ if (draw_ia_stage_required(draw, prim)) {
+ return TRUE;
+ }
+
/* Don't have to worry about triangles turning into lines/points
* and triggering the pipeline, because we have to trigger the
* pipeline *anyway* if unfilled mode is active.
@@ -280,7 +288,12 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
next = draw->pipeline.clip;
}
-
+ /* Input assembler */
+ if (draw_ia_stage_required(draw, draw->pt.prim)) {
+ draw->pipeline.ia->next = next;
+ next = draw->pipeline.ia;
+ }
+
draw->pipeline.first = next;
if (0) {