summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-04-30 20:45:54 +1000
committerTimothy Arceri <[email protected]>2015-05-22 08:35:45 +1000
commitd67515b7be1ebd9482970ac1867ee4e9bbbf96d5 (patch)
tree6c89e134e067cbf9a56b7ef92b5734fbb4e3385c /src/glsl/glsl_parser_extras.cpp
parent51ccdb63467b1e848db025670f126eccb051f8f2 (diff)
glsl: remove element_type() helper
We now have is_array() and without_array() that make the code much clearer and remove the need for this. For all remaining calls to this we already knew that the type was an array so returning a null wasn't adding any value. v2: use without_array() in _mesa_ast_array_index_to_hir() and don't use without_array() in lower_clip_distance_visitor() as we want to make sure the array is 2D. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index be6713c46a2..046d5d7b5bf 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -778,7 +778,7 @@ _mesa_ast_set_aggregate_type(const glsl_type *type,
/* If the aggregate is an array, recursively set its elements' types. */
if (type->is_array()) {
- /* Each array element has the type type->element_type().
+ /* Each array element has the type type->fields.array.
*
* E.g., if <type> if struct S[2] we want to set each element's type to
* struct S.
@@ -790,7 +790,7 @@ _mesa_ast_set_aggregate_type(const glsl_type *type,
link);
if (expr->oper == ast_aggregate)
- _mesa_ast_set_aggregate_type(type->element_type(), expr);
+ _mesa_ast_set_aggregate_type(type->fields.array, expr);
}
/* If the aggregate is a struct, recursively set its fields' types. */