sp_quad_coverage.c File Reference

Include dependency graph for sp_quad_coverage.c:

Go to the source code of this file.

Functions

static void coverage_quad (struct quad_stage *qs, struct quad_header *quad)
 Apply AA coverage to quad alpha valus.
static void coverage_begin (struct quad_stage *qs)
static void coverage_destroy (struct quad_stage *qs)
struct quad_stagesp_quad_coverage_stage (struct softpipe_context *softpipe)


Function Documentation

static void coverage_begin ( struct quad_stage qs  )  [static]

Definition at line 71 of file sp_quad_coverage.c.

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

00072 {
00073    qs->next->begin(qs->next);
00074 }

static void coverage_destroy ( struct quad_stage qs  )  [static]

Definition at line 77 of file sp_quad_coverage.c.

References FREE.

00078 {
00079    FREE( qs );
00080 }

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

Apply AA coverage to quad alpha valus.

Author:
Brian Paul Multiply quad's alpha values by the fragment coverage.

Definition at line 46 of file sp_quad_coverage.c.

References assert, quad_header_output::color, quad_header_input::coverage, softpipe_context::framebuffer, quad_header::input, pipe_rasterizer_state::line_smooth, quad_stage::next, pipe_framebuffer_state::num_cbufs, quad_header::output, pipe_rasterizer_state::point_smooth, pipe_rasterizer_state::poly_smooth, quad_header_input::prim, PRIM_LINE, PRIM_POINT, PRIM_TRI, QUAD_SIZE, softpipe_context::rasterizer, quad_stage::run, and quad_stage::softpipe.

00047 {
00048    struct softpipe_context *softpipe = qs->softpipe;
00049 
00050    if ((softpipe->rasterizer->poly_smooth && quad->input.prim == PRIM_TRI) ||
00051        (softpipe->rasterizer->line_smooth && quad->input.prim == PRIM_LINE) ||
00052        (softpipe->rasterizer->point_smooth && quad->input.prim == PRIM_POINT)) {
00053       uint cbuf;
00054 
00055       /* loop over colorbuffer outputs */
00056       for (cbuf = 0; cbuf < softpipe->framebuffer.num_cbufs; cbuf++) {
00057          float (*quadColor)[4] = quad->output.color[cbuf];
00058          unsigned j;
00059          for (j = 0; j < QUAD_SIZE; j++) {
00060             assert(quad->input.coverage[j] >= 0.0);
00061             assert(quad->input.coverage[j] <= 1.0);
00062          quadColor[3][j] *= quad->input.coverage[j];
00063          }
00064       }
00065    }
00066 
00067    qs->next->run(qs->next, quad);
00068 }

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

Definition at line 83 of file sp_quad_coverage.c.

References quad_stage::begin, CALLOC_STRUCT, coverage_begin(), coverage_destroy(), coverage_quad(), quad_stage::destroy, quad_stage::run, and quad_stage::softpipe.

00084 {
00085    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
00086 
00087    stage->softpipe = softpipe;
00088    stage->begin = coverage_begin;
00089    stage->run = coverage_quad;
00090    stage->destroy = coverage_destroy;
00091 
00092    return stage;
00093 }


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