Closed Bug 1700693 Opened 3 years ago Closed 3 years ago

Fix shader compilation errors with unoptimized shaders on Adreno

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attempting to use the unoptimized shaders currently results in some shader compilation errors on various Adreno devices. (Presumably due to driver bugs.)

The first is that the antialias_brush macro gives this error:

ERROR: 0:1287: '(' : Syntax error:  syntax error

It appears to not like a macro with an empty argument list. (No argument list is fine, as is a non-empty argument list).

The second is to do with the workaround we have in place for TEXTURE_EXTERNAL crashes on Mali.

Internal compiler error: Error: array indexing out of boundary

It doesn't like that we sample from a sampler which is an argument to a function. Replacing the function with a ternary operator in the macro definition fixes it (and still works around the Mali issue).

We should also try to get CI to test that compilation succeeds for both optimized and unoptimized shaders. Of course that will only help catch bugs on the hardware we test in CI, but it's better than nothing. (It would have caught these as the Pixel 2 is affected)

Some of the unoptimized shaders fail to compile on Adreno devices,
likely due to driver bugs. We have not noticed this until now because
the optimized versions compile successfully.

The first bug appears to be caused by a macro with an empty argument
list. No argument list or a non-empty argument list works fine, but
an empty argument list causes an error.

The second issue occurs when a sampler is used as an argument to a
function. Using a macro instead works around the bug.

Add a new test_init subcommand to wrench that tests for successful
initialization. This can then be used in combination with the
--precache flag to ensure that all shaders are compiled
successfully. Run this with and without --use-unoptimized-shaders to
ensure that both variants of the shaders compile.

For android we need to ensure that wrench terminates the process when
it completes successfully otherwise it will run forever. We also must
ensure that the test harness stops the old process before relaunching
the activity one in the case of a timeout.

Depends on D109773

Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c77283a7fffb
Fix shader compilation errors on Adreno. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/47e8f1174eba
Add wrench test for successful shader compilation. r=jrmuizel
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: