summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/lower_packed_varyings.cpp
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-07 22:26:58 +0200
committerMarek Olšák <[email protected]>2016-10-31 11:53:38 +0100
commit7a2387c3e0e91f649676661c607d71f3b4eba5d5 (patch)
tree7a83566e0a421b9850394f307bc8b4fa988717d4 /src/compiler/glsl/lower_packed_varyings.cpp
parent21e11b528269153b2042f1ca22830698de07aadb (diff)
glsl: use a non-malloc'd storage for short ir_variable names
Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_packed_varyings.cpp')
-rw-r--r--src/compiler/glsl/lower_packed_varyings.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/glsl/lower_packed_varyings.cpp b/src/compiler/glsl/lower_packed_varyings.cpp
index 1e8cf113273..19bbe576a69 100644
--- a/src/compiler/glsl/lower_packed_varyings.cpp
+++ b/src/compiler/glsl/lower_packed_varyings.cpp
@@ -639,8 +639,12 @@ lower_packed_varyings_visitor::get_packed_varying_deref(
* first time we visit each component.
*/
if (this->gs_input_vertices == 0 || vertex_index == 0) {
- ralloc_asprintf_append((char **) &this->packed_varyings[slot]->name,
- ",%s", name);
+ ir_variable *var = this->packed_varyings[slot];
+
+ if (var->is_name_ralloced())
+ ralloc_asprintf_append((char **) &var->name, ",%s", name);
+ else
+ var->name = ralloc_asprintf(var, "%s,%s", var->name, name);
}
}