Add a fast path for common rounded rect clips to WR.

RESOLVED FIXED in Firefox 68

Status

()

enhancement
P2
normal
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: gw, Assigned: gw)

Tracking

(Blocks 1 bug)

unspecified
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

3 months ago
No description provided.
Assignee

Updated

3 months ago
Assignee: nobody → gwatson
Assignee

Comment 1

3 months ago

Most rounded rect clips in real content are (a) axis aligned and
(b) have uniform radii.

When these conditions are met, we can run a fast path for clip
mask generation that uses significantly fewer ALU shader ops.

This is not typically a bottleneck on desktop GPUs, but can have
a large performance impact on mobile GPUs (and perhaps low end
integrated GPUs).

The Mali shader analyzer reports the slow path for the rounded
rect clip shader to be 94 cycles per fragment, while the fast
path is 10 cycles.

Comment 2

3 months ago
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/70440f88051f
Add a fast path for common rounded rect clips to WR. r=kvark

Backed out changeset 70440f88051f (Bug 1535976) for /reftests/transform-3d/mask-layer* failures

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=windows%2C10%2Cx64%2Cquantumrender%2Cpgo%2Copt%2Creftests%2Cwith%2Ce10s%2Ctest-windows10-64-pgo-qr%2Fopt-reftest-e10s-2%2Cr-e10s%28r2%29&fromchange=f7a60828b0ad40b755c22b978ac85c6d1d7f00db&tochange=a852a3b599b48136d3a534d023d15ceb12f88695&selectedJob=234696304

Backout link: https://hg.mozilla.org/integration/autoland/rev/a852a3b599b48136d3a534d023d15ceb12f88695

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=234696304&repo=autoland&lineNumber=6990

01:41:11 INFO - REFTEST TEST-START | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-1.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html
01:41:11 INFO - REFTEST TEST-LOAD | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-1.html | 75 / 88 (85%)
01:41:11 INFO - REFTEST TEST-LOAD | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html | 75 / 88 (85%)
01:41:11 INFO - REFTEST INFO | REFTEST fuzzy test (9, 32) <= (8, 32) <= (9, 32)
01:41:11 INFO - REFTEST TEST-UNEXPECTED-PASS | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-1.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html | image comparison, max difference: 8, number of differing pixels: 32
01:41:11 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAP
01:41:11 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAPoCAYA
01:41:11 INFO - REFTEST TEST-END | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-1.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html
01:41:11 INFO - REFTEST TEST-START | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-2.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html
01:41:11 INFO - REFTEST TEST-LOAD | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-2.html | 76 / 88 (86%)
01:41:11 INFO - REFTEST INFO | REFTEST fuzzy test (9, 32) <= (8, 32) <= (9, 32)
01:41:11 INFO - REFTEST TEST-UNEXPECTED-PASS | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-2.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html | image comparison, max difference: 8, number of differing pixels: 32
01:41:11 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,iVBORw0KGgoAAAANSUhEUg
01:41:11 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,iVBORw0KGgoAAAAN
01:41:11 INFO - REFTEST TEST-END | file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-2.html == file:///Z:/task_1552957919/build/tests/reftest/tests/layout/reftests/transform-3d/mask-layer-ref.html

Flags: needinfo?(gwatson)
Assignee

Comment 4

3 months ago

Ah, it looks like on Windows these are new PASS results as they are slightly less fuzzy than when I last did a try run:

(9, 32) <= (8, 32) <= (9, 32)

I'll update the reftest annotations to allow fuzziness of one less pixel on those tests.

Flags: needinfo?(gwatson)
Assignee

Comment 5

3 months ago

Oh, I see what happened.

I had already fixed this and done a successful try run, but then forgot to update the patch in phabricator.

I've rebased and pushed the updated patch, and kicked off a new try run to be sure:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f672c0e8438a099fa521495729da9de30f7d58b0

Once that completes, I'll re-push this to lando.

Assignee

Comment 6

3 months ago

Looks like there is also one other new PASS on Windows, so I've updated the patch again and kicked off a new try:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=a2dad245a1cb0157bddeca59166d9979348328d1

Priority: -- → P2

Comment 7

3 months ago
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd0c67b9aedd
Add a fast path for common rounded rect clips to WR. r=kvark

Comment 8

3 months ago
bugherder
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.