summaryrefslogtreecommitdiffstats
path: root/src/glsl/hir_field_selection.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <t_arceri@yahoo.com.au>2013-10-23 21:31:27 +1100
committerPaul Berry <stereotype441@gmail.com>2013-10-28 06:06:04 -0700
commitb59c5926cb0a5981a2e553c68e36312be7f122f9 (patch)
tree556c64ed9adfed50c64c841b8d51d490b8200072 /src/glsl/hir_field_selection.cpp
parent5cd7eb9f071a02c8252f49ef1fbe59d7319ed503 (diff)
downloadexternal_mesa3d-b59c5926cb0a5981a2e553c68e36312be7f122f9.zip
external_mesa3d-b59c5926cb0a5981a2e553c68e36312be7f122f9.tar.gz
external_mesa3d-b59c5926cb0a5981a2e553c68e36312be7f122f9.tar.bz2
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>
Diffstat (limited to 'src/glsl/hir_field_selection.cpp')
-rw-r--r--src/glsl/hir_field_selection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp
index 08be743..1e92c89 100644
--- a/src/glsl/hir_field_selection.cpp
+++ b/src/glsl/hir_field_selection.cpp
@@ -72,7 +72,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
_mesa_glsl_error(&loc, state, "length method takes no arguments");
if (op->type->is_array()) {
- if (op->type->array_size() == 0)
+ if (op->type->is_unsized_array())
_mesa_glsl_error(&loc, state, "length called on unsized array");
result = new(ctx) ir_constant(op->type->array_size());