[sksl][wgsl] Support for trivial ternary expressions
WGSL does not have ternary expressions. The most trivial cases, which
have no side-effects (and can safely be evaluated without
short-circuiting) and evaluate to a scalar or vector can be translated
to a call to the "select" intrinsic, which is what this CL implements.
All other situations need more sophisticated handling in which any
ternary expressions need to be hoisted out as an if-else statement in
the immediately surrounding block, which will be implemented later.
Reviewed-by: John Stiles <firstname.lastname@example.org>
Commit-Queue: Arman Uguray <email@example.com>
5 files changed