[Mesa-dev] [PATCH 2/2] util: update, fix pipe_prim_names[] array

Brian Paul brianp at vmware.com
Mon Jan 14 14:31:59 PST 2013


The DEBUG_NAMED_VALUE_WITH_DESCRIPTION() macro doesn't seem to work as
expected with mingw32.  Instead of converting the PIPE_PRIM_LINES define
into an enum name string, it gets converted into "1" (the enum's value).
Just hand-expand the macro to work around that.

Also, add the newer primitive types for geometry shaders.
---
 src/gallium/auxiliary/util/u_debug.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index ce472b0..cfb19a0 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -374,18 +374,22 @@ void debug_print_format(const char *msg, unsigned fmt )
 
 
 
-static const struct debug_named_value pipe_prim_names[] = {
+static const struct debug_named_value pipe_prim_names[PIPE_PRIM_MAX + 1] = {
 #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),
+   { "PIPE_PRIM_POINTS", PIPE_PRIM_POINTS, NULL },
+   { "PIPE_PRIM_LINES", PIPE_PRIM_LINES, NULL },
+   { "PIPE_PRIM_LINE_LOOP", PIPE_PRIM_LINE_LOOP, NULL },
+   { "PIPE_PRIM_LINE_STRIP", PIPE_PRIM_LINE_STRIP, NULL },
+   { "PIPE_PRIM_TRIANGLES", PIPE_PRIM_TRIANGLES, NULL },
+   { "PIPE_PRIM_TRIANGLE_STRIP", PIPE_PRIM_TRIANGLE_STRIP, NULL },
+   { "PIPE_PRIM_TRIANGLE_FAN", PIPE_PRIM_TRIANGLE_FAN, NULL },
+   { "PIPE_PRIM_QUADS", PIPE_PRIM_QUADS, NULL },
+   { "PIPE_PRIM_QUAD_STRIP", PIPE_PRIM_QUAD_STRIP, NULL },
+   { "PIPE_PRIM_POLYGON", PIPE_PRIM_POLYGON, NULL },
+   { "PIPE_PRIM_LINES_ADJACENCY", PIPE_PRIM_LINES_ADJACENCY, NULL },
+   { "PIPE_PRIM_LINE_STRIP_ADJACENCY", PIPE_PRIM_LINE_STRIP_ADJACENCY, NULL },
+   { "PIPE_PRIM_TRIANGLES_ADJACENCY", PIPE_PRIM_TRIANGLES_ADJACENCY, NULL },
+   { "PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY", PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY, NULL },
 #endif
    DEBUG_NAMED_VALUE_END
 };
-- 
1.7.3.4



More information about the mesa-dev mailing list