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

Angle-related shader fixes #749

Merged
merged 1 commit into from Jan 19, 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

Fixed the switch cases fall-through and variable declarations.

  • Loading branch information
kvark committed Jan 18, 2017
commit 57039d15469f59bf3974fb1ef5339ed5c47ab295
@@ -366,17 +366,27 @@ void main(void) {

vec2 brightness_mod = vec2(0.7, 1.3);

// Note: we can't pass-through in the following cases,
// because Angle doesn't support it and fails to compile the shaders.
switch (vBorderStyle) {
case BORDER_STYLE_DASHED:
draw_dashed_or_dotted_border(local_pos, distance_from_mix_line);
break;
case BORDER_STYLE_DOTTED:
draw_dashed_or_dotted_border(local_pos, distance_from_mix_line);
break;
case BORDER_STYLE_DOUBLE:
draw_double_border(distance_from_mix_line, local_pos);
break;
case BORDER_STYLE_OUTSET:
draw_solid_border(distance_from_mix_line, local_pos);
break;
case BORDER_STYLE_INSET:
draw_solid_border(distance_from_mix_line, local_pos);
break;
case BORDER_STYLE_SOLID:
draw_solid_border(distance_from_mix_line, local_pos);
break;
case BORDER_STYLE_NONE:
draw_solid_border(distance_from_mix_line, local_pos);
break;
@@ -387,6 +397,7 @@ 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;
}
@@ -12,7 +12,7 @@ void main(void) {

vec4 segment_rect;
switch (int(gradient.kind.x)) {
case GRADIENT_HORIZONTAL:
case GRADIENT_HORIZONTAL: {
float x0 = mix(gradient.start_end_point.x,
gradient.start_end_point.z,
g0.offset.x);
@@ -22,8 +22,8 @@ void main(void) {
segment_rect.yw = prim.local_rect.yw;
segment_rect.x = x0;
segment_rect.z = x1 - x0;
break;
case GRADIENT_VERTICAL:
} break;
case GRADIENT_VERTICAL: {
float y0 = mix(gradient.start_end_point.y,
gradient.start_end_point.w,
g0.offset.x);
@@ -33,7 +33,7 @@ void main(void) {
segment_rect.xz = prim.local_rect.xz;
segment_rect.y = y0;
segment_rect.w = y1 - y0;
break;
} break;
}

#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.