svgadump: Dump the new depth format names.
[mesa.git] / src / glsl / link_functions.cpp
index d40f771e3420d24c7f0a2be1550a1c2e95ce1715..acee327124980eda25912ef7cd720a83d0009ba3 100644 (file)
@@ -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 =