sp_quad_earlyz.c File Reference

Include dependency graph for sp_quad_earlyz.c:

Go to the source code of this file.

Functions

static void earlyz_quad (struct quad_stage *qs, struct quad_header *quad)
 Quad early-z testing.
static void earlyz_begin (struct quad_stage *qs)
static void earlyz_destroy (struct quad_stage *qs)
struct quad_stagesp_quad_earlyz_stage (struct softpipe_context *softpipe)


Function Documentation

static void earlyz_begin ( struct quad_stage qs  )  [static]

Definition at line 63 of file sp_quad_earlyz.c.

References quad_stage::begin, and quad_stage::next.

00065 {
00066    qs->next->begin( qs->next );
00067 }

static void earlyz_destroy ( struct quad_stage qs  )  [static]

Definition at line 70 of file sp_quad_earlyz.c.

References FREE.

00072 {
00073    FREE( qs );
00074 }

static void earlyz_quad ( struct quad_stage qs,
struct quad_header quad 
) [static]

Quad early-z testing.

All this stage does is compute the quad's Z values (which is normally done by the shading stage). The next stage will do the actual depth test.

Definition at line 44 of file sp_quad_earlyz.c.

References tgsi_interp_coef::a0, tgsi_interp_coef::dadx, tgsi_interp_coef::dady, quad_header_output::depth, quad_header::input, quad_stage::next, quad_header::output, quad_header::posCoef, quad_stage::run, quad_header_input::x0, and quad_header_input::y0.

00047 {
00048    const float fx = (float) quad->input.x0;
00049    const float fy = (float) quad->input.y0;
00050    const float dzdx = quad->posCoef->dadx[2];
00051    const float dzdy = quad->posCoef->dady[2];
00052    const float z0 = quad->posCoef->a0[2] + dzdx * fx + dzdy * fy;
00053 
00054    quad->output.depth[0] = z0;
00055    quad->output.depth[1] = z0 + dzdx;
00056    quad->output.depth[2] = z0 + dzdy;
00057    quad->output.depth[3] = z0 + dzdx + dzdy;
00058 
00059    qs->next->run( qs->next, quad );
00060 }

struct quad_stage* sp_quad_earlyz_stage ( struct softpipe_context softpipe  )  [read]

Definition at line 77 of file sp_quad_earlyz.c.

References quad_stage::begin, CALLOC_STRUCT, quad_stage::destroy, earlyz_begin(), earlyz_destroy(), earlyz_quad(), quad_stage::run, and quad_stage::softpipe.

00079 {
00080    struct quad_stage *stage = CALLOC_STRUCT( quad_stage );
00081 
00082    stage->softpipe = softpipe;
00083    stage->begin = earlyz_begin;
00084    stage->run = earlyz_quad;
00085    stage->destroy = earlyz_destroy;
00086 
00087    return stage;
00088 }


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