diff options
author | Brian <[email protected]> | 2007-07-09 16:14:26 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-09 16:14:26 -0600 |
commit | 279ffe3f163fd6a5e7bfa108db14c81acbb06ece (patch) | |
tree | 109bb794f7d057a51d748350ca616e920f2a67da /src/mesa/pipe/draw/draw_flatshade.c | |
parent | 9fbdf500788e78d63247a17226a75f7a079ae315 (diff) |
New 'draw' module for primitive drawing (clipping, culling, etc).
Diffstat (limited to 'src/mesa/pipe/draw/draw_flatshade.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_flatshade.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/mesa/pipe/draw/draw_flatshade.c b/src/mesa/pipe/draw/draw_flatshade.c index 3a7d9de4667..004b5bdc96e 100644 --- a/src/mesa/pipe/draw/draw_flatshade.c +++ b/src/mesa/pipe/draw/draw_flatshade.c @@ -27,12 +27,9 @@ /* Authors: Keith Whitwell <[email protected]> */ -#include "imports.h" -#include "vf/vf.h" - -#include "sp_context.h" -#include "sp_prim.h" +#include "main/imports.h" +#include "draw_private.h" struct flatshade_stage { @@ -67,11 +64,12 @@ static INLINE void copy_attr( GLuint attr, } } -static void copy_colors( struct prim_stage *stage, - struct vertex_header *dst, - const struct vertex_header *src ) + +static INLINE void copy_colors( struct prim_stage *stage, + struct vertex_header *dst, + const struct vertex_header *src ) { - struct flatshade_stage *flatshade = flatshade_stage(stage); + const struct flatshade_stage *flatshade = flatshade_stage(stage); const GLuint *lookup = flatshade->lookup; copy_attr( lookup[VF_ATTRIB_COLOR0], dst, src ); @@ -81,8 +79,8 @@ static void copy_colors( struct prim_stage *stage, } - -/* Flatshade tri. Required for clipping and when unfilled tris are +/** + * Flatshade tri. Required for clipping and when unfilled tris are * active, otherwise handled by hardware. */ static void flatshade_tri( struct prim_stage *stage, @@ -102,7 +100,8 @@ static void flatshade_tri( struct prim_stage *stage, } -/* Flatshade line. Required for clipping. +/** + * Flatshade line. Required for clipping. */ static void flatshade_line( struct prim_stage *stage, struct prim_header *header ) @@ -124,18 +123,20 @@ static void flatshade_point( struct prim_stage *stage, stage->next->point( stage->next, header ); } + static void flatshade_end( struct prim_stage *stage ) { stage->next->end( stage->next ); } -struct prim_stage *prim_flatshade( struct softpipe_context *softpipe ) + +struct prim_stage *prim_flatshade( struct draw_context *draw ) { struct flatshade_stage *flatshade = CALLOC_STRUCT(flatshade_stage); prim_alloc_tmps( &flatshade->stage, 2 ); - flatshade->stage.softpipe = softpipe; + flatshade->stage.draw = draw; flatshade->stage.next = NULL; flatshade->stage.begin = flatshade_begin; flatshade->stage.point = flatshade_point; @@ -143,7 +144,7 @@ struct prim_stage *prim_flatshade( struct softpipe_context *softpipe ) flatshade->stage.tri = flatshade_tri; flatshade->stage.end = flatshade_end; - flatshade->lookup = softpipe->vf_attr_to_slot; + flatshade->lookup = draw->vf_attr_to_slot; return &flatshade->stage; } |