summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-02-23 08:57:32 -0700
committerBrian Paul <[email protected]>2015-02-23 10:02:39 -0700
commit44375a3b1362cf88cd5b00463a8ae91376c8a93b (patch)
tree6c1fe763f326c1ba35245ad523350d8772c33d47 /src/gallium/auxiliary/util
parentf1c67e37e66adfedb0ff944868d62918979349da (diff)
util: move pipe_prim_names array into u_prim_name()
Also, wrapping the array in #ifdef DEBUG / #endif doesn't seem necessary. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_debug.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 169295fe16f..731cdec1334 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -402,31 +402,28 @@ void debug_print_format(const char *msg, unsigned fmt )
#endif
-
-static const struct debug_named_value pipe_prim_names[] = {
-#ifdef DEBUG
- DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS),
- DEBUG_NAMED_VALUE(PIPE_PRIM_LINES),
- DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP),
- DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP),
- DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES),
- DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP),
- DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN),
- DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS),
- DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP),
- DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON),
- DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY),
- DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY),
- DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY),
- DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY),
-#endif
- DEBUG_NAMED_VALUE_END
-};
-
-
-const char *u_prim_name( unsigned prim )
+/** Return string name of given primitive type */
+const char *
+u_prim_name(unsigned prim)
{
- return debug_dump_enum(pipe_prim_names, prim);
+ static const struct debug_named_value names[] = {
+ DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_LINES),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY),
+ DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY),
+ DEBUG_NAMED_VALUE_END
+ };
+ return debug_dump_enum(names, prim);
}