mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
Set lower bound on size implied by whole-array assignment
When an unsized array is accessed with a constant extension index this
sets a lower bound on the allowable sizes. When the unsized array
gets a size set due to a whole-array assignment, this size must be at
least as large as the implied lower bound.
This causes the following tests to pass:
glslparsertest/glsl2/array-16.vert
This commit is contained in:
parent
63038e18ad
commit
63f394203a
1 changed files with 7 additions and 0 deletions
|
|
@ -489,6 +489,13 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
|||
|
||||
assert(var != NULL);
|
||||
|
||||
if (var->max_array_access >= unsigned(rhs->type->array_size())) {
|
||||
/* FINISHME: This should actually log the location of the RHS. */
|
||||
_mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to "
|
||||
"previous access",
|
||||
var->max_array_access);
|
||||
}
|
||||
|
||||
var->type = glsl_type::get_array_instance(lhs->type->element_type(),
|
||||
rhs->type->array_size());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue