summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-04-06 19:16:58 -0700
committerPaul Berry <[email protected]>2013-04-09 10:19:11 -0700
commit67f226e179b7116379506f7b2c6c8d2b49ab97b2 (patch)
treef2aab9548e0c57ce9d8f0954b4effc02c706532d /src/glsl
parentc2958741298f54ac0360a90f79799b46da248328 (diff)
glsl: Fix ir_print_visitor's handling of interpolation qualifiers.
This patch updates the interp[] array to match the enum glsl_interp_qualifier. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> v2: Add a STATIC_ASSERT to make sure the array is the correct size. This required adding INTERP_QUALIFIER_COUNT to the enum.
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_print_visitor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index 597d2813ff2..fb0dd08f810 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -24,6 +24,7 @@
#include "ir_print_visitor.h"
#include "glsl_types.h"
#include "glsl_parser_extras.h"
+#include "main/macros.h"
#include "program/hash_table.h"
static void print_type(const glsl_type *t);
@@ -149,7 +150,8 @@ void ir_print_visitor::visit(ir_variable *ir)
const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ",
"in ", "out ", "inout ",
"const_in ", "sys ", "temporary " };
- const char *const interp[] = { "", "flat", "noperspective" };
+ const char *const interp[] = { "", "smooth", "flat", "noperspective" };
+ STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT);
printf("(%s%s%s%s) ",
cent, inv, mode[ir->mode], interp[ir->interpolation]);