summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_clone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_clone.c')
-rw-r--r--src/compiler/nir/nir_clone.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index 7236f0872a7..76121d05a7e 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -161,6 +161,14 @@ nir_variable_clone(const nir_variable *var, nir_shader *shader)
}
nvar->interface_type = var->interface_type;
+ nvar->num_members = var->num_members;
+ if (var->num_members) {
+ nvar->members = ralloc_array(nvar, struct nir_variable_data,
+ var->num_members);
+ memcpy(nvar->members, var->members,
+ var->num_members * sizeof(*var->members));
+ }
+
return nvar;
}