diff options
author | Keith Whitwell <[email protected]> | 2010-08-15 17:40:39 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-08-15 17:40:39 +0100 |
commit | 85d9bc236d6a8ff8f12cbc2150f8c3740354f573 (patch) | |
tree | e6bff3af2b832a30af3cf4e1bc5635ede4c187c8 /src/gallium/drivers | |
parent | ff26594a92df37608a3efe47e4d4f3a55bcd6bc1 (diff) |
llvmpipe: consolidate several loops in lp_rast_triangle
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h index 98ebcfa8709..43f72d8ca8f 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h @@ -152,31 +152,28 @@ TAG(lp_rast_triangle)(struct lp_rasterizer_task *task, struct lp_rast_plane plane[NR_PLANES]; int c[NR_PLANES]; unsigned outmask, inmask, partmask, partial_mask; - unsigned j, nr_planes = 0; + unsigned j = 0; - while (plane_mask) { - int i = ffs(plane_mask) - 1; - plane[nr_planes] = tri->plane[i]; - plane_mask &= ~(1 << i); - nr_planes++; - }; - - assert(nr_planes == NR_PLANES); outmask = 0; /* outside one or more trivial reject planes */ partmask = 0; /* outside one or more trivial accept planes */ - for (j = 0; j < NR_PLANES; j++) { + while (plane_mask) { + int i = ffs(plane_mask) - 1; + plane[j] = tri->plane[i]; + plane_mask &= ~(1 << i); c[j] = plane[j].c + plane[j].dcdy * y - plane[j].dcdx * x; - } - for (j = 0; j < NR_PLANES; j++) { - const int dcdx = -plane[j].dcdx * 16; - const int dcdy = plane[j].dcdy * 16; - const int cox = c[j] + plane[j].eo * 16; - const int cio = c[j] + plane[j].ei * 16 - 1; + { + const int dcdx = -plane[j].dcdx * 16; + const int dcdy = plane[j].dcdy * 16; + const int cox = c[j] + plane[j].eo * 16; + const int cio = c[j] + plane[j].ei * 16 - 1; - outmask |= build_mask_linear(cox, dcdx, dcdy); - partmask |= build_mask_linear(cio, dcdx, dcdy); + outmask |= build_mask_linear(cox, dcdx, dcdy); + partmask |= build_mask_linear(cio, dcdx, dcdy); + } + + j++; } if (outmask == 0xffff) |