summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw/draw_prim.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-09-25 13:20:53 +0100
committerKeith Whitwell <[email protected]>2007-09-25 13:23:20 +0100
commita37e0daeb97bb36ba10038b12a909e22e08b52c4 (patch)
tree6c8a10ceb9a7764a63db627f0602f552709631d2 /src/mesa/pipe/draw/draw_prim.c
parent45b37dc078130b64e110d1a965960c60c56f0e60 (diff)
First attempt at building vertex buffers post-clip.
Build a buffer of contigous vertices and indices at the backend of our software transformation/clipping path. This will become the mechanism for emitting buffers of vertices to rasterization hardware. This is similar to but not the same as the post-transform vertex cache. In particular, these vertices are subject to clipping, culling, poly offset, etc. The vertices emitted will all be used by hardware. TODOs include the actual transformation to hardware vertex formats, moving this out of softpipe to somewhere more useful and allowing >1 primitive to share the generated VB.
Diffstat (limited to 'src/mesa/pipe/draw/draw_prim.c')
-rw-r--r--src/mesa/pipe/draw/draw_prim.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/pipe/draw/draw_prim.c b/src/mesa/pipe/draw/draw_prim.c
index e82e48b90b8..be2f987b9a0 100644
--- a/src/mesa/pipe/draw/draw_prim.c
+++ b/src/mesa/pipe/draw/draw_prim.c
@@ -106,9 +106,12 @@ void draw_flush( struct draw_context *draw )
static struct prim_header *get_queued_prim( struct draw_context *draw,
unsigned nr_verts )
{
- if (draw->pq.queue_nr + 1 >= PRIM_QUEUE_LENGTH ||
- !draw_vertex_cache_check_space( draw, nr_verts ))
- {
+ if (draw->pq.queue_nr + 1 >= PRIM_QUEUE_LENGTH) {
+// fprintf(stderr, "p");
+ draw_flush( draw );
+ }
+ else if (!draw_vertex_cache_check_space( draw, nr_verts )) {
+// fprintf(stderr, "v");
draw_flush( draw );
}