diff options
author | Ian Romanick <[email protected]> | 2010-07-01 13:17:54 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-07-01 13:17:54 -0700 |
commit | cd00d5b88caa41ebf4b407126f314832f9fdae54 (patch) | |
tree | d3b79e2b5512458bab4c45991b6d683fb12359b4 /src/glsl/ast_to_hir.cpp | |
parent | 5466b63968b98c9627b8dd207ea2bebf838b5268 (diff) |
glsl2: Default delcaration of gl_TexCoord is unsized
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 9d642c1a642..22d9f7ad532 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1813,7 +1813,24 @@ ast_declarator_list::hir(exec_list *instructions, * FINISHME: required or not. */ - if (var->type->array_size() <= (int)earlier->max_array_access) { + /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec: + * + * "The size [of gl_TexCoord] can be at most + * gl_MaxTextureCoords." + * + * FINISHME: Every platform that supports GLSL sets + * FINISHME: gl_MaxTextureCoords to at least 4, so hard-code 4 + * FINISHME: for now. + */ + if ((strcmp("gl_TexCoord", var->name) == 0) + && (var->type->array_size() > 4)) { + YYLTYPE loc = this->get_location(); + + _mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot " + "be larger than gl_MaxTextureCoords (%u)\n", + 4); + } else if (var->type->array_size() <= + (int)earlier->max_array_access) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, "array size must be > %u due to " |