aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_dump_defines.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_dump_defines.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_dump_defines.c b/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
index 692d4447c..cc6268773 100644
--- a/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
+++ b/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
@@ -73,6 +73,23 @@ util_dump_enum_continuous(unsigned value,
}
+/**
+ * Same as DEFINE_UTIL_DUMP_CONTINUOUS but with static assertions to detect
+ * failures to update lists.
+ */
+#define DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(_name, _count) \
+ const char * \
+ util_dump_##_name(unsigned value, boolean shortened) \
+ { \
+ STATIC_ASSERT(Elements(util_dump_##_name##_names) == _count); \
+ STATIC_ASSERT(Elements(util_dump_##_name##_short_names) == _count); \
+ if(shortened) \
+ return util_dump_enum_continuous(value, Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ else \
+ return util_dump_enum_continuous(value, Elements(util_dump_##_name##_names), util_dump_##_name##_names); \
+ }
+
+
static const char *
util_dump_blend_factor_names[] = {
UTIL_DUMP_INVALID_NAME, /* 0x0 */
@@ -262,7 +279,11 @@ util_dump_tex_target_names[] = {
"PIPE_TEXTURE_1D",
"PIPE_TEXTURE_2D",
"PIPE_TEXTURE_3D",
- "PIPE_TEXTURE_CUBE"
+ "PIPE_TEXTURE_CUBE",
+ "PIPE_TEXTURE_RECT",
+ "PIPE_TEXTURE_1D_ARRAY",
+ "PIPE_TEXTURE_2D_ARRAY",
+ "PIPE_TEXTURE_CUBE_ARRAY",
};
static const char *
@@ -271,10 +292,14 @@ util_dump_tex_target_short_names[] = {
"1d",
"2d",
"3d",
- "cube"
+ "cube",
+ "rect",
+ "1d_array",
+ "2d_array",
+ "cube_array",
};
-DEFINE_UTIL_DUMP_CONTINUOUS(tex_target)
+DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(tex_target, PIPE_MAX_TEXTURE_TYPES)
static const char *