diff options
author | Brian Paul <[email protected]> | 2008-08-04 13:11:27 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-08-04 17:14:49 -0600 |
commit | 250910a59d16cccb50ad8ebcb21da397fb8dcf91 (patch) | |
tree | bce52d63bd5eae79f126439cb521b1a633aefafe /src/mesa/shader/slang | |
parent | b57c53b2bc68e23796d59e66cdc5b45899c5585c (diff) |
mesa: glsl: error on const-qualified array declarations
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 117e82a3902..d0453751f41 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2408,11 +2408,19 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var) if (var->array_len > 0) { /* this is an array */ - /* 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; + /* 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; + } } assert(n->Store->Size > 0); |