commit | ae3a9bc29d50fd20c8ac47ade61f1fb3e3023bda | [log] [tgz] |
---|---|---|
author | John Stiles <johnstiles@google.com> | Fri Jun 02 15:47:50 2023 -0400 |
committer | SkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com> | Fri Jun 02 20:25:59 2023 +0000 |
tree | d93970e3d7b9a39dd4ca58c112159008270826b0 | |
parent | fa8cc342a43aae181e326d01ba1ad04ff8694ae3 [diff] |
Allow trivial non-constant expressions to use SpvOpSelect. Previously, we would only use OpSelect when choosing between two scalar constant values, and in all other cases would convert ternary expressions to an if-else block. We now also choose OpSelect for "trivial expressions" (variable references, swizzles, array accesses, field accesses), and support vectors as well as scalars. This has a wide-reaching impact on our test suite, because most tests end in `return something ? colorGreen : colorRed;`. This expression will now use OpSelect. (The HLSL expansion of OpSelect is intriguingly bad, but hopefully this is not an issue in practice.) Change-Id: Ia31d42d27b51b801deb17a69c89bff65d949c99d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/706678 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Arman Uguray <armansito@google.com> Commit-Queue: John Stiles <johnstiles@google.com>