ir_rvalue *op[ARRAY_SIZE(this->operands)] = { NULL, };
unsigned int i;
- for (i = 0; i < get_num_operands(); i++) {
+ for (i = 0; i < num_operands; i++) {
op[i] = this->operands[i]->clone(mem_ctx, ht);
}
ir_dereference_record *
ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const
{
+ assert(this->field_idx >= 0);
+ const char *field_name =
+ this->record->type->fields.structure[this->field_idx].name;
return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),
- this->field);
+ field_name);
}
ir_texture *
new_tex->coordinate = this->coordinate->clone(mem_ctx, ht);
if (this->projector)
new_tex->projector = this->projector->clone(mem_ctx, ht);
- if (this->shadow_comparitor) {
- new_tex->shadow_comparitor = this->shadow_comparitor->clone(mem_ctx, ht);
+ if (this->shadow_comparator) {
+ new_tex->shadow_comparator = this->shadow_comparator->clone(mem_ctx, ht);
}
if (this->offset != NULL)
case GLSL_TYPE_UINT:
case GLSL_TYPE_INT:
case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_FLOAT16:
case GLSL_TYPE_DOUBLE:
case GLSL_TYPE_BOOL:
+ case GLSL_TYPE_UINT64:
+ case GLSL_TYPE_INT64:
+ case GLSL_TYPE_UINT16:
+ case GLSL_TYPE_INT16:
+ case GLSL_TYPE_UINT8:
+ case GLSL_TYPE_INT8:
+ case GLSL_TYPE_SAMPLER:
+ case GLSL_TYPE_IMAGE:
return new(mem_ctx) ir_constant(this->type, &this->value);
- case GLSL_TYPE_STRUCT: {
- ir_constant *c = new(mem_ctx) ir_constant;
-
- c->type = this->type;
- for (const exec_node *node = this->components.get_head_raw()
- ; !node->is_tail_sentinel()
- ; node = node->next) {
- ir_constant *const orig = (ir_constant *) node;
-
- c->components.push_tail(orig->clone(mem_ctx, NULL));
- }
-
- return c;
- }
-
+ case GLSL_TYPE_STRUCT:
case GLSL_TYPE_ARRAY: {
ir_constant *c = new(mem_ctx) ir_constant;
c->type = this->type;
- c->array_elements = ralloc_array(c, ir_constant *, this->type->length);
+ c->const_elements = ralloc_array(c, ir_constant *, this->type->length);
for (unsigned i = 0; i < this->type->length; i++) {
- c->array_elements[i] = this->array_elements[i]->clone(mem_ctx, NULL);
+ c->const_elements[i] = this->const_elements[i]->clone(mem_ctx, NULL);
}
return c;
}
- case GLSL_TYPE_SAMPLER:
- case GLSL_TYPE_IMAGE:
case GLSL_TYPE_ATOMIC_UINT:
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
void
clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
{
- struct hash_table *ht =
- _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
+ struct hash_table *ht = _mesa_pointer_hash_table_create(NULL);
foreach_in_list(const ir_instruction, original, in) {
ir_instruction *copy = original->clone(mem_ctx, ht);