summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-01-19 19:43:21 +0000
committerKeith Whitwell <keithw@vmware.com>2009-01-19 19:44:12 +0000
commitbc0e00ad42ee651701ef1e211d36ee92acf18d6f (patch)
treea2c4c0892da4dd23110e26289f615fe803efefdd
parentba3a879b1cade2cb189b1d6d3b244f1fa3f8f5d7 (diff)
util: add reduced prim helper
-rw-r--r--src/gallium/auxiliary/util/u_prim.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_prim.h b/src/gallium/auxiliary/util/u_prim.h
index e45e84ded2c..d7c3995dbf0 100644
--- a/src/gallium/auxiliary/util/u_prim.h
+++ b/src/gallium/auxiliary/util/u_prim.h
@@ -119,4 +119,20 @@ static INLINE boolean u_trim_pipe_prim( unsigned pipe_prim, unsigned *nr )
}
+static INLINE boolean u_reduced_prim( unsigned pipe_prim )
+{
+ switch (pipe_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;
+
+ default:
+ return PIPE_PRIM_TRIANGLES;
+ }
+}
+
#endif