Mesa (master): glsl: Add an origin pointer in the function signature object .
Kenneth Graunke
kwg at kemper.freedesktop.org
Tue May 8 19:59:13 UTC 2012
Module: Mesa
Branch: master
Commit: 2ff7b121cad2892698ff1aa7690dd361ea2739a7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2ff7b121cad2892698ff1aa7690dd361ea2739a7
Author: Olivier Galibert <galibert at pobox.com>
Date: Wed May 2 23:11:41 2012 +0200
glsl: Add an origin pointer in the function signature object.
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 at pobox.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/glsl/ir.cpp | 1 +
src/glsl/ir.h | 3 +++
src/glsl/ir_clone.cpp | 1 +
3 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 839d5b3..970d8f3 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -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;
}
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index fe95086..92be063 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 5046ac3..591fe7b 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -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.
*/
More information about the mesa-commit
mailing list