summaryrefslogtreecommitdiff
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-06-30 17:48:09 -0700
committerEric Anholt <eric@anholt.net>2010-07-28 14:16:12 -0700
commit8d8469eb2ade4fd48188403351a38f740987fb80 (patch)
treeca69423271811bf90a3348cb1cced440c658e263 /src/glsl/ast_to_hir.cpp
parentf50f06552eb1e4af27d6fe99c381eac6a0a4ea0f (diff)
glsl2: Perform some semantic checking of ARB_fcc layout qualifiers
The rest cannot be handled until built-in variables (i.e., gl_FragCoord) can be redeclared to add qualifiers.
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 98ea789249..d82cf33389 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1542,6 +1542,19 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
else
var->interpolation = ir_var_smooth;
+ /* FINISHME: Apply the fragment coord convetion layout qualifiers.
+ */
+ if ((qual->origin_upper_left || qual->pixel_center_integer)
+ && (strcmp(var->name, "gl_FragCoord") != 0)) {
+ const char *const qual_string = (qual->origin_upper_left)
+ ? "origin_upper_left" : "pixel_center_integer";
+
+ _mesa_glsl_error(loc, state,
+ "layout qualifier `%s' can only be applied to "
+ "fragment shader input `gl_FragCoord'",
+ qual_string);
+ }
+
if (var->type->is_array() && (state->language_version >= 120)) {
var->array_lvalue = true;
}