nir/lower_outputs_to_temporaries: Reparent constant initializers
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 Dec 2015 02:51:06 +0000 (18:51 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 Dec 2015 02:51:06 +0000 (18:51 -0800)
src/glsl/nir/nir_lower_outputs_to_temporaries.c

index 70d85138552cf81f74c584b22d7b4f584b23f90a..00ac09114cf9cddd21766ce05532dc174e1b0815 100644 (file)
@@ -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;