From: Chad Versace Date: Thu, 16 Dec 2010 19:06:19 +0000 (-0800) Subject: glsl: Check that integer vertex outputs are qualified with flat X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68d06b1454aea30c492c7318ab4e8514df8f38fd;p=mesa.git 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." --- 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