copy_deref_var(void *mem_ctx, nir_deref_var *deref)
{
nir_deref_var *ret = nir_deref_var_create(mem_ctx, deref->var);
+ ret->deref.type = deref->deref.type;
if (deref->deref.child)
ret->deref.child = nir_copy_deref(mem_ctx, deref->deref.child);
return ret;
{
nir_deref_array *ret = nir_deref_array_create(mem_ctx);
ret->base_offset = deref->base_offset;
- if (deref->has_indirect)
+ if (deref->has_indirect) {
+ ret->has_indirect = true;
ret->indirect = deref->indirect;
+ }
ret->deref.type = deref->deref.type;
if (deref->deref.child)
ret->deref.child = nir_copy_deref(mem_ctx, deref->deref.child);