summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-13 14:53:01 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:01 -0800
commit8219ff1796ab18d19fe9cf3cf93f463a984e2c80 (patch)
treede7168753ba31dd650f7b976f961ad94afa55423 /src/glsl/nir/nir.c
parent895eee505cf9d4145d901accc2767c373e12c05e (diff)
nir: Clean up nir_deref helper functions
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r--src/glsl/nir/nir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index e988ca4f248..f63248ec4f1 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -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);