From cd3643698eafa0869a8317b002e5b066de0172e7 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 Jan 2008 12:48:41 -0700 Subject: gallium: overhaul usage of vertex_info in draw module. Remove all dependencies on vertex_info, except for draw_vbuf. Drawing stages now strictly operate on post-transformed vertices and don't know anything about hw vertices. Use vertex program output info for two-side/flat/etc stages. Temporarily disable vbuf module in softpipe driver. --- src/mesa/pipe/softpipe/sp_context.c | 2 +- src/mesa/pipe/softpipe/sp_context.h | 2 ++ src/mesa/pipe/softpipe/sp_prim_setup.c | 2 +- src/mesa/pipe/softpipe/sp_prim_vbuf.c | 5 ++++- src/mesa/pipe/softpipe/sp_state_derived.c | 7 +++++-- 5 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/mesa/pipe/softpipe') diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c index 68c18e2d05..6dccedbdcb 100644 --- a/src/mesa/pipe/softpipe/sp_context.c +++ b/src/mesa/pipe/softpipe/sp_context.c @@ -328,7 +328,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys, assert(softpipe->draw); softpipe->setup = sp_draw_render_stage(softpipe); - if (GETENV( "SP_VBUF" ) != NULL) { + if (0 && GETENV( "SP_VBUF" ) != NULL) { softpipe->vbuf = sp_draw_vbuf_stage(softpipe->draw, &softpipe->pipe, sp_vbuf_render); diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h index 3537f86a61..4ce0410075 100644 --- a/src/mesa/pipe/softpipe/sp_context.h +++ b/src/mesa/pipe/softpipe/sp_context.h @@ -40,6 +40,7 @@ struct softpipe_winsys; +struct softpipe_vbuf_render; struct draw_context; struct draw_stage; struct softpipe_tile_cache; @@ -125,6 +126,7 @@ struct softpipe_context { struct draw_context *draw; struct draw_stage *setup; struct draw_stage *vbuf; + struct softpipe_vbuf_render *vbuf_render; uint current_cbuf; /**< current color buffer being written to */ diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c index cdc385e4db..533a2fbd4d 100644 --- a/src/mesa/pipe/softpipe/sp_prim_setup.c +++ b/src/mesa/pipe/softpipe/sp_prim_setup.c @@ -1278,7 +1278,7 @@ void sp_vbuf_render( struct pipe_context *pipe, struct softpipe_context *softpipe = softpipe_context( pipe ); struct setup_stage *setup = setup_stage( softpipe->setup ); struct prim_header prim; - unsigned vertex_size = setup->stage.draw->vertex_info.size * sizeof(float); + unsigned vertex_size = softpipe->vertex_info.size * sizeof(float); unsigned i, j; prim.det = 0; diff --git a/src/mesa/pipe/softpipe/sp_prim_vbuf.c b/src/mesa/pipe/softpipe/sp_prim_vbuf.c index 055cb19f9a..1d58e375a9 100644 --- a/src/mesa/pipe/softpipe/sp_prim_vbuf.c +++ b/src/mesa/pipe/softpipe/sp_prim_vbuf.c @@ -263,8 +263,11 @@ static void vbuf_flush_elements( struct draw_stage *stage ) static void vbuf_begin( struct draw_stage *stage ) { struct vbuf_stage *vbuf = vbuf_stage(stage); + struct softpipe_context *softpipe = softpipe_context(vbuf->pipe); - vbuf->vertex_size = vbuf->draw_context->vertex_info.size * sizeof(float); + //vbuf->vertex_size = vbuf->draw_context->vertex_info.size * sizeof(float); + + vbuf->vertex_size = softpipe->vertex_info.size * sizeof(float); } diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c index 0f1410e5de..64e86a0d86 100644 --- a/src/mesa/pipe/softpipe/sp_state_derived.c +++ b/src/mesa/pipe/softpipe/sp_state_derived.c @@ -122,6 +122,8 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) } } + draw_compute_vertex_size(vinfo); + softpipe->nr_frag_attrs = fs->num_inputs; /* We want these after all other attribs since they won't get passed @@ -146,10 +148,11 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) if (1/*vinfo->attr_mask != softpipe->attr_mask*/) { /*softpipe->attr_mask = vinfo->attr_mask;*/ - draw_set_vertex_info( softpipe->draw, vinfo); + /*draw_set_vertex_info( softpipe->draw, vinfo);*/ - draw_set_twoside_attributes(softpipe->draw, + /*draw_set_twoside_attributes(softpipe->draw, front0, back0, front1, back1); + */ } } -- cgit v1.2.3