skia2/tests/sksl/workarounds/TernaryShortCircuitStandaloneSettings.glsl
Arman Uguray bd969a089d [sksl] Disallow boolean uniforms
Booleans and structs/interface blocks that transitively contain a
boolean member are no longer allowed to be used as a uniform. This is
because SPIR-V and WGSL currently disallow OpTypeBool in host-shareable
storage classes.

Change-Id: I10315c7f261ff10a07636265968a91d9c421da55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542776
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-06-01 18:07:08 +00:00

17 lines
337 B
GLSL

out vec4 sk_FragColor;
uniform int i;
uniform int j;
void main() {
bool x = bool(i);
bool y = bool(j);
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 = vec4(0.0);
break;
}
}