From a37e0daeb97bb36ba10038b12a909e22e08b52c4 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 25 Sep 2007 13:20:53 +0100 Subject: 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. --- src/mesa/pipe/softpipe/sp_context.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa/pipe/softpipe/sp_context.c') diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c index a6ab45314cf..e415966dae1 100644 --- a/src/mesa/pipe/softpipe/sp_context.c +++ b/src/mesa/pipe/softpipe/sp_context.c @@ -334,7 +334,19 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys, */ softpipe->draw = draw_create(); assert(softpipe->draw); - draw_set_rasterize_stage(softpipe->draw, sp_draw_render_stage(softpipe)); + softpipe->setup = sp_draw_render_stage(softpipe); + + if (getenv("SP_VBUF")) { + softpipe->vbuf = sp_draw_vbuf_stage(softpipe->draw, + &softpipe->pipe, + sp_vbuf_setup_draw); + + draw_set_rasterize_stage(softpipe->draw, softpipe->vbuf); + } + else { + draw_set_rasterize_stage(softpipe->draw, softpipe->setup); + } + sp_init_region_functions(softpipe); sp_init_surface_functions(softpipe); -- cgit v1.2.3