summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.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/ir.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/ir.cpp')
-rw-r--r--src/glsl/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 9e3238552e9..dbd064feecc 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -912,7 +912,7 @@ ir_constant::zero(void *mem_ctx, const glsl_type *type)
c->array_elements = ralloc_array(c, ir_constant *, type->length);
for (unsigned i = 0; i < type->length; i++)
- c->array_elements[i] = ir_constant::zero(c, type->element_type());
+ c->array_elements[i] = ir_constant::zero(c, type->fields.array);
}
if (type->is_record()) {
@@ -1341,7 +1341,7 @@ ir_dereference_array::set_array(ir_rvalue *value)
const glsl_type *const vt = this->array->type;
if (vt->is_array()) {
- type = vt->element_type();
+ type = vt->fields.array;
} else if (vt->is_matrix()) {
type = vt->column_type();
} else if (vt->is_vector()) {