[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.

Bug: skia:13092
Change-Id: I0101e4d3199a9f2bb72038d9ba153ef33f551ac8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628852
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
5 files changed