glsl: Add an origin pointer in the function signature object.
authorOlivier Galibert <galibert@pobox.com>
Wed, 2 May 2012 21:11:41 +0000 (23:11 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 8 May 2012 19:55:52 +0000 (12:55 -0700)
This points to the object with the function body, allowing us to map
from a built-in prototype to the actual body with IR code to execute.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_clone.cpp

index 839d5b3fdb46323bed7e69744b584534dd7afe9b..970d8f3bac094080a346b226f33d4a572ba32c07 100644 (file)
@@ -1481,6 +1481,7 @@ ir_function_signature::ir_function_signature(const glsl_type *return_type)
 {
    this->ir_type = ir_type_function_signature;
    this->is_builtin = false;
+   this->origin = NULL;
 }
 
 
index fe950861620f419550ad226b2255a7371ea21afe..92be063747f76791677f540dd809ed1c9f9751a6 100644 (file)
@@ -572,6 +572,9 @@ private:
    /** Function of which this signature is one overload. */
    class ir_function *_function;
 
+   /** Function signature of which this one is a prototype clone */
+   const ir_function_signature *origin;
+
    friend class ir_function;
 };
 
index 5046ac372a1001dd64a7d78a763d38bf6f903e58..591fe7b7756780f7b6701ae1f4b2efc974dfd42f 100644 (file)
@@ -324,6 +324,7 @@ ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) con
 
    copy->is_defined = false;
    copy->is_builtin = this->is_builtin;
+   copy->origin = this;
 
    /* Clone the parameter list, but NOT the body.
     */