Bug 1726755 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The triangular shapes are the same driver issue as bug 1630356 and a few others for various shaders. Caused by using a flat varying scalar in the fragment shader, in this case brush_mix_blend's `flat varying int v_op`. The reason 3 of the modes work correctly is that they do not use the brush_mix_blend shader.

Previously we've worked around this by packing the varying in to a vector. Unfortunately, however, this seems to run in to yet another driver bug on this device, and rather than render as coloured triangles they appear as yellow squares. The shader [initializes](https://searchfox.org/mozilla-central/rev/28c8f793f9f8c80de24a179b4472098692a7e9a4/gfx/wr/webrender/res/brush_mix_blend.glsl#269) the output value to yellow, but should always then overwrite it with the result of the operation. It appears none of the switch cases (or the if statements glslopt converts them to) are being hit when we use a component of a varying vector as the test condition. Copying it first to a local int variable works around this, for both unoptimized switch cases or the glslopt optimized if statements (but in the latter case the optimizer will remove the local variable, so I had to manually edit the optimized output to confirm that.)

With some hacks we should be able to add a local variable and prevent the optimizer from removing it, which solves the problem.
The triangular shapes are the same driver issue as bug 1630356 and a few others for various shaders. Caused by using a flat varying scalar in the fragment shader, in this case brush_mix_blend's `flat varying int v_op`. The reason 3 of the modes work correctly is that they do not use the brush_mix_blend shader.

Previously we've worked around this by packing the varying in to a vector. Unfortunately, however, this seems to run in to yet another driver bug on this device, and rather than render as coloured triangles they appear as yellow squares. The shader [initializes](https://searchfox.org/mozilla-central/rev/28c8f793f9f8c80de24a179b4472098692a7e9a4/gfx/wr/webrender/res/brush_mix_blend.glsl#269) the output value to yellow, but should always then overwrite it with the result of the operation. It appears none of the switch cases (or the if statements glslopt converts them to) are being hit when we use a component of a varying vector as the test condition. Copying it first to a local scalar variable works around this, for both unoptimized switch cases or the glslopt optimized if statements (but in the latter case the optimizer will remove the local variable, so I had to manually edit the optimized output to confirm that.)

With some hacks we should be able to add a local variable and prevent the optimizer from removing it, which solves the problem.

Back to Bug 1726755 Comment 2