+/**
+ * Return the vertex count information for a primitive.
+ *
+ * Note that if this function is called directly or indirectly anywhere in a
+ * source file, it will increase the size of the binary slightly more than
+ * expected because of the use of a table.
+ */
+static inline const struct u_prim_vertex_count *
+u_prim_vertex_count(enum pipe_prim_type prim)
+{
+ static const struct u_prim_vertex_count prim_table[PIPE_PRIM_MAX] = {
+ { 1, 1 }, /* PIPE_PRIM_POINTS */
+ { 2, 2 }, /* PIPE_PRIM_LINES */
+ { 2, 1 }, /* PIPE_PRIM_LINE_LOOP */
+ { 2, 1 }, /* PIPE_PRIM_LINE_STRIP */
+ { 3, 3 }, /* PIPE_PRIM_TRIANGLES */
+ { 3, 1 }, /* PIPE_PRIM_TRIANGLE_STRIP */
+ { 3, 1 }, /* PIPE_PRIM_TRIANGLE_FAN */
+ { 4, 4 }, /* PIPE_PRIM_QUADS */
+ { 4, 2 }, /* PIPE_PRIM_QUAD_STRIP */
+ { 3, 1 }, /* PIPE_PRIM_POLYGON */
+ { 4, 4 }, /* PIPE_PRIM_LINES_ADJACENCY */
+ { 4, 1 }, /* PIPE_PRIM_LINE_STRIP_ADJACENCY */
+ { 6, 6 }, /* PIPE_PRIM_TRIANGLES_ADJACENCY */
+ { 6, 2 }, /* PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY */
+ };