draw: use u_reduced_prim() function
authorBrian Paul <brianp@vmware.com>
Fri, 19 Jun 2009 15:45:23 +0000 (09:45 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 19 Jun 2009 15:45:23 +0000 (09:45 -0600)
src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/draw/draw_pt.h
src/gallium/auxiliary/draw/draw_pt_util.c
src/gallium/auxiliary/draw/draw_pt_vcache.c

index 9ea0cbe5990b4931f7ed86453b05f174b0a474ec..dbb5ac71821ae266729a4bf22d8461d5e2740cb9 100644 (file)
@@ -36,6 +36,7 @@
 #include "draw/draw_vs.h"
 #include "tgsi/tgsi_dump.h"
 #include "util/u_math.h"
+#include "util/u_prim.h"
 
 static unsigned trim( unsigned count, unsigned first, unsigned incr )
 {
@@ -278,7 +279,7 @@ void
 draw_arrays(struct draw_context *draw, unsigned prim,
             unsigned start, unsigned count)
 {
-   unsigned reduced_prim = draw_pt_reduced_prim(prim);
+   unsigned reduced_prim = u_reduced_prim(prim);
    if (reduced_prim != draw->reduced_prim) {
       draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
       draw->reduced_prim = reduced_prim;
index 8ef0ea8011fc6b0f235d195701b135de4b8d2ea8..7a17a9fb6b2818013966b6b13c7a78be0849a6a8 100644 (file)
@@ -228,7 +228,6 @@ 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_reduced_prim(unsigned prim);
 
 
 #endif
index 3bc7939c556887c14289244b1d4cced6e77748e9..b61fa291436c4a79abf9c954ec809df0f71dc03a 100644 (file)
@@ -75,28 +75,3 @@ void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr)
       break;
    }
 }
-
-
-unsigned draw_pt_reduced_prim(unsigned prim)
-{
-   switch (prim) {
-   case PIPE_PRIM_POINTS:
-      return PIPE_PRIM_POINTS;
-   case PIPE_PRIM_LINES:
-   case PIPE_PRIM_LINE_STRIP:
-   case PIPE_PRIM_LINE_LOOP:
-      return PIPE_PRIM_LINES;
-   case PIPE_PRIM_TRIANGLES:
-   case PIPE_PRIM_TRIANGLE_STRIP:
-   case PIPE_PRIM_TRIANGLE_FAN:
-   case PIPE_PRIM_POLYGON:
-   case PIPE_PRIM_QUADS:
-   case PIPE_PRIM_QUAD_STRIP:
-      return PIPE_PRIM_TRIANGLES;
-   default:
-      assert(0);
-      return PIPE_PRIM_POINTS;
-   }
-}
-
-
index edb2aa73e162e95e082c17f3a0e1fc2775e8e1ad..1a0527be63a8380ea9e5962fd7a0d9cf9c71e302 100644 (file)
@@ -31,6 +31,7 @@
   */
 
 #include "util/u_memory.h"
+#include "util/u_prim.h"
 #include "draw/draw_context.h"
 #include "draw/draw_private.h"
 #include "draw/draw_pt.h"
@@ -467,7 +468,7 @@ vcache_prepare( struct draw_pt_front_end *frontend,
    }
 
    vcache->input_prim = prim;
-   vcache->output_prim = draw_pt_reduced_prim(prim);
+   vcache->output_prim = u_reduced_prim(prim);
 
    vcache->middle = middle;
    vcache->opt = opt;