[Mesa-dev] [PATCH 079/133] nir: Clean up nir_deref helper functions

Jason Ekstrand jason at jlekstrand.net
Mon Dec 15 22:11:24 PST 2014


---
 src/glsl/nir/nir.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 5d7d21a..cf238c1 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -536,6 +536,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;
@@ -546,8 +547,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);
-- 
2.2.0



More information about the mesa-dev mailing list