skia2/tests/sksl/shared/EmptyBlocksES2.glsl
John Stiles 2b6ec98a82 Disallow unscoped for blocks which declare a variable.
This should be legal, and we support this, but some versions of Android
do not: http://screen/3bkQewHF3xUMn5v There's no point in allowing
these shaders to exist; they can't compile on real-world clients, and
these vardecls are borderline meaningless (as the variables being
declared aren't reachable by any other statements).

Change-Id: Ie1351933c90caee9124eeab8983364ec030b2653
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379584
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-04 17:04:40 +00:00

15 lines
349 B
GLSL

out vec4 sk_FragColor;
vec4 main() {
vec4 color = vec4(0.0);
for (int counter = 0;counter < 10; ++counter) {
}
for (int counter = 0;counter < 10; ++counter) {
}
for (int counter = 0;counter < 10; ++counter) {
}
if (sqrt(1.0) == 1.0) color.y = 1.0;
if (sqrt(1.0) == 2.0) ; else color.w = 1.0;
return color;
}