summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_rast_tri.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-01 15:51:07 -0700
committerBrian Paul <brianp@vmware.com>2009-12-01 16:00:30 -0700
commit6bde3e0fdfe4bfc3fee33ca0d1d8e13969eb8952 (patch)
tree82097c1084bf2c8758fa677e087f4e6acd5febf8 /src/gallium/drivers/llvmpipe/lp_rast_tri.c
parent938acf0367416c989d49f231da855ba6ea8d64ca (diff)
llvmpipe: replace shifts with multiplies to be clearer
The compiler will still do the multiplies with shifts. It's just a bit easier to follow the logic with multiplies.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast_tri.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_tri.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index 07b0eccf1e..9543b86ecd 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -120,22 +120,22 @@ do_block_16( struct lp_rasterizer *rast,
{
int ix, iy, i = 0;
- int ei1 = tri->ei1 << 2;
- int ei2 = tri->ei2 << 2;
- int ei3 = tri->ei3 << 2;
+ int ei1 = tri->ei1 * 4;
+ int ei2 = tri->ei2 * 4;
+ int ei3 = tri->ei3 * 4;
- int eo1 = tri->eo1 << 2;
- int eo2 = tri->eo2 << 2;
- int eo3 = tri->eo3 << 2;
+ int eo1 = tri->eo1 * 4;
+ int eo2 = tri->eo2 * 4;
+ int eo3 = tri->eo3 * 4;
assert(x % 16 == 0);
assert(y % 16 == 0);
for (iy = 0; iy < 16; iy+=4) {
for (ix = 0; ix < 16; ix+=4, i++) {
- int cx1 = c1 + (tri->step[0][i] << 2);
- int cx2 = c2 + (tri->step[1][i] << 2);
- int cx3 = c3 + (tri->step[2][i] << 2);
+ int cx1 = c1 + (tri->step[0][i] * 4);
+ int cx2 = c2 + (tri->step[1][i] * 4);
+ int cx3 = c3 + (tri->step[2][i] * 4);
if (cx1 + eo1 < 0 ||
cx2 + eo2 < 0 ||
@@ -176,13 +176,13 @@ lp_rast_triangle( struct lp_rasterizer *rast,
int c2 = tri->c2 + tri->dx23 * y - tri->dy23 * x;
int c3 = tri->c3 + tri->dx31 * y - tri->dy31 * x;
- int ei1 = tri->ei1 << 4;
- int ei2 = tri->ei2 << 4;
- int ei3 = tri->ei3 << 4;
+ int ei1 = tri->ei1 * 16;
+ int ei2 = tri->ei2 * 16;
+ int ei3 = tri->ei3 * 16;
- int eo1 = tri->eo1 << 4;
- int eo2 = tri->eo2 << 4;
- int eo3 = tri->eo3 << 4;
+ int eo1 = tri->eo1 * 16;
+ int eo2 = tri->eo2 * 16;
+ int eo3 = tri->eo3 * 16;
debug_printf("%s\n", __FUNCTION__);
@@ -194,9 +194,9 @@ lp_rast_triangle( struct lp_rasterizer *rast,
*/
for (iy = 0; iy < TILE_SIZE; iy += 16) {
for (ix = 0; ix < TILE_SIZE; ix += 16, i++) {
- int cx1 = c1 + (tri->step[0][i] << 4);
- int cx2 = c2 + (tri->step[1][i] << 4);
- int cx3 = c3 + (tri->step[2][i] << 4);
+ int cx1 = c1 + (tri->step[0][i] * 16);
+ int cx2 = c2 + (tri->step[1][i] * 16);
+ int cx3 = c3 + (tri->step[2][i] * 16);
if (cx1 + eo1 < 0 ||
cx2 + eo2 < 0 ||