summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_codegen.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-12-11 18:02:19 -0700
committerBrian Paul <brianp@vmware.com>2009-01-06 09:07:29 -0700
commit9b28d5ecd6e034f27cb550d1592f22b052d5cd5a (patch)
tree4d679623e0ba11522946698276fbe278809d8284 /src/mesa/shader/slang/slang_codegen.c
parent1f8109dd06ddbb14756951b5bc6de62cb212e891 (diff)
mesa: checkpoint commit of GLSL 1.20 array syntax.
This allows things like float[3] x = float[3](1., 2., 3.); Parsing and AST construction now. Codegen not working yet. (cherry picked from commit 2dc3de016cd0306bf5b492ed781e824864788f11)
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b821122663..acc00cf892 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2516,19 +2516,11 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
if (var->array_len > 0) {
/* this is an array */
- /* cannot be const-qualified */
- if (var->type.qualifier == SLANG_QUAL_CONST) {
- slang_info_log_error(A->log, "array '%s' cannot be const",
- (char*) var->a_name);
- return NULL;
- }
- else {
- /* round up element size to mult of 4 */
- GLint sz = (n->Store->Size + 3) & ~3;
- /* mult by array size */
- sz *= var->array_len;
- n->Store->Size = sz;
- }
+ /* round up the element size to a multiple of 4 */
+ GLint sz = (n->Store->Size + 3) & ~3;
+ /* total size = element size * array length */
+ sz *= var->array_len;
+ n->Store->Size = sz;
}
assert(n->Store->Size > 0);