X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fglsl%2Fir_clone.cpp;h=e46d07d6f43405f94e44ee8405205774e6a71ccd;hb=e5339fe4a47c242693962c9f90bbab8b74935cba;hp=114367c85558b34bc27031e747791cd54bdb7832;hpb=0e88153e998b5ba97dee2b143915ba2509217281;p=mesa.git diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp index 114367c8555..e46d07d6f43 100644 --- a/src/compiler/glsl/ir_clone.cpp +++ b/src/compiler/glsl/ir_clone.cpp @@ -22,7 +22,7 @@ */ #include -#include "main/compiler.h" +#include "util/compiler.h" #include "ir.h" #include "compiler/glsl_types.h" #include "util/hash_table.h" @@ -102,6 +102,12 @@ ir_discard::clone(void *mem_ctx, struct hash_table *ht) const return new(mem_ctx) ir_discard(new_condition); } +ir_demote * +ir_demote::clone(void *mem_ctx, struct hash_table *ht) const +{ + return new(mem_ctx) ir_demote(); +} + ir_loop_jump * ir_loop_jump::clone(void *mem_ctx, struct hash_table *ht) const { @@ -194,6 +200,7 @@ ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const 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), @@ -337,29 +344,20 @@ ir_constant::clone(void *mem_ctx, struct hash_table *ht) const 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; @@ -427,8 +425,7 @@ fixup_function_calls(struct hash_table *ht, exec_list *instructions) 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);