nir/lower_outputs_to_temporaries: Reparent constant initializers

This commit is contained in:
Jason Ekstrand
2015-12-30 18:51:06 -08:00
parent 7d57528233
commit 601b7d5f98
@@ -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;