OSDN Git Service

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 839d5b3..970d8f3 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 fe95086..92be063 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 5046ac3..591fe7b 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.
     */