nir/lower_out_to_temp: Steal the output's constant initializer
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 25 Mar 2016 21:17:18 +0000 (14:17 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Mar 2016 01:32:48 +0000 (18:32 -0700)
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/nir/nir_lower_outputs_to_temporaries.c

index 71b06b81fcceace1712108a45f1eb540ef44f47d..80c9af45f2f3eaf54ca49857a2a5c63d9eef90a5 100644 (file)
@@ -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@out-temp", output->name);
       temp->data.mode = nir_var_global;