summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-08-30 16:00:43 -0700
committerKenneth Graunke <[email protected]>2013-09-09 11:46:50 -0700
commitca321d07fda7d4c550eec985c79bbafb3dfbf570 (patch)
tree0e3ce63bdd8086533bbdcfa73d8e1e9a632477a4 /src/glsl/ir_clone.cpp
parent6c3db2167c64ecf2366862f15f8e2d4a91f1028c (diff)
glsl: Store a predicate for whether a built-in signature is available.
For the upcoming built-in function rewrite, we'll need to be able to answer "Is this built-in function signature available?". This is actually a somewhat complex question, since it depends on the language version, GLSL vs. GLSL ES, enabled extensions, and the current shader stage. Storing such a set of constraints in a structure would be painful, so instead we store a function pointer. When creating a signature, we simply point to a predicate that inspects _mesa_glsl_parse_state and answers whether the signature is available in the current shader. Unfortunately, IR reader doesn't actually know when built-in functions are available, so this patch makes it lie and say that they're always present. This allows us to hook up the new functionality; it just won't be useful until real data is populated. In the meantime, the existing profile mechanism ensures built-ins are available in the right places. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r--src/glsl/ir_clone.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index a75b3b7622b..52e2fb54e41 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -330,6 +330,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->builtin_info = this->builtin_info;
copy->origin = this;
/* Clone the parameter list, but NOT the body.