04ca41acf3
The optimizer now properly recognizes all types of exits from a switch statement. Break, continue and return are all potential exits and need to be considered when determining the exit path from the switch. Previously, dead code elimination was hiding the effects of this bug from us, but it meant that an optimized switch had the potential to generate lots of worthless IR nodes which then needed to be detected and eliminated by the CFG. In particular, this affected the enum form of blend, causing a catastrophic amount of extra work to be done. Change-Id: If857e38cadfc016884624ea4db25a273ad3dce5b Bug: skia:11352 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372958 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
15 lines
275 B
GLSL
15 lines
275 B
GLSL
|
|
out vec4 sk_FragColor;
|
|
uniform vec4 colorGreen;
|
|
uniform vec4 colorRed;
|
|
vec4 main() {
|
|
float result = 0.0;
|
|
for (int x = 0;x <= 1; x++) {
|
|
{
|
|
result = abs(2.0);
|
|
continue;
|
|
}
|
|
}
|
|
return result == 2.0 ? colorGreen : colorRed;
|
|
}
|