6d0234673a
The fuzzer has found that it can get timeouts in SkVM by nesting loops very very deeply, then at the bottom of the chain, making an inside-out loop that runs for zero iterations. This has a calculated unrolled-size of zero, but SkVM would still think hard about unrolling the (ultimately empty) outer loops. SkSL now optimizes away unrollable loops that run for zero iteratinons, as well as empty unrollable loops. This should eliminate the fuzzer's troublesome construct entirely. Change-Id: Ic3ef7b7a6a9fc7ee7fb13eb7bd7f34c9bff57448 Bug: oss-fuzz:39661 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456469 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
10 lines
209 B
GLSL
10 lines
209 B
GLSL
|
|
out vec4 sk_FragColor;
|
|
uniform float unknownInput;
|
|
vec4 main() {
|
|
vec4 color = vec4(0.0);
|
|
if (unknownInput == 1.0) color.y = 1.0;
|
|
if (unknownInput == 2.0) ; else color.w = 1.0;
|
|
return color;
|
|
}
|