summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-12-30 18:51:06 -0800
committerJason Ekstrand <[email protected]>2015-12-30 18:51:06 -0800
commit601b7d5f985b9831ddfeab268b28d14e1c7ea1b7 (patch)
treea1be2275601d128e42f8591f0e18222e448607d7 /src
parent7d57528233b8c3f87834221a12db9c3563d011e1 (diff)
nir/lower_outputs_to_temporaries: Reparent constant initializers
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir_lower_outputs_to_temporaries.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_lower_outputs_to_temporaries.c b/src/glsl/nir/nir_lower_outputs_to_temporaries.c
index 70d85138552..00ac09114cf 100644
--- a/src/glsl/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/glsl/nir/nir_lower_outputs_to_temporaries.c
@@ -97,6 +97,9 @@ nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
/* Reparent the name to the new variable */
ralloc_steal(output, output->name);
+ /* Reparent the constant initializer (if any) */
+ ralloc_steal(output, output->constant_initializer);
+
/* Give the output a new name with @out-temp appended */
temp->name = ralloc_asprintf(var, "%s@out-temp", output->name);
temp->data.mode = nir_var_global;