Closed Bug 1531248 Opened 2 years ago Closed 2 years ago

Reduce the number of resolve / copy steps in WR on mobile devices.


(Core :: Graphics: WebRender, enhancement)

Not set



Tracking Status
firefox67 --- fixed


(Reporter: gw, Assigned: gw)



(1 file)

No description provided.
Assignee: nobody → gwatson

This patch fixes some wasted GPU time on mobile devices due to
redundant resolve / copy steps.

In the first case, we would previously do:

  • Global clear of color / depth on main framebuffer.
  • Bind and draw off-screen targets.
  • Bind main framebuffer and draw scene.

Between step 1 and 2, a resolve step is triggered on tiled GPU
drivers, wasting a lot of GPU time. To fix this, the clear is
now deferred until the framebuffer of the first document is
drawn. This does slightly change the semantics of how WR does
clear operations, but I think it works fine and makes more sense.

In the second case, we would previously do:

  • ...
  • Draw main framebuffer
  • End frame and invalidate the contents of input textures.
  • Bind main framebuffer and draw debug overlay.

This also introduces an extra resolve / copy step, even if the
debug overlay is not enabled. To fix this, the invalidation step
of the input textures to the main framebuffer pass is deferred
until all drawing is complete on the main framebuffer, by doing
the invalidation in the end_frame() call of the texture resolver.

Together, these save a very significant amount of ms per frame
in GPU time on the mobile devices I tested.

Pushed by
Reduce the number of resolve / copy steps in WR on mobile devices. r=kvark
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.