f3a28db703
We no longer derive a performance benefit from this pass in practice, and it is a very expensive compilation step. It is also prone to fuzz- related errors. Doc: http://go/optimization-in-sksl Change-Id: Ief08ffac659a8fe7fe92c92b9a5da14c9f713bc2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381261 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
18 lines
424 B
Plaintext
18 lines
424 B
Plaintext
uniform half4 colorGreen, colorRed;
|
|
|
|
float get() {
|
|
@switch (2) {
|
|
case 1: return abs(1);
|
|
case 2: return abs(2); // Only this case should be preserved.
|
|
case 3: return abs(3);
|
|
case 4: return abs(4);
|
|
}
|
|
// This won't be removed because dead-code elimination is disabled.
|
|
return abs(5);
|
|
}
|
|
|
|
half4 main() {
|
|
float result = get();
|
|
return result == 2 ? colorGreen : colorRed;
|
|
}
|