Mesa (master): draw: Add new util function draw_pt_trim_count.

Chia-I Wu olv at kemper.freedesktop.org
Mon Aug 16 12:53:03 UTC 2010


Module: Mesa
Branch: master
Commit: 56213a64fe9e4270fd7886675b1e8224b2d88794
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56213a64fe9e4270fd7886675b1e8224b2d88794

Author: Chia-I Wu <olv at lunarg.com>
Date:   Sat Aug  7 14:37:26 2010 +0800

draw: Add new util function draw_pt_trim_count.

draw_pt_trim_count is renamed from trim in draw_pt.c.

---

 src/gallium/auxiliary/draw/draw_pt.c      |   11 +----------
 src/gallium/auxiliary/draw/draw_pt.h      |    1 +
 src/gallium/auxiliary/draw/draw_pt_util.c |    7 +++++++
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index ded94bb..2b400ed 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -47,15 +47,6 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE)
 DEBUG_GET_ONCE_BOOL_OPTION(draw_use_llvm, "DRAW_USE_LLVM", TRUE)
 #endif
 
-static unsigned trim( unsigned count, unsigned first, unsigned incr )
-{
-   if (count < first)
-      return 0;
-   return count - (count - first) % incr; 
-}
-
-
-
 /* Overall we split things into:
  *     - frontend -- prepare fetch_elts, draw_elts - eg vcache
  *     - middle   -- fetch, shade, cliptest, viewport
@@ -77,7 +68,7 @@ draw_pt_arrays(struct draw_context *draw,
    {
       unsigned first, incr;
       draw_pt_split_prim(prim, &first, &incr);
-      count = trim(count, first, incr);
+      count = draw_pt_trim_count(count, first, incr);
       if (count < first)
          return TRUE;
    }
diff --git a/src/gallium/auxiliary/draw/draw_pt.h b/src/gallium/auxiliary/draw/draw_pt.h
index 42c4f83..688b15c 100644
--- a/src/gallium/auxiliary/draw/draw_pt.h
+++ b/src/gallium/auxiliary/draw/draw_pt.h
@@ -240,6 +240,7 @@ void draw_pt_post_vs_destroy( struct pt_post_vs *pvs );
  * Utils: 
  */
 void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr);
+unsigned draw_pt_trim_count(unsigned count, unsigned first, unsigned incr);
 
 
 #endif
diff --git a/src/gallium/auxiliary/draw/draw_pt_util.c b/src/gallium/auxiliary/draw/draw_pt_util.c
index 182a597..513bbbe 100644
--- a/src/gallium/auxiliary/draw/draw_pt_util.c
+++ b/src/gallium/auxiliary/draw/draw_pt_util.c
@@ -92,3 +92,10 @@ void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr)
       break;
    }
 }
+
+unsigned draw_pt_trim_count(unsigned count, unsigned first, unsigned incr)
+{
+   if (count < first)
+      return 0;
+   return count - (count - first) % incr;
+}




More information about the mesa-commit mailing list