aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-11-11 00:48:14 -0800
committerKenneth Graunke <[email protected]>2011-11-14 17:17:39 -0800
commit861d0a5e12b1baa31211cb8aff983b8fb9b97482 (patch)
tree55504c0a5abee5f7ee984df1fd8cff14bcd0d838 /src/glsl/ir.h
parent4f7c21899ad449be2bc1157ce1d2d99296a34499 (diff)
glsl: Add a new matching_signature() variant that returns exact/inexact.
When matching function signatures across multiple linked shaders, we often want to see if the current shader has _any_ match, but also know whether or not it was exact. (If not, we may want to keep looking.) This could be done via the existing mechanisms: sig = f->exact_matching_signature(params); if (sig != NULL) { exact = true; } else { sig = f->matching_signature(params); exact = false; } However, this requires walking the list of function signatures twice, which also means walking each signature's formal parameter lists twice. This could be rather expensive. Since matching_signature already internally knows whether a match was exact or not, we can just return it to get that information for free. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 5878c051b15..1faae3c7259 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -566,6 +566,13 @@ public:
/**
* Find a signature that matches a set of actual parameters, taking implicit
+ * conversions into account. Also flags whether the match was exact.
+ */
+ ir_function_signature *matching_signature(const exec_list *actual_param,
+ bool *match_is_exact);
+
+ /**
+ * Find a signature that matches a set of actual parameters, taking implicit
* conversions into account.
*/
ir_function_signature *matching_signature(const exec_list *actual_param);