diff options
author | Kenneth Graunke <[email protected]> | 2011-09-20 00:14:05 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-04-02 14:15:36 -0700 |
commit | d0fa0cb52cebdcd0ca483b9cd7af6be2f228b8dc (patch) | |
tree | 668535c2189f6eed6f8074260fba7ca4e005411a /src/glsl/ir.h | |
parent | 807e967c615dc80a264af5a89af7649f95481744 (diff) |
glsl: Move constant expression handling from calls to signatures.
When translating a call from AST to HIR, we need to decide whether it
can be evaluated to a constant before emitting any code (namely, the
temporary declaration, assignment, and call.)
Soon, ir_call will become a statement taking a dereference of where to
store the return value, rather than an rvalue to be used on the RHS of
an assignment. It will be more convenient to try evaluation before
creating a call. ir_function_signature seems like a reasonable place.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r-- | src/glsl/ir.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 811eac08878..bb4f7759b30 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -478,6 +478,12 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); /** + * Attempt to evaluate this function as a constant expression, given + * a list of the actual parameters. Returns NULL for non-built-ins. + */ + ir_constant *constant_expression_value(exec_list *actual_parameters); + + /** * Get the name of the function for which this is a signature */ const char *function_name() const; |