Mesa (master): llvmpipe: also use build_mask at 16, 64 pixel levels
Keith Whitwell
keithw at kemper.freedesktop.org
Sun Aug 15 16:33:58 UTC 2010
Module: Mesa
Branch: master
Commit: 4b322e71bb169af637864922edfb4108675781bb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b322e71bb169af637864922edfb4108675781bb
Author: Keith Whitwell <keithw at vmware.com>
Date: Sun Aug 15 16:49:26 2010 +0100
llvmpipe: also use build_mask at 16, 64 pixel levels
---
src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h | 47 ++++++++++--------------
1 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
index e14886f..6d0be76 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
@@ -73,24 +73,19 @@ TAG(do_block_16)(struct lp_rasterizer_task *task,
const int *c)
{
unsigned outmask, inmask, partmask, partial_mask;
- unsigned i, j;
+ unsigned j;
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++) {
- const int *step = plane[j].step;
- const int eo = plane[j].eo * 4;
- const int ei = plane[j].ei * 4;
- const int cox = c[j] + eo;
- const int cio = ei - 1 - eo;
-
- for (i = 0; i < 16; i++) {
- int out = cox + step[i] * 4;
- int part = out + cio;
- outmask |= (out >> 31) & (1 << i);
- partmask |= (part >> 31) & (1 << i);
- }
+ const int dcdx = plane[j].step[1] * 4;
+ const int dcdy = plane[j].step[2] * 4;
+ const int cox = c[j] + plane[j].eo * 4;
+ const int cio = c[j] + plane[j].ei * 4 - 1;
+
+ outmask |= build_mask(cox, dcdx, dcdy);
+ partmask |= build_mask(cio, dcdx, dcdy);
}
if (outmask == 0xffff)
@@ -151,7 +146,7 @@ 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 i, j, nr_planes = 0;
+ unsigned j, nr_planes = 0;
while (plane_mask) {
int i = ffs(plane_mask) - 1;
@@ -165,21 +160,17 @@ TAG(lp_rast_triangle)(struct lp_rasterizer_task *task,
partmask = 0; /* outside one or more trivial accept planes */
for (j = 0; j < NR_PLANES; j++) {
- const int *step = plane[j].step;
- const int eo = plane[j].eo * 16;
- const int ei = plane[j].ei * 16;
- int cox, cio;
-
c[j] = plane[j].c + plane[j].dcdy * y - plane[j].dcdx * x;
- cox = c[j] + eo;
- cio = ei - 1 - eo;
-
- for (i = 0; i < 16; i++) {
- int out = cox + step[i] * 16;
- int part = out + cio;
- outmask |= (out >> 31) & (1 << i);
- partmask |= (part >> 31) & (1 << i);
- }
+ }
+
+ for (j = 0; j < NR_PLANES; j++) {
+ const int dcdx = plane[j].step[1] * 16;
+ const int dcdy = plane[j].step[2] * 16;
+ const int cox = c[j] + plane[j].eo * 16;
+ const int cio = c[j] + plane[j].ei * 16 - 1;
+
+ outmask |= build_mask(cox, dcdx, dcdy);
+ partmask |= build_mask(cio, dcdx, dcdy);
}
if (outmask == 0xffff)
More information about the mesa-commit
mailing list