summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-10 13:56:08 -0700
committerJason Ekstrand <[email protected]>2015-09-11 08:55:51 -0700
commit794355e77167291a3acc8d42249c760c24f54f38 (patch)
tree16fea1f06094dcc55382eb78f21bd2764fa38e88 /src/glsl/nir
parentd4e29af2344c06490913efc35430f93a966061bb (diff)
nir/lower_outputs_to_temporaries: Reparent the output name
We copy the output, make the old output the temporary, and give the temporary a new name. The copy keeps the pointer to the old name. This works just fine up until the point where we lower things to SSA and delete the old variable and, with it, the name. Instead, we should re-parent to the copy. Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-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 b730cad0020..4ea5fd4f66b 100644
--- a/src/glsl/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/glsl/nir/nir_lower_outputs_to_temporaries.c
@@ -91,6 +91,9 @@ nir_lower_outputs_to_temporaries(nir_shader *shader)
/* The orignal is now the temporary */
nir_variable *temp = var;
+ /* Reparent the name to the new variable */
+ ralloc_steal(output, output->name);
+
/* 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;