summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/util/u_prim.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/util/u_prim.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_prim.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_prim.c b/lib/mesa/src/gallium/auxiliary/util/u_prim.c
index cbd48e26a..a84d0e71e 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_prim.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_prim.c
@@ -21,12 +21,25 @@
*/
#include "u_prim.h"
+#include "pipe/p_state.h"
/** Return string name of given primitive type */
const char *
u_prim_name(enum pipe_prim_type prim)
{
+#if defined(__GNUC__)
+ /* Check that the enum is packed: */
+ STATIC_ASSERT(sizeof(enum pipe_prim_type) == 1);
+#endif
+
+ /* Draw merging in u_threaded_context requires that sizeof(mode) == 1. */
+ struct pipe_draw_info info;
+ STATIC_ASSERT(sizeof(info.mode) == 1);
+
+ struct pipe_draw_vertex_state_info dvs_info;
+ STATIC_ASSERT(sizeof(dvs_info.mode) == 1);
+
static const struct debug_named_value names[] = {
DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS),
DEBUG_NAMED_VALUE(PIPE_PRIM_LINES),