glsl: Move constant expression handling from calls to signatures.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 20 Sep 2011 07:14:05 +0000 (00:14 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Apr 2012 21:15:36 +0000 (14:15 -0700)
commitd0fa0cb52cebdcd0ca483b9cd7af6be2f228b8dc
tree668535c2189f6eed6f8074260fba7ca4e005411a
parent807e967c615dc80a264af5a89af7649f95481744
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 <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir.h
src/glsl/ir_constant_expression.cpp