diff options
author | Brian <[email protected]> | 2007-10-16 17:36:37 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-16 17:36:37 -0600 |
commit | 0edd490a96a53f83d2fb18a570cf20a4a0c5ee40 (patch) | |
tree | 7ea1c4f5be7cd94dc8e5dc0708339a42639e7b09 /src | |
parent | 63b0b5b6c74fcca7d84ac13b893a1f1f5becf39d (diff) |
Redefine QUAD_TOP_LEFT, TOP_RIGHT, etc. to reflect Y=0=TOP raster layout.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_headers.h | 19 | ||||
-rw-r--r-- | src/mesa/pipe/softpipe/sp_prim_setup.c | 12 |
2 files changed, 16 insertions, 15 deletions
diff --git a/src/mesa/pipe/softpipe/sp_headers.h b/src/mesa/pipe/softpipe/sp_headers.h index b377c347125..e23742f8034 100644 --- a/src/mesa/pipe/softpipe/sp_headers.h +++ b/src/mesa/pipe/softpipe/sp_headers.h @@ -39,17 +39,18 @@ /* The rasterizer generates 2x2 quads of fragment and feeds them to - * the current fp_machine (see below). + * the current fp_machine (see below). + * Remember that Y=0=top with Y increasing down the window. */ -#define QUAD_BOTTOM_LEFT 0 -#define QUAD_BOTTOM_RIGHT 1 -#define QUAD_TOP_LEFT 2 -#define QUAD_TOP_RIGHT 3 +#define QUAD_TOP_LEFT 0 +#define QUAD_TOP_RIGHT 1 +#define QUAD_BOTTOM_LEFT 2 +#define QUAD_BOTTOM_RIGHT 3 -#define MASK_BOTTOM_LEFT 0x1 -#define MASK_BOTTOM_RIGHT 0x2 -#define MASK_TOP_LEFT 0x4 -#define MASK_TOP_RIGHT 0x8 +#define MASK_TOP_LEFT (1 << QUAD_TOP_LEFT) +#define MASK_TOP_RIGHT (1 << QUAD_TOP_RIGHT) +#define MASK_BOTTOM_LEFT (1 << QUAD_BOTTOM_LEFT) +#define MASK_BOTTOM_RIGHT (1 << QUAD_BOTTOM_RIGHT) #define MASK_ALL 0xf diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c index 7c81faf9df5..598c2f6c228 100644 --- a/src/mesa/pipe/softpipe/sp_prim_setup.c +++ b/src/mesa/pipe/softpipe/sp_prim_setup.c @@ -125,11 +125,11 @@ quad_clip(struct setup_stage *setup) if (setup->quad.x0 < minx) setup->quad.mask &= (MASK_BOTTOM_RIGHT | MASK_TOP_RIGHT); if (setup->quad.y0 < miny) - setup->quad.mask &= (MASK_TOP_LEFT | MASK_TOP_RIGHT); + setup->quad.mask &= (MASK_BOTTOM_LEFT | MASK_BOTTOM_RIGHT); if (setup->quad.x0 == maxx - 1) setup->quad.mask &= (MASK_BOTTOM_LEFT | MASK_TOP_LEFT); if (setup->quad.y0 == maxy - 1) - setup->quad.mask &= (MASK_BOTTOM_LEFT | MASK_BOTTOM_RIGHT); + setup->quad.mask &= (MASK_TOP_LEFT | MASK_TOP_RIGHT); } @@ -184,16 +184,16 @@ static unsigned calculate_mask( struct setup_stage *setup, unsigned mask = 0; if (x >= setup->span.left[0] && x < setup->span.right[0]) - mask |= MASK_BOTTOM_LEFT; + mask |= MASK_TOP_LEFT; if (x >= setup->span.left[1] && x < setup->span.right[1]) - mask |= MASK_TOP_LEFT; + mask |= MASK_BOTTOM_LEFT; if (x+1 >= setup->span.left[0] && x+1 < setup->span.right[0]) - mask |= MASK_BOTTOM_RIGHT; + mask |= MASK_TOP_RIGHT; if (x+1 >= setup->span.left[1] && x+1 < setup->span.right[1]) - mask |= MASK_TOP_RIGHT; + mask |= MASK_BOTTOM_RIGHT; return mask; } |