nir: Clean up nir_deref helper functions
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 13 Nov 2014 22:53:01 +0000 (14:53 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:19:01 +0000 (07:19 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir.c

index e988ca4f248472818b112129951a383fb7b034e4..f63248ec4f187b32c94e3b6f9aba4d8ad2e03994 100644 (file)
@@ -542,6 +542,7 @@ static nir_deref_var *
 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;
@@ -552,8 +553,10 @@ copy_deref_array(void *mem_ctx, nir_deref_array *deref)
 {
    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);