diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-07-13 11:15:10 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-07-13 11:15:10 -0600 |
commit | 80362a90d8ad1fca14d7276169fc962f953d936d (patch) | |
tree | c798bf18631edb8b57979ea59d58dca414acab24 /src/mesa/pipe/softpipe/sp_quad_stipple.c | |
parent | 46bba80a54afbcabc0f064433cc2194473661c30 (diff) |
Add 'prim' field to quad so that stipple and aa coverage stages can do the right thing.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_quad_stipple.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_stipple.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_stipple.c b/src/mesa/pipe/softpipe/sp_quad_stipple.c index 928771e454..532ffc61b0 100644 --- a/src/mesa/pipe/softpipe/sp_quad_stipple.c +++ b/src/mesa/pipe/softpipe/sp_quad_stipple.c @@ -13,44 +13,45 @@ /** * Apply polygon stipple to quads produced by triangle rasterization - * XXX we need to skip this for lines and points!!! */ static void stipple_quad(struct quad_stage *qs, struct quad_header *quad) { - struct softpipe_context *softpipe = qs->softpipe; - const GLint col0 = quad->x0 % 32; - const GLint row0 = quad->y0 % 32; - const GLuint stipple0 = softpipe->poly_stipple.stipple[row0]; - const GLuint stipple1 = softpipe->poly_stipple.stipple[row0 + 1]; + if (quad->prim == PRIM_TRI) { + struct softpipe_context *softpipe = qs->softpipe; + const GLint col0 = quad->x0 % 32; + const GLint row0 = quad->y0 % 32; + const GLuint stipple0 = softpipe->poly_stipple.stipple[row0]; + const GLuint stipple1 = softpipe->poly_stipple.stipple[row0 + 1]; - /* XXX this should be acheivable without conditionals */ + /* XXX this should be acheivable without conditionals */ #if 1 - GLbitfield mask = 0x0; + GLbitfield mask = 0x0; - if ((1 << col0) & stipple0) - mask |= MASK_BOTTOM_LEFT; + if ((1 << col0) & stipple0) + mask |= MASK_BOTTOM_LEFT; - if ((2 << col0) & stipple0) /* note: col0 <= 30 */ - mask |= MASK_BOTTOM_RIGHT; + if ((2 << col0) & stipple0) /* note: col0 <= 30 */ + mask |= MASK_BOTTOM_RIGHT; - if ((1 << col0) & stipple1) - mask |= MASK_TOP_LEFT; + if ((1 << col0) & stipple1) + mask |= MASK_TOP_LEFT; - if ((2 << col0) & stipple1) - mask |= MASK_TOP_RIGHT; + if ((2 << col0) & stipple1) + mask |= MASK_TOP_RIGHT; - quad->mask &= mask; + quad->mask &= mask; #else - /* XXX there may be a better way to lay out the stored stipple - * values to further simplify this computation. - */ - quad->mask &= (((stipple0 >> col0) & 0x3) | - (((stipple1 >> col0) & 0x3) << 2)); + /* XXX there may be a better way to lay out the stored stipple + * values to further simplify this computation. + */ + quad->mask &= (((stipple0 >> col0) & 0x3) | + (((stipple1 >> col0) & 0x3) << 2)); #endif - if (quad->mask) - qs->next->run(qs->next, quad); + if (quad->mask) + qs->next->run(qs->next, quad); + } } |