skia2/resources/sksl/shared/OperatorsES3.sksl
John Stiles 2ff8f86205 Run the SkSL Operators test as a Runtime Effect.
The test has been split into an ES2 version and ES3 version; the ES2
side omits unsupported integer ops like << >> & | ^ %.

Change-Id: Iba16d469a477809b17a823b1c68ae8937624c68e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362616
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-01 17:21:33 +00:00

29 lines
645 B
Plaintext

uniform half4 colorGreen, colorRed;
half4 main() {
float x = 1, y = 2;
int z = 3;
x = x - x + y * x * x * (y - x);
y = x / y / x;
z = (z / 2 % 3 << 4) >> 2 << 1;
bool b = (x > 4) == x < 2 || 2 >= sqrt(2) && y <= x;
bool c = sqrt(2) > 2;
bool d = b ^^ c;
bool e = b && c;
bool f = b || c;
x += 12;
x -= 12;
x *= y /= 10;
z |= 0;
z &= -1;
z ^= 0;
z >>= 2;
z <<= 4;
z %= 5;
x = (float2(sqrt(1)), 6);
y = (float(b) * float(c) * float(d) * float(e) * float(f), 6.0);
z = (float2(sqrt(1)), 6);
return (x == 6 && y == 6 && z == 6) ? colorGreen : colorRed;
}