[Mesa-dev] [PATCH 5/6] Add an origin pointer in the function signature object to the object with the function body for builtins.

Olivier Galibert galibert at pobox.com
Wed May 2 14:11:41 PDT 2012


Signed-off-by: Olivier Galibert <galibert at pobox.com>
---
 src/glsl/ir.cpp       |    1 +
 src/glsl/ir.h         |    3 +++
 src/glsl/ir_clone.cpp |    1 +
 3 files changed, 5 insertions(+)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index a6f1b18..afe1d43 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1483,6 +1483,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;
 }
 
 
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 13261a1..b819d34 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -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;
 };
 
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index 5a7a71c..5dc5ce2 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -329,6 +329,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.
     */
-- 
1.7.10.280.gaa39



More information about the mesa-dev mailing list