summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-31 12:31:18 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-31 12:31:18 -0700
commitb168e53452592ce7364a3ce46a6d30c5b746fc3b (patch)
tree460fc5fa7a9a9e81013304f5f463604de5b33e50 /ast_to_hir.cpp
parente1c1a3f3bd139da47a1184a8c69af6239973a90c (diff)
Require that 'uniform' and 'varying' variables be declared at global scope
This causes the following tests to pass: glslparsertest/shaders/uniform.frag glslparsertest/shaders/varying.frag
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 7525461272..874c11a0a8 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1208,13 +1208,22 @@ ast_declarator_list::hir(exec_list *instructions,
instructions->push_tail(var);
if (state->current_function != NULL) {
- /* FINISHME: Variables that are uniform, varying, in, or
- * FINISHME: out varibles must be declared either at global scope or
- * FINISHME: in a parameter list (in and out only).
+ const char *mode = NULL;
+
+ /* FINISHME: Variables that are in or out must be declared either at
+ * FINISHME: global scope or FINISHME: in a parameter list.
*/
if (this->type->qualifier.attribute) {
+ mode = "attribute";
+ } else if (this->type->qualifier.uniform) {
+ mode = "uniform";
+ } else if (this->type->qualifier.varying) {
+ mode = "varying";
+ }
+
+ if (mode) {
_mesa_glsl_error(& loc, state,
- "attribute variable `%s' must be declared at "
+ "%s variable `%s' must be declared at "
"global scope",
var->name);
}