draw: Add new util function draw_pt_trim_count.
authorChia-I Wu <olv@lunarg.com>
Sat, 7 Aug 2010 06:37:26 +0000 (14:37 +0800)
committerChia-I Wu <olv@lunarg.com>
Mon, 16 Aug 2010 12:46:28 +0000 (20:46 +0800)
draw_pt_trim_count is renamed from trim in draw_pt.c.

src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/draw/draw_pt.h
src/gallium/auxiliary/draw/draw_pt_util.c

index ded94bb575c4d7acf2382e356000c765557c232e..2b400eda0fc0a961351ce2f2eaf04f9424853276 100644 (file)
@@ -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;
    }
index 42c4f83272d598d31f32e80e860e105826b02e5c..688b15c4facd8347b6cc9d8490f8bbca934095ee 100644 (file)
@@ -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
index 182a597cca2302dbc9e884cfd9928e414261cbb0..513bbbed216780aee720c308d804b072fe49b6e3 100644 (file)
@@ -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;
+}