glsl: Add support for constant expression evaluation on round(), roundEven().
authorEric Anholt <eric@anholt.net>
Tue, 27 Sep 2011 21:54:10 +0000 (14:54 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 23 Oct 2011 07:37:14 +0000 (00:37 -0700)
commitdc637b66b25f341783efb53acc70e1bafbcba576
treeebc06c0de2bd1af50a6251ef2e2056862245af5b
parentb27a67af892ef6fcb3bd00ac7be2966f834b9a8b
glsl: Add support for constant expression evaluation on round(), roundEven().

v2: Avoid the C99 rounding functions, because I don't trust
get/setting the C99 rounding mode from inside our library not having
other side effects.  Instead, open-code roundEven() behavior around
Mesa's IROUND, which we're already testing for C99 rounding mode
safety.

Fixes glsl-1.30/compiler/built-in-functions/round*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_constant_expression.cpp