ir_constant::ir_constant()
: ir_rvalue(ir_type_constant)
{
- this->array_elements = NULL;
+ this->const_elements = NULL;
}
ir_constant::ir_constant(const struct glsl_type *type,
const ir_constant_data *data)
: ir_rvalue(ir_type_constant)
{
- this->array_elements = NULL;
+ this->const_elements = NULL;
assert((type->base_type >= GLSL_TYPE_UINT)
&& (type->base_type <= GLSL_TYPE_IMAGE));
ir_constant::ir_constant(const ir_constant *c, unsigned i)
: ir_rvalue(ir_type_constant)
{
- this->array_elements = NULL;
+ this->const_elements = NULL;
this->type = c->type->get_base_type();
switch (this->type->base_type) {
ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
: ir_rvalue(ir_type_constant)
{
- this->array_elements = NULL;
+ this->const_elements = NULL;
this->type = type;
assert(type->is_scalar() || type->is_vector() || type->is_matrix()
|| type->is_record() || type->is_array());
if (type->is_array()) {
- this->array_elements = ralloc_array(this, ir_constant *, type->length);
+ this->const_elements = ralloc_array(this, ir_constant *, type->length);
unsigned i = 0;
foreach_in_list(ir_constant, value, value_list) {
assert(value->as_constant() != NULL);
- this->array_elements[i++] = value;
+ this->const_elements[i++] = value;
}
return;
}
memset(&c->value, 0, sizeof(c->value));
if (type->is_array()) {
- c->array_elements = ralloc_array(c, ir_constant *, type->length);
+ c->const_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->fields.array);
+ c->const_elements[i] = ir_constant::zero(c, type->fields.array);
}
if (type->is_record()) {
else if (i >= this->type->length)
i = this->type->length - 1;
- return array_elements[i];
+ return const_elements[i];
}
ir_constant *
case GLSL_TYPE_ARRAY: {
assert (src->type == this->type);
for (unsigned i = 0; i < this->type->length; i++) {
- this->array_elements[i] = src->array_elements[i]->clone(this, NULL);
+ this->const_elements[i] = src->const_elements[i]->clone(this, NULL);
}
break;
}
if (this->type->is_array()) {
for (unsigned i = 0; i < this->type->length; i++) {
- if (!this->array_elements[i]->has_value(c->array_elements[i]))
+ if (!this->const_elements[i]->has_value(c->const_elements[i]))
return false;
}
return true;
}
} else if (constant->type->is_array()) {
for (unsigned int i = 0; i < constant->type->length; i++) {
- steal_memory(constant->array_elements[i], ir);
+ steal_memory(constant->const_elements[i], ir);
}
}
}
const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
set_uniform_initializer(mem_ctx, prog, element_name,
- element_type, val->array_elements[i],
+ element_type, val->const_elements[i],
boolean_true);
}
return;
if (val->type->is_array()) {
const enum glsl_base_type base_type =
- val->array_elements[0]->type->base_type;
- const unsigned int elements = val->array_elements[0]->type->components();
+ val->const_elements[0]->type->base_type;
+ const unsigned int elements = val->const_elements[0]->type->components();
unsigned int idx = 0;
unsigned dmul = glsl_base_type_is_64bit(base_type) ? 2 : 1;
assert(val->type->length >= storage->array_elements);
for (unsigned int i = 0; i < storage->array_elements; i++) {
copy_constant_to_storage(& storage->storage[idx],
- val->array_elements[i],
+ val->const_elements[i],
base_type,
elements,
boolean_true);