Closed Bug 1700366 Opened 4 years ago Closed 4 years ago

Models on Sketchfab.com run slower with Webrender software fallback

Categories

(Core :: Graphics: WebRender, defect)

Desktop
Windows 10
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr78 --- disabled
firefox87 --- disabled
firefox88 --- affected
firefox89 --- affected

People

(Reporter: rdoghi, Assigned: gw)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

[Affected platforms]:
Platforms: Windows 8 / 8.1 , Windows 7, Windows 10
GPU's : AMD Rx550, Intel HD 5500, Nvidia GeForce 730

[Steps to reproduce]

  1. Launch the Firefox browser and set both gfx.webrender.enabled, gfx.webrender.software = true
  2. Reach https://sketchfab.com/3d-models/the-turtle-ee2c18fce41c4942b2a99a8638f48858 and wait for the model to load.
  3. Move/Rotate the Model, Zoom in/out.

[Expected result]
The 3D modal should rotate and move smooth without any issues.

[Actual result]
The 3D model animation looks like its losing frames, its slow when its being rotated or zoomed in and out.
Please note that with WebRender enabled but with gfx.webrender.enabled, gfx.webrender.software = FALSE, this issue does not occur.

Attached file about_supps.txt

Attaching the about:support file

Adding 2 Performance profiles captured in Beta and Nightly

I can reproduce this locally. It looks like we're spending a bunch of time in the drawing gradients (presumably every time the webgl updates)

The webgl canvas's parent element has a background-image: linear-gradient(), linear-gradient(). Disabling this background-image improves performance dramatically.

The webgl appears to have {alpha: false} so we should be able to avoid doing this drawing. Glenn, do we have the infrastructure to prevent this drawing from happening? Shouldn't the depth buffer be saving us at a minimum?

Flags: needinfo?(gwatson)
Blocks: sw-wr-perf
No longer blocks: sw-wr-correctness

It's failing to promote the webgl canvas to an external compositor surface because it thinks that the canvas needs a clip-mask applied.

This means that the canvas is composited into the picture cache slice, and thus invalidates the tile, causing rasterization of both the gradient and blitting the canvas into the tile every time it's rotated.

It's not clear to me yet why it thinks it needs a clip-mask - investigating further now.

Assignee: nobody → gwatson
Flags: needinfo?(gwatson)

The clip that results in a mask is a normal rectangle clip, there are no complex clips involved.

WR creates a mask as it thinks that the clip rectangle is in a different coordinate space (non-axis-aligned) than the primitive - it's not clear yet whether that is a simple bug, some accuracy issue, or a genuine issue.

The source transform for the canvas surface is source_transform: Value([1.0008518, 0.0, 0.0, 0.0, -0.0, -1.0, -0.0, -0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 657.0, 0.0, 1.0]) which looks like it should be handled as a ScaleOffset. Perhaps the -0.0 is tripping up the logic that determines if a transform only contains scale / offset.

It's actually the negative scale / reflect that is causing WR to select this as a different coordinate system. However, if I allow that to be considered a ScaleOffset the webgl surface doesn't draw at all, so there is a deeper reason why we don't currently handle this as a compatible coordinate system.

Depends on: 1700539

This will be fixed when #1700539 lands.

This should be fixed in m-c now - if you enable the picture caching debug overlay, you should be able to rotate the model without any tile invalidations occurring. If you're able to verify this, we can close this bug.

Flags: needinfo?(rares.doghi)
Flags: needinfo?(jmuizelaar)

Yup this issue is verified as fixed in 89.0a1 (2021-03-31).

Flags: needinfo?(rares.doghi)

Great, thanks for checking.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(jmuizelaar)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: