sp_prim_setup.c File Reference

Include dependency graph for sp_prim_setup.c:

Go to the source code of this file.

Data Structures

struct  setup_stage
 Triangle setup info (derived from draw_stage). More...

Typedefs

typedef const float(* cptrf4 )[4]

Functions

static struct setup_stagesetup_stage (struct draw_stage *stage)
 Basically a cast wrapper.
static void do_tri (struct draw_stage *stage, struct prim_header *prim)
static void do_line (struct draw_stage *stage, struct prim_header *prim)
static void do_point (struct draw_stage *stage, struct prim_header *prim)
static void setup_begin (struct draw_stage *stage)
static void setup_first_point (struct draw_stage *stage, struct prim_header *header)
static void setup_first_line (struct draw_stage *stage, struct prim_header *header)
static void setup_first_tri (struct draw_stage *stage, struct prim_header *header)
static void setup_flush (struct draw_stage *stage, unsigned flags)
static void reset_stipple_counter (struct draw_stage *stage)
static void render_destroy (struct draw_stage *stage)
struct draw_stagesp_draw_render_stage (struct softpipe_context *softpipe)
 Create a new primitive setup/render stage.
struct setup_contextsp_draw_setup_context (struct draw_stage *stage)
void sp_draw_flush (struct draw_stage *stage)


Typedef Documentation

typedef const float(* cptrf4)[4]

Definition at line 67 of file sp_prim_setup.c.


Function Documentation

static void do_line ( struct draw_stage stage,
struct prim_header prim 
) [static]

Definition at line 81 of file sp_prim_setup.c.

References vertex_header::data, setup_stage::setup, setup, setup_line(), setup_stage(), and prim_header::v.

00082 {
00083    struct setup_stage *setup = setup_stage( stage );
00084 
00085    setup_line( setup->setup,
00086                (cptrf4)prim->v[0]->data,
00087                (cptrf4)prim->v[1]->data );
00088 }

static void do_point ( struct draw_stage stage,
struct prim_header prim 
) [static]

Definition at line 91 of file sp_prim_setup.c.

References vertex_header::data, setup_stage::setup, setup, setup_point(), setup_stage(), and prim_header::v.

00092 {
00093    struct setup_stage *setup = setup_stage( stage );
00094 
00095    setup_point( setup->setup,
00096                 (cptrf4)prim->v[0]->data );
00097 }

static void do_tri ( struct draw_stage stage,
struct prim_header prim 
) [static]

Definition at line 70 of file sp_prim_setup.c.

References vertex_header::data, setup_stage::setup, setup, setup_stage(), setup_tri(), and prim_header::v.

00071 {
00072    struct setup_stage *setup = setup_stage( stage );
00073    
00074    setup_tri( setup->setup,
00075               (cptrf4)prim->v[0]->data,
00076               (cptrf4)prim->v[1]->data,
00077               (cptrf4)prim->v[2]->data );
00078 }

static void render_destroy ( struct draw_stage stage  )  [static]

Definition at line 152 of file sp_prim_setup.c.

References FREE, setup_stage::setup, setup_destroy_context(), and setup_stage().

00153 {
00154    struct setup_stage *ssetup = setup_stage(stage);
00155    setup_destroy_context(ssetup->setup);
00156    FREE( stage );
00157 }

static void reset_stipple_counter ( struct draw_stage stage  )  [static]

Definition at line 147 of file sp_prim_setup.c.

00148 {
00149 }

static void setup_begin ( struct draw_stage stage  )  [static]

Definition at line 102 of file sp_prim_setup.c.

References do_line(), do_point(), do_tri(), draw_stage::line, draw_stage::point, setup_stage::setup, setup, setup_prepare(), setup_stage(), and draw_stage::tri.

00103 {
00104    struct setup_stage *setup = setup_stage(stage);
00105 
00106    setup_prepare( setup->setup );
00107 
00108    stage->point = do_point;
00109    stage->line = do_line;
00110    stage->tri = do_tri;
00111 }

static void setup_first_line ( struct draw_stage stage,
struct prim_header header 
) [static]

Definition at line 121 of file sp_prim_setup.c.

References draw_stage::line, and setup_begin().

00123 {
00124    setup_begin(stage);
00125    stage->line( stage, header );
00126 }

static void setup_first_point ( struct draw_stage stage,
struct prim_header header 
) [static]

Definition at line 114 of file sp_prim_setup.c.

References draw_stage::point, and setup_begin().

00116 {
00117    setup_begin(stage);
00118    stage->point( stage, header );
00119 }

static void setup_first_tri ( struct draw_stage stage,
struct prim_header header 
) [static]

Definition at line 129 of file sp_prim_setup.c.

References setup_begin(), and draw_stage::tri.

00131 {
00132    setup_begin(stage);
00133    stage->tri( stage, header );
00134 }

static void setup_flush ( struct draw_stage stage,
unsigned  flags 
) [static]

Definition at line 138 of file sp_prim_setup.c.

References draw_stage::line, draw_stage::point, setup_first_line(), setup_first_point(), setup_first_tri(), and draw_stage::tri.

00140 {
00141    stage->point = setup_first_point;
00142    stage->line = setup_first_line;
00143    stage->tri = setup_first_tri;
00144 }

static struct setup_stage* setup_stage ( struct draw_stage stage  )  [static, read]

Basically a cast wrapper.

Definition at line 61 of file sp_prim_setup.c.

00062 {
00063    return (struct setup_stage *)stage;
00064 }

void sp_draw_flush ( struct draw_stage stage  ) 

Definition at line 187 of file sp_prim_setup.c.

References draw_stage::flush.

00188 {
00189    stage->flush( stage, 0 );
00190 }

struct draw_stage* sp_draw_render_stage ( struct softpipe_context softpipe  )  [read]

Create a new primitive setup/render stage.

Definition at line 163 of file sp_prim_setup.c.

References CALLOC_STRUCT, draw_stage::destroy, softpipe_context::draw, draw_stage::draw, draw_stage::flush, draw_stage::line, draw_stage::point, render_destroy(), reset_stipple_counter(), draw_stage::reset_stipple_counter, setup_stage::setup, setup_create_context(), setup_first_line(), setup_first_point(), setup_first_tri(), setup_flush(), setup_stage::stage, and draw_stage::tri.

00164 {
00165    struct setup_stage *sstage = CALLOC_STRUCT(setup_stage);
00166 
00167    sstage->setup = setup_create_context(softpipe);
00168    sstage->stage.draw = softpipe->draw;
00169    sstage->stage.point = setup_first_point;
00170    sstage->stage.line = setup_first_line;
00171    sstage->stage.tri = setup_first_tri;
00172    sstage->stage.flush = setup_flush;
00173    sstage->stage.reset_stipple_counter = reset_stipple_counter;
00174    sstage->stage.destroy = render_destroy;
00175 
00176    return (struct draw_stage *)sstage;
00177 }

struct setup_context* sp_draw_setup_context ( struct draw_stage stage  )  [read]

Definition at line 180 of file sp_prim_setup.c.

References setup_stage::setup, and setup_stage().

00181 {
00182    struct setup_stage *ssetup = setup_stage(stage);
00183    return ssetup->setup;
00184 }


Generated on Tue Sep 29 06:25:40 2009 for Gallium3D by  doxygen 1.5.4