diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-26 18:05:27 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-26 18:05:27 -0700 |
commit | 19360152f5bd8cff93359dbfe5a50a90b699c118 (patch) | |
tree | 819343d6d7190098196f651ee5f5d36526e6a49a /ast_to_hir.cpp | |
parent | 72fc47f0b0605748c9643e61c2a879b8476aa533 (diff) |
Reject uniform initializers in GLSL 1.10 mode
Now both glslparsertest/dataType3.frag and glslparsertest/dataType2.frag pass.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r-- | ast_to_hir.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index d7bfb307a7..c5d60b87b8 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -980,6 +980,21 @@ ast_declarator_list::hir(exec_list *instructions, instructions->push_tail(var); + /* From page 24 (page 30 of the PDF) of the GLSL 1.10 spec: + * + * "All uniform variables are read-only and are initialized either + * directly by an application via API commands, or indirectly by + * OpenGL." + */ + if ((state->language_version <= 110) + && (var->mode == ir_var_uniform) + && (decl->initializer != NULL)) { + YYLTYPE loc = decl->initializer->get_location(); + + _mesa_glsl_error(& loc, state, "uniform initializers forbidden in " + "GLSL 1.10"); + } + /* FINISHME: Process the declaration initializer. */ } |