glsl: Add check for unsized arrays to glsl types

The main purpose of this patch is to increase readability of
the array code by introducing is_unsized_array() to glsl_types.
Some redundent is_array() checks are also removed, and small number
of other related clean ups.

The introduction of is_unsized_array() should also make the
ARB_arrays_of_arrays code simpler and more readable when it arrives.

V2: Also replace code that checks for unsized arrays directly with the
length variable

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

v3 (Paul Berry <stereotype441@gmail.com>): clean up formatting.
Separate whitespace cleanups to their own patch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Timothy Arceri
2013-10-23 21:31:27 +11:00
committed by Paul Berry
parent 5cd7eb9f07
commit b59c5926cb
7 changed files with 30 additions and 26 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var)
/* If the array hasn't been sized yet, we can't split it. After
* linking, this should be resolved.
*/
if (var->type->is_array() && var->type->length == 0)
if (var->type->is_unsized_array())
return NULL;
foreach_iter(exec_list_iterator, iter, this->variable_list) {