sp_quad_occlusion.c File Reference

Include dependency graph for sp_quad_occlusion.c:

Go to the source code of this file.

Functions

static unsigned count_bits (unsigned val)
 Quad occlusion counter stage.
static void occlusion_count_quad (struct quad_stage *qs, struct quad_header *quad)
static void occlusion_begin (struct quad_stage *qs)
static void occlusion_destroy (struct quad_stage *qs)
struct quad_stagesp_quad_occlusion_stage (struct softpipe_context *softpipe)


Function Documentation

static unsigned count_bits ( unsigned  val  )  [static]

Quad occlusion counter stage.

Author:
Brian Paul

Definition at line 42 of file sp_quad_occlusion.c.

00043 {
00044    unsigned i;
00045 
00046    for (i = 0; val ; val >>= 1)
00047       i += (val & 1);
00048 
00049    return i;
00050 }

static void occlusion_begin ( struct quad_stage qs  )  [static]

Definition at line 63 of file sp_quad_occlusion.c.

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

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

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

Definition at line 53 of file sp_quad_occlusion.c.

References count_bits(), quad_header::inout, quad_header_inout::mask, quad_stage::next, softpipe_context::occlusion_count, quad_stage::run, and quad_stage::softpipe.

00054 {
00055    struct softpipe_context *softpipe = qs->softpipe;
00056 
00057    softpipe->occlusion_count += count_bits(quad->inout.mask);
00058 
00059    qs->next->run(qs->next, quad);
00060 }

static void occlusion_destroy ( struct quad_stage qs  )  [static]

Definition at line 69 of file sp_quad_occlusion.c.

References FREE.

00070 {
00071    FREE( qs );
00072 }

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

Definition at line 75 of file sp_quad_occlusion.c.

References quad_stage::begin, CALLOC_STRUCT, quad_stage::destroy, occlusion_begin(), occlusion_count_quad(), occlusion_destroy(), quad_stage::run, and quad_stage::softpipe.

00076 {
00077    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
00078 
00079    stage->softpipe = softpipe;
00080    stage->begin = occlusion_begin;
00081    stage->run = occlusion_count_quad;
00082    stage->destroy = occlusion_destroy;
00083 
00084    return stage;
00085 }


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