Commit d6200622 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1601060 - Fix shader compilation error on some Android devices. r=nical

Some OpenGL ES implementations do not like how we overflow a signed
32-bit integer when masking what are otherwise really unsigned 32-bit
integers. This patch avoids the problematic mask and instead just
does an equivalent shift.

Differential Revision: https://phabricator.services.mozilla.com/D55733

--HG--
extra : moz-landing-system : lando
parent 712f423a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,8 +118,8 @@ void multi_brush_vs(
void main(void) {
    // Load the brush instance from vertex attributes.
    Instance instance = decode_instance_attributes();
    int edge_flags = (instance.flags >> 16) & 0xff;
    int brush_flags = (instance.flags >> 24) & 0xff;
    int edge_flags = instance.flags & 0xff;
    int brush_flags = (instance.flags >> 8) & 0xff;
    PrimitiveHeader ph = fetch_prim_header(instance.prim_header_address);

    // Fetch the segment of this brush primitive we are drawing.
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ Instance decode_instance_attributes() {
    instance.picture_task_address = aData.y >> 16;
    instance.clip_address = aData.y & 0xffff;
    instance.segment_index = aData.z & 0xffff;
    instance.flags = aData.z & 0xffff0000;
    instance.flags = aData.z >> 16;
    instance.resource_address = aData.w & 0xffffff;
    instance.brush_kind = aData.w >> 24;

+2 −2
Original line number Diff line number Diff line
@@ -94,8 +94,8 @@ void main(void) {
    Instance instance = decode_instance_attributes();

    int glyph_index = instance.segment_index;
    int subpx_dir = (instance.flags >> 24) & 0xff;
    int color_mode = (instance.flags >> 16) & 0xff;
    int subpx_dir = (instance.flags >> 8) & 0xff;
    int color_mode = instance.flags & 0xff;

    PrimitiveHeader ph = fetch_prim_header(instance.prim_header_address);
    Transform transform = fetch_transform(ph.transform_id);