summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorOlivier Galibert <[email protected]>2012-05-02 23:11:42 +0200
committerKenneth Graunke <[email protected]>2012-05-08 12:55:52 -0700
commit363c14ae0cd2baa624d85e8c9db12cd1677190ea (patch)
tree9907b03107fb0870007e12268e9d3bb68a476729 /src/glsl/ir.h
parent2ff7b121cad2892698ff1aa7690dd361ea2739a7 (diff)
glsl: Change built-in constant expression evaluation to run the IR.
This removes code duplication with ir_expression::constant_expression_value and builtins/ir/*. Signed-off-by: Olivier Galibert <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 92be063747f..9c7961ab92c 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -576,6 +576,21 @@ private:
const ir_function_signature *origin;
friend class ir_function;
+
+ /**
+ * Helper function to run a list of instructions for constant
+ * expression evaluation.
+ *
+ * The hash table represents the values of the visible variables.
+ * There are no scoping issues because the table is indexed on
+ * ir_variable pointers, not variable names.
+ *
+ * Returns false if the expression is not constant, true otherwise,
+ * and the value in *result if result is non-NULL.
+ */
+ bool constant_expression_evaluate_expression_list(const struct exec_list &body,
+ struct hash_table *variable_context,
+ ir_constant **result);
};