summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2010-12-16 11:06:19 -0800
committerChad Versace <[email protected]>2011-01-04 10:49:10 -0800
commit68d06b1454aea30c492c7318ab4e8514df8f38fd (patch)
treef6d83321a9bd08583d3f477dab89c781d8d96d3f /src
parentb84e3f570f4b5aba1dd96760e090ae976d0e1cba (diff)
glsl: Check that integer vertex outputs are qualified with flat
Perform this check in ast_declarator_list::hir(). From section 4.3.6 of the GLSL 1.30 spec: "If a vertex output is a signed or unsigned integer or integer vector, then it must be qualified with the interpolation qualifier flat."
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_to_hir.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 6770eed3433..67202dfc3c9 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2158,6 +2158,25 @@ ast_declarator_list::hir(exec_list *instructions,
}
}
+ /* Integer vertex outputs must be qualified with 'flat'.
+ *
+ * From section 4.3.6 of the GLSL 1.30 spec:
+ * "If a vertex output is a signed or unsigned integer or integer
+ * vector, then it must be qualified with the interpolation qualifier
+ * flat."
+ */
+ if (state->language_version >= 130
+ && state->target == vertex_shader
+ && state->current_function == NULL
+ && var->type->is_integer()
+ && var->mode == ir_var_out
+ && var->interpolation != ir_var_flat) {
+
+ _mesa_glsl_error(&loc, state, "If a vertex output is an integer, "
+ "then it must be qualified with 'flat'");
+ }
+
+
/* Process the initializer and add its instructions to a temporary
* list. This list will be added to the instruction stream (below) after
* the declaration is added. This is done because in some cases (such as