skia2/resources/sksl
John Stiles 66c53b9428 Demonstrate a bug with inlined static switches.
When we detect a static switch, the optimizer finds the matching switch-
case and eliminates all the other switch-cases. It handles case
fall-through by scanning forward and looking for an unconditional break.

However, the inliner has an interesting quirk--it can replace `return`
statements inside of a switch with `continue` statements, since the body
of the inlined function has been wrapped with a for-loop to allow for
early exits. The optimizer does not recognize these continue statements
as exits from the switch (although they certainly qualify), so it
treats continues as fallen-through and keeps emitting switch-cases.

The dead-code elimination pass was actually doing us a favor here and
eliminating the excess code later. A flag was added to disable DCE in
order to reveal the problem in a test.

Change-Id: I8ff19fde5e32d0ab73d7c5411da40cb953a446f5
Bug: skia:11352
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372956
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-22 15:05:58 +00:00
..
blend
errors Add test for duplicate default switch-case. 2021-02-19 20:31:50 +00:00
folding Fix alpha channel in SelfAssignment test. 2021-02-11 14:41:15 +00:00
fp Add bool2/bool3/bool4 to GrSLType. 2021-02-02 00:25:29 +00:00
glsl
inliner Demonstrate a bug with inlined static switches. 2021-02-22 15:05:58 +00:00
intrinsics Add tests to demonstrate SPIR-V error with intrinsics. 2021-02-16 15:46:01 +00:00
metal Allow repeated params in Metal out-params helper. 2021-02-16 15:45:45 +00:00
runtime Tweak GlobalVariables.rte test, and adjust .stage output 2021-02-17 22:13:19 +00:00
runtime_errors Runtime Effects: Disallow all operators on arrays or arrays-in-structs 2021-02-17 18:05:04 +00:00
shared Fix SPIR-V bug with swizzled out parameters. 2021-02-12 15:21:27 +00:00
spirv Improve memory layout handling in SPIRV generator 2021-01-22 22:16:48 +00:00
workarounds
README.txt

This directory contains source files for testing skslc compilation.
The compiled output files are in the /tests/sksl/ directory.