0ed9f31f6a
We now support building an SkSL golden output twice, once honoring the custom #pragma settings, and once more ignoring the settings. This allows us to see the output of the workaround technique, alongside the "default-settings" output which should not contain a workaround. To implement this, skslc now supports a flag: --[no]settings. When it's set, /*#pragma settings*/ comments are honored. When it's not set, skslc ignores the comments. compile_sksl_tests.py passes this flag along to skslc. This approach is not strictly limited to workarounds; the "TypePrecision" GLSL test was also updated to use this technique. Change-Id: I79204df047b024533ed6bc1f4c088e0e878d5bb1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317246 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
18 lines
351 B
Plaintext
18 lines
351 B
Plaintext
/*#pragma settings UnfoldShortCircuitAsTernary*/
|
|
|
|
uniform bool x;
|
|
uniform bool y;
|
|
uniform int i;
|
|
uniform int j;
|
|
|
|
void main() {
|
|
bool andXY = x && y;
|
|
bool orXY = x || y;
|
|
bool combo = (x && y) || (x || y);
|
|
bool prec = (i + j == 3) && y;
|
|
while (andXY && orXY && combo && prec) {
|
|
sk_FragColor = half4(0);
|
|
break;
|
|
}
|
|
}
|