Mesa (lp-binning): llvmpipe: skip 4x4 in/out test code

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 15 19:06:47 UTC 2010


Module: Mesa
Branch: lp-binning
Commit: 47fee146879aa8ac7f216c8ac5f3a84270266287
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=47fee146879aa8ac7f216c8ac5f3a84270266287

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jan 15 11:35:28 2010 -0700

llvmpipe: skip 4x4 in/out test code

It's a litte faster to just do the in/out testing in the shader
jit code.

---

 src/gallium/drivers/llvmpipe/lp_rast_tri.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index 92769be..b3d1e7d 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -149,10 +149,6 @@ do_block_16( struct lp_rasterizer_task *rast_task,
              int c2,
              int c3 )
 {
-   const int ei1 = tri->ei1 * 4;
-   const int ei2 = tri->ei2 * 4;
-   const int ei3 = tri->ei3 * 4;
-
    const int eo1 = tri->eo1 * 4;
    const int eo2 = tri->eo2 * 4;
    const int eo3 = tri->eo3 * 4;
@@ -175,16 +171,10 @@ do_block_16( struct lp_rasterizer_task *rast_task,
       else {
          int px = x + pos_table4[i][0];
          int py = y + pos_table4[i][1];
-         if (cx1 + ei1 > 0 &&
-             cx2 + ei2 > 0 &&
-             cx3 + ei3 > 0) {
-            /* the block is completely inside the triangle */
-            block_full_4(rast_task, tri, px, py);
-         }
-         else {
-            /* the block is partially in/out of the triangle */
-            do_block_4(rast_task, tri, px, py, cx1, cx2, cx3);
-         }
+         /* Don't bother testing if the 4x4 block is entirely in/out of
+          * the triangle.  It's a little faster to do it in the jit code.
+          */
+         do_block_4(rast_task, tri, px, py, cx1, cx2, cx3);
       }
    }
 }




More information about the mesa-commit mailing list