4d6310ab20
This creates a helper function, _entrypoint, which invokes main() and assigns its result into sk_FragColor. We also make sure to prevent sk_FragColor from being dead-stripped from the code during IR generation. At present this is useful for allowing our SkSL test shaders to compile. Change-Id: I2d7fab0e1959a77778ffdb18ca569e869bcaeece Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358525 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
16 lines
288 B
GLSL
16 lines
288 B
GLSL
|
|
out vec4 sk_FragColor;
|
|
vec4 main() {
|
|
vec4 x = vec4(1.0, 1.0, 1.0, 1.0);
|
|
do {
|
|
x.x -= 0.25;
|
|
if (x.x <= 0.0) break;
|
|
} while (x.w == 1.0);
|
|
do {
|
|
x.z -= 0.25;
|
|
if (x.w == 1.0) continue;
|
|
x.y = 0.0;
|
|
} while (x.z > 0.0);
|
|
return x;
|
|
}
|