26c93442b5
This reverts commit6f06bab632
. Reason for revert: glslGeneration is more trustworthy than GR_GL_VER Original change's description: > Revert "Re-reland "Rewrite switch statements in GLSL strict-ES2 mode.""" > > This reverts commit64560c7cd5
. > > Reason for revert: Nexus5, also > > Original change's description: > > Re-reland "Rewrite switch statements in GLSL strict-ES2 mode."" > > > > This reverts commitc4c355940c
. > > > > Reason for revert: disabled offending tests > > > > Original change's description: > > > Revert "Reland "Rewrite switch statements in GLSL strict-ES2 mode."" > > > > > > This reverts commitc81edd0e8c
. > > > > > > Reason for revert: ANGLE still unhappy > > > Original change's description: > > > > Reland "Rewrite switch statements in GLSL strict-ES2 mode." > > > > > > > > This reverts commitd26d0e6a47
. > > > > > > > > Reason for revert: uses dedicated caps bit > > > > > > > > Original change's description: > > > > > Revert "Rewrite switch statements in GLSL strict-ES2 mode." > > > > > > > > > > This reverts commit45e3838006
. > > > > > > > > > > Reason for revert: Also need to rewrite them in actual ES2 mode. > > > > > > > > > > Original change's description: > > > > > > Rewrite switch statements in GLSL strict-ES2 mode. > > > > > > > > > > > > Once this lands, switch statements will work everywhere--Metal, SPIR-V, > > > > > > GLSL, and SkVM. > > > > > > > > > > > > Change-Id: I2797d0a872de8be77bb9f7aa6acb93421d571d70 > > > > > > Bug: skia:12450 > > > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452356 > > > > > > Commit-Queue: John Stiles <johnstiles@google.com> > > > > > > Auto-Submit: John Stiles <johnstiles@google.com> > > > > > > Reviewed-by: Brian Osman <brianosman@google.com> > > > > > > > > > > Bug: skia:12450 > > > > > Change-Id: I92656ed40289872405c0873f2c56a52b04e35b1d > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452556 > > > > > Auto-Submit: Brian Osman <brianosman@google.com> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > > > > Bug: skia:12450 > > > > Change-Id: I0d3b0969d2040dbb4ee808132146687767c97442 > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452560 > > > > Commit-Queue: John Stiles <johnstiles@google.com> > > > > Commit-Queue: Brian Osman <brianosman@google.com> > > > > Auto-Submit: John Stiles <johnstiles@google.com> > > > > Reviewed-by: Brian Osman <brianosman@google.com> > > > > > > Bug: skia:12450 > > > Change-Id: I869cf3e2c47fe94981aa2ffa6c1f0b3e4d6e6862 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452717 > > > Auto-Submit: Brian Osman <brianosman@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Bug: skia:12450 > > Change-Id: Ia0e23e20794ea707e54be50123b5323369354a03 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452721 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Bug: skia:12450 > Change-Id: Id0c0cdfbf146000ec532e57e380c18ff391ca1da > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452896 > Auto-Submit: Brian Osman <brianosman@google.com> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bug: skia:12450 Change-Id: I4bac3a468ae20967fe6ec372561dd44f67c6b730 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452897 Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
55 lines
1.6 KiB
GLSL
55 lines
1.6 KiB
GLSL
#version 400
|
|
out vec4 sk_FragColor;
|
|
uniform vec4 colorGreen;
|
|
uniform vec4 colorRed;
|
|
bool switch_fallthrough_twice_bi(int value) {
|
|
bool ok = false;
|
|
int _tmpSwitchValue1 = value, _tmpSwitchFallthrough0 = 0;
|
|
for (int _tmpSwitchLoop2 = 0; _tmpSwitchLoop2 < 1; _tmpSwitchLoop2++) {
|
|
if ((_tmpSwitchValue1 == 0)) {
|
|
break;
|
|
_tmpSwitchFallthrough0 = 1;
|
|
}
|
|
if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 1)) {
|
|
{
|
|
}
|
|
_tmpSwitchFallthrough0 = 1;
|
|
}
|
|
if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 2)) {
|
|
{
|
|
}
|
|
_tmpSwitchFallthrough0 = 1;
|
|
}
|
|
if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 3)) {
|
|
ok = true;
|
|
break;
|
|
_tmpSwitchFallthrough0 = 1;
|
|
}
|
|
break;
|
|
}
|
|
return ok;
|
|
}
|
|
vec4 main() {
|
|
int x = int(colorGreen.y);
|
|
bool _0_ok = false;
|
|
int _tmpSwitchValue4 = x, _tmpSwitchFallthrough3 = 0;
|
|
for (int _tmpSwitchLoop5 = 0; _tmpSwitchLoop5 < 1; _tmpSwitchLoop5++) {
|
|
if ((_tmpSwitchValue4 == 2)) {
|
|
break;
|
|
_tmpSwitchFallthrough3 = 1;
|
|
}
|
|
if ((_tmpSwitchFallthrough3 > 0) || (_tmpSwitchValue4 == 1)) {
|
|
{
|
|
}
|
|
_tmpSwitchFallthrough3 = 1;
|
|
}
|
|
if ((_tmpSwitchFallthrough3 > 0) || (_tmpSwitchValue4 == 0)) {
|
|
_0_ok = true;
|
|
break;
|
|
_tmpSwitchFallthrough3 = 1;
|
|
}
|
|
break;
|
|
}
|
|
return _0_ok && switch_fallthrough_twice_bi(x) ? colorGreen : colorRed;
|
|
}
|