[Mesa-dev] [PATCH 23/26] nir/lower_out_to_temp: Steal the output's constant initializer

Jason Ekstrand jason at jlekstrand.net
Fri Mar 25 23:12:37 UTC 2016


---
 src/compiler/nir/nir_lower_outputs_to_temporaries.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_lower_outputs_to_temporaries.c b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
index 71b06b8..80c9af4 100644
--- a/src/compiler/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
@@ -97,6 +97,9 @@ nir_lower_outputs_to_temporaries(nir_shader *shader)
       /* 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 at out-temp", output->name);
       temp->data.mode = nir_var_global;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list