aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup_tri.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-10-19 14:55:05 +0100
committerKeith Whitwell <[email protected]>2009-10-19 14:55:05 +0100
commit3fd6b724cc406573cf53684cd72fa7f60b65354a (patch)
treeed9b72ee68a10fafac396067d9e8a7a7f2093ba8 /src/gallium/drivers/llvmpipe/lp_setup_tri.c
parent2f5f357c5b67869e75087fc1f17ed0d666fb134e (diff)
llvmpipe: pre-multiply some constants by fixed_one
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_tri.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 44386a225d1..6c9f75e90ce 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -323,6 +323,14 @@ do_triangle_ccw(struct setup_context *setup,
if (tri->dy23 < 0 || (tri->dy23 == 0 && tri->dx23 > 0)) tri->c2++;
if (tri->dy31 < 0 || (tri->dy31 == 0 && tri->dx31 > 0)) tri->c3++;
+ tri->dy12 *= FIXED_ONE;
+ tri->dy23 *= FIXED_ONE;
+ tri->dy31 *= FIXED_ONE;
+
+ tri->dx12 *= FIXED_ONE;
+ tri->dx23 *= FIXED_ONE;
+ tri->dx31 *= FIXED_ONE;
+
/* find trivial reject offsets for each edge for a single-pixel
* sized block. These will be scaled up at each recursive level to
* match the active blocksize. Scaling in this way works best if
@@ -363,30 +371,30 @@ do_triangle_ccw(struct setup_context *setup,
else
{
int c1 = (tri->c1 +
- tri->dx12 * miny * TILESIZE * FIXED_ONE -
- tri->dy12 * minx * TILESIZE * FIXED_ONE);
+ tri->dx12 * miny * TILESIZE -
+ tri->dy12 * minx * TILESIZE);
int c2 = (tri->c2 +
- tri->dx23 * miny * TILESIZE * FIXED_ONE -
- tri->dy23 * minx * TILESIZE * FIXED_ONE);
+ tri->dx23 * miny * TILESIZE -
+ tri->dy23 * minx * TILESIZE);
int c3 = (tri->c3 +
- tri->dx31 * miny * TILESIZE * FIXED_ONE -
- tri->dy31 * minx * TILESIZE * FIXED_ONE);
+ tri->dx31 * miny * TILESIZE -
+ tri->dy31 * minx * TILESIZE);
- int ei1 = tri->ei1 << (FIXED_ORDER + TILE_ORDER);
- int ei2 = tri->ei2 << (FIXED_ORDER + TILE_ORDER);
- int ei3 = tri->ei3 << (FIXED_ORDER + TILE_ORDER);
+ int ei1 = tri->ei1 << TILE_ORDER;
+ int ei2 = tri->ei2 << TILE_ORDER;
+ int ei3 = tri->ei3 << TILE_ORDER;
- int eo1 = tri->eo1 << (FIXED_ORDER + TILE_ORDER);
- int eo2 = tri->eo2 << (FIXED_ORDER + TILE_ORDER);
- int eo3 = tri->eo3 << (FIXED_ORDER + TILE_ORDER);
+ int eo1 = tri->eo1 << TILE_ORDER;
+ int eo2 = tri->eo2 << TILE_ORDER;
+ int eo3 = tri->eo3 << TILE_ORDER;
- int xstep1 = -(tri->dy12 << (FIXED_ORDER + TILE_ORDER));
- int xstep2 = -(tri->dy23 << (FIXED_ORDER + TILE_ORDER));
- int xstep3 = -(tri->dy31 << (FIXED_ORDER + TILE_ORDER));
+ int xstep1 = -(tri->dy12 << TILE_ORDER);
+ int xstep2 = -(tri->dy23 << TILE_ORDER);
+ int xstep3 = -(tri->dy31 << TILE_ORDER);
- int ystep1 = tri->dx12 << (FIXED_ORDER + TILE_ORDER);
- int ystep2 = tri->dx23 << (FIXED_ORDER + TILE_ORDER);
- int ystep3 = tri->dx31 << (FIXED_ORDER + TILE_ORDER);
+ int ystep1 = tri->dx12 << TILE_ORDER;
+ int ystep2 = tri->dx23 << TILE_ORDER;
+ int ystep3 = tri->dx31 << TILE_ORDER;
int x, y;
@@ -406,16 +414,16 @@ do_triangle_ccw(struct setup_context *setup,
{
assert(cx1 ==
tri->c1 +
- tri->dx12 * y * TILESIZE * FIXED_ONE -
- tri->dy12 * x * TILESIZE * FIXED_ONE);
+ tri->dx12 * y * TILESIZE -
+ tri->dy12 * x * TILESIZE);
assert(cx2 ==
tri->c2 +
- tri->dx23 * y * TILESIZE * FIXED_ONE -
- tri->dy23 * x * TILESIZE * FIXED_ONE);
+ tri->dx23 * y * TILESIZE -
+ tri->dy23 * x * TILESIZE);
assert(cx3 ==
tri->c3 +
- tri->dx31 * y * TILESIZE * FIXED_ONE -
- tri->dy31 * x * TILESIZE * FIXED_ONE);
+ tri->dx31 * y * TILESIZE -
+ tri->dy31 * x * TILESIZE);
if (cx1 + eo1 < 0 ||
cx2 + eo2 < 0 ||