     vec4 color0, color1;
 
     int segment = vConfig.x;
-    int style0 = vConfig.y & 0xffff;
-    int style1 = vConfig.y >> 16;
+    ivec2 style = ivec2(vConfig.y & 0xffff, vConfig.y >> 16);
     ivec2 edge_axis = ivec2(vConfig.z & 0xffff, vConfig.z >> 16);
 
     float mix_factor = 0.0;

    vPartialWidths = vec4(aWidths / 3.0, aWidths / 2.0);
    vPos = aRect.zw * aPosition.xy;

    vec2 f = vec2(1.3, 0.7);

    switch (style0) {
        case BORDER_STYLE_GROOVE:
            vColor0[0] = mod_color(aColor0, f.x);
            vColor0[1] = mod_color(aColor0, f.y);
            break;
        case BORDER_STYLE_RIDGE:
            vColor0[0] = mod_color(aColor0, f.y);
            vColor0[1] = mod_color(aColor0, f.x);
            break;
        default:
            vColor0[0] = aColor0;
            vColor0[1] = aColor0;
            break;
    }

    switch (style1) {
        case BORDER_STYLE_GROOVE:
            vColor1[0] = mod_color(aColor1, f.x);
            vColor1[1] = mod_color(aColor1, f.y);
            break;
        case BORDER_STYLE_RIDGE:
            vColor1[0] = mod_color(aColor1, f.y);
            vColor1[1] = mod_color(aColor1, f.x);
            break;
        default:
            vColor1[0] = aColor1;
            vColor1[1] = aColor1;
            break;
    }

    vClipCenter_Sign = vec4(outer + clip_sign * aRadii, clip_sign);;
    vClipRadii = vec4(aRadii, max(aRadii - aWidths, 0.0));
    vColorLine = vec4(outer, aWidths.y * -clip_sign.y, aWidths.x * clip_sign.x);

    // Derive the positions for the edge clips, which must be handled
    // differently between corners and edges.
    vec2 edge_reference;
    switch (segment) {
        case SEGMENT_TOP_LEFT:
            edge_reference = outer;
            break;
        case SEGMENT_TOP_RIGHT:
            edge_reference = vec2(outer.x - aWidths.x, outer.y);
            break;
        case SEGMENT_BOTTOM_RIGHT:
            edge_reference = outer - aWidths;
            break;
        case SEGMENT_BOTTOM_LEFT:
            edge_reference = vec2(outer.x, outer.y - aWidths.y);
            break;
        default:
            edge_reference = vec2(0.0);
            break;
    }
    vEdgeReference = vec4(edge_reference, edge_reference + aWidths);

    gl_Position = uTransform * vec4(aTaskOrigin + aRect.xy + vPos, 0.0, 1.0);

                aa_range
            );
            float alpha = distance_aa(aa_range, d);
            float swizzled_factor;
            switch (segment) {
                case SEGMENT_TOP_LEFT: swizzled_factor = 0.0; break;
                case SEGMENT_TOP_RIGHT: swizzled_factor = mix_factor; break;
                case SEGMENT_BOTTOM_RIGHT: swizzled_factor = 1.0; break;
                case SEGMENT_BOTTOM_LEFT: swizzled_factor = 1.0 - mix_factor; break;
                default: swizzled_factor = 0.0; break;
            };
            vec4 c0 = mix(color[1], color[0], swizzled_factor);
            vec4 c1 = mix(color[0], color[1], swizzled_factor);
            return mix(c0, c1, alpha);
        }
        default:
