diff options
author | Timothy Arceri <[email protected]> | 2015-04-30 20:45:54 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2015-05-22 08:35:45 +1000 |
commit | d67515b7be1ebd9482970ac1867ee4e9bbbf96d5 (patch) | |
tree | 6c89e134e067cbf9a56b7ef92b5734fbb4e3385c /src/glsl/lower_clip_distance.cpp | |
parent | 51ccdb63467b1e848db025670f126eccb051f8f2 (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/lower_clip_distance.cpp')
-rw-r--r-- | src/glsl/lower_clip_distance.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/lower_clip_distance.cpp b/src/glsl/lower_clip_distance.cpp index 2d6138d5abd..01f028b1f37 100644 --- a/src/glsl/lower_clip_distance.cpp +++ b/src/glsl/lower_clip_distance.cpp @@ -114,7 +114,7 @@ lower_clip_distance_visitor::visit(ir_variable *ir) return visit_continue; assert (ir->type->is_array()); - if (!ir->type->element_type()->is_array()) { + if (!ir->type->fields.array->is_array()) { /* 1D gl_ClipDistance (used for vertex and geometry output, and fragment * input). */ @@ -123,7 +123,7 @@ lower_clip_distance_visitor::visit(ir_variable *ir) this->progress = true; this->old_clip_distance_1d_var = ir; - assert (ir->type->element_type() == glsl_type::float_type); + assert (ir->type->fields.array == glsl_type::float_type); unsigned new_size = (ir->type->array_size() + 3) / 4; /* Clone the old var so that we inherit all of its properties */ @@ -148,8 +148,8 @@ lower_clip_distance_visitor::visit(ir_variable *ir) this->progress = true; this->old_clip_distance_2d_var = ir; - assert (ir->type->element_type()->element_type() == glsl_type::float_type); - unsigned new_size = (ir->type->element_type()->array_size() + 3) / 4; + assert (ir->type->fields.array->fields.array == glsl_type::float_type); + unsigned new_size = (ir->type->fields.array->array_size() + 3) / 4; /* Clone the old var so that we inherit all of its properties */ this->new_clip_distance_2d_var = ir->clone(ralloc_parent(ir), NULL); |