glsl: Expand fp16 to float before constant expression evaluation
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 25 Feb 2020 21:43:39 +0000 (13:43 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 9 Mar 2020 16:31:08 +0000 (16:31 +0000)
commit878a35db9dafa0cd8da19149d6f5c34e652a1459
treec6400519be2d9e581acb6c45d2c4c12bf376477c
parent505428f20b082f04787630e6d0e5f4dfbce5efb7
glsl: Expand fp16 to float before constant expression evaluation

This way the generated constant folding code doesn't need to
understand fp16.  All operations have to be expanded to full float for
evaulation on the CPU, so we might as well do it up front.  As far as
GLSL is concerned, fp16 isn't a separate type from float, so
everything we're supposed to support for float we need to do for fp16.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3929>
src/compiler/glsl/ir_constant_expression.cpp