Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make non-empty case statements have break or return #1054

Merged
merged 1 commit into from Apr 4, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

glsl non-empty case statements must have break or return for ANGLE

  • Loading branch information
sotaroikeda committed Apr 4, 2017
commit a6fb2100a633f85da0b229cf7a207379c332544c
@@ -348,6 +348,7 @@ void draw_solid_border(float distanceFromMixLine, vec2 localPos) {
default:
oFragColor = vHorizontalColor;
discard_pixels_in_rounded_borders(localPos);
break;
}
}

@@ -427,6 +428,7 @@ void main(void) {
#endif

vec2 brightness_mod = vec2(0.7, 1.3);
bool needs_discard = false;

// Note: we can't pass-through in the following cases,
// because Angle doesn't support it and fails to compile the shaders.
@@ -459,9 +461,15 @@ void main(void) {
draw_mixed_border(distance_from_mix_line, distance_from_middle, local_pos, brightness_mod.xy);
break;
case BORDER_STYLE_HIDDEN:
discard;
default:
discard;
needs_discard = true;
break;
}

// Note: Workaround for Angle on Windows,
// because non-empty case statements must have break or return.
if (needs_discard) {
discard;
}

#ifdef WR_FEATURE_TRANSFORM
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.