172
172
assert(orig_deref->array_index->type->base_type == GLSL_TYPE_INT);
174
176
/* Store the index to a temporary to avoid reusing its tree. */
175
177
index = new(ir) ir_variable(glsl_type::int_type, "vec_index_tmp_i",
178
180
deref = new(ir) ir_dereference_variable(index);
179
181
assign = new(ir) ir_assignment(deref, orig_deref->array_index, NULL);
182
184
/* Store the RHS to a temporary to avoid reusing its tree. */
183
185
var = new(ir) ir_variable(ir->rhs->type, "vec_index_tmp_v",
186
188
deref = new(ir) ir_dereference_variable(var);
187
189
assign = new(ir) ir_assignment(deref, ir->rhs, NULL);
190
192
/* Generate a conditional move of each vector element to the temp. */
191
193
for (i = 0; i < orig_deref->array->type->vector_elements; i++) {