aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/link_functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/link_functions.cpp')
-rw-r--r--mesalib/src/glsl/link_functions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesalib/src/glsl/link_functions.cpp b/mesalib/src/glsl/link_functions.cpp
index d40f771e3..acee32712 100644
--- a/mesalib/src/glsl/link_functions.cpp
+++ b/mesalib/src/glsl/link_functions.cpp
@@ -104,10 +104,12 @@ public:
if (f == NULL) {
f = new(linked) ir_function(name);
- /* Add the new function to the linked IR.
+ /* Add the new function to the linked IR. Put it at the end
+ * so that it comes after any global variable declarations
+ * that it refers to.
*/
linked->symbols->add_function(f);
- linked->ir->push_head(f);
+ linked->ir->push_tail(f);
}
ir_function_signature *linked_sig =