diff options
author | Paul Berry <[email protected]> | 2013-04-09 10:03:11 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-04-09 10:19:22 -0700 |
commit | 778ce82b71c75d2c13f38b3504a4f18453330be2 (patch) | |
tree | c1621f72a4b389821b51b5bb781baa5b19d8d0a0 /src/glsl/ir_print_visitor.cpp | |
parent | 67f226e179b7116379506f7b2c6c8d2b49ab97b2 (diff) |
glsl: Check the size of ir_print_visitor's mode[] array with STATIC_ASSERT.
ir_print_visitor::visit(ir_variable *)'s mode[] array needs to match
the declaration of the enum ir_variable_mode. It's hard to verify
that at compile time, but at least we can use a STATIC_ASSERT to make
sure it's the right size.
This required adding ir_var_mode_count to the enum.
Diffstat (limited to 'src/glsl/ir_print_visitor.cpp')
-rw-r--r-- | src/glsl/ir_print_visitor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index fb0dd08f810..f01019c9877 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -150,6 +150,7 @@ void ir_print_visitor::visit(ir_variable *ir) const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ", "in ", "out ", "inout ", "const_in ", "sys ", "temporary " }; + STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count); const char *const interp[] = { "", "smooth", "flat", "noperspective" }; STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT); |