mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-17 19:20:30 +01:00
mesa: fix array storage allocation bug
This commit is contained in:
parent
22ac107971
commit
0ed3f6f575
1 changed files with 8 additions and 0 deletions
|
|
@ -2071,6 +2071,14 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
|
|||
|
||||
n->Store->File = PROGRAM_TEMPORARY;
|
||||
n->Store->Size = _slang_sizeof_type_specifier(&n->Var->type.specifier);
|
||||
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;
|
||||
}
|
||||
A->program->NumTemporaries++;
|
||||
assert(n->Store->Size > 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue