summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_prim_setup.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-09-25 13:20:53 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-09-25 13:23:20 +0100
commita37e0daeb97bb36ba10038b12a909e22e08b52c4 (patch)
tree6c8a10ceb9a7764a63db627f0602f552709631d2 /src/mesa/pipe/softpipe/sp_prim_setup.h
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/softpipe/sp_prim_setup.h')
-rw-r--r--src/mesa/pipe/softpipe/sp_prim_setup.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.h b/src/mesa/pipe/softpipe/sp_prim_setup.h
index dece42fe45..598394f73e 100644
--- a/src/mesa/pipe/softpipe/sp_prim_setup.h
+++ b/src/mesa/pipe/softpipe/sp_prim_setup.h
@@ -44,5 +44,39 @@ struct softpipe_context;
extern struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe );
+/* A special stage to gather the stream of triangles, lines, points
+ * together and reconstruct vertex buffers for hardware upload.
+ *
+ * First attempt, work in progress.
+ *
+ * TODO:
+ * - separate out vertex buffer building and primitive emit, ie >1 draw per vb.
+ * - tell vbuf stage how to build hw vertices directly
+ * - pass vbuf stage a buffer pointer for direct emit to agp/vram.
+ */
+typedef void (*vbuf_draw_func)( struct pipe_context *pipe,
+ unsigned prim,
+ const ushort *elements,
+ unsigned nr_elements,
+ const void *vertex_buffer,
+ unsigned nr_vertices );
+
+
+extern struct draw_stage *sp_draw_vbuf_stage( struct draw_context *draw_context,
+ struct pipe_context *pipe,
+ vbuf_draw_func draw );
+
+
+
+/* Test harness
+ */
+void sp_vbuf_setup_draw( struct pipe_context *pipe,
+ unsigned prim,
+ const ushort *elements,
+ unsigned nr_elements,
+ const void *vertex_buffer,
+ unsigned nr_vertices );
+
+
#endif /* SP_PRIM_SETUP_H */