mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-05 04:00:34 +01:00
mesa: glsl: error on const-qualified array declarations
This commit is contained in:
parent
b57c53b2bc
commit
250910a59d
1 changed files with 13 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue