WebRender: Document splitting
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
People
(Reporter: jrmuizel, Assigned: alexical)
References
Details
Attachments
(14 files, 12 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Comment 7•6 years ago
|
||
Assignee | ||
Comment 8•6 years ago
|
||
Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Assignee | ||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Assignee | ||
Comment 20•6 years ago
|
||
Assignee | ||
Comment 21•6 years ago
|
||
Assignee | ||
Comment 22•6 years ago
|
||
Assignee | ||
Comment 23•6 years ago
|
||
Assignee | ||
Comment 24•6 years ago
|
||
Assignee | ||
Comment 25•6 years ago
|
||
Assignee | ||
Comment 26•6 years ago
|
||
Assignee | ||
Comment 27•6 years ago
|
||
Assignee | ||
Comment 28•6 years ago
|
||
Assignee | ||
Comment 29•6 years ago
|
||
Assignee | ||
Comment 30•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 31•6 years ago
|
||
Comment 32•6 years ago
|
||
Assignee | ||
Comment 33•6 years ago
|
||
Reporter | ||
Comment 34•6 years ago
|
||
Assignee | ||
Comment 35•6 years ago
|
||
Reporter | ||
Comment 36•6 years ago
|
||
Comment 37•6 years ago
|
||
Assignee | ||
Comment 38•6 years ago
|
||
Assignee | ||
Comment 39•6 years ago
|
||
Assignee | ||
Comment 40•6 years ago
|
||
Assignee | ||
Comment 41•6 years ago
|
||
Assignee | ||
Comment 42•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 43•6 years ago
|
||
Comment 44•6 years ago
|
||
bugherder |
Comment 45•6 years ago
|
||
Assignee | ||
Comment 46•6 years ago
|
||
The WebRenderLayerManager cleanup landed, and the major WR side pieces are in a PR.
As best I can tell, the remaining work here is:
- Implement a way of running a maintenance step before all frame generation in order to do document-independent texture_cache cleanup.
- I think the best way of doing this is to add a
send_transactions
method toRenderApi
with a list of DocumentId, Transaction pairs.
- I think the best way of doing this is to add a
- Clean up the code to accept an arbitrary number of RenderRoots rather than hard-coding the content and chrome area RenderRoots
- Pair our usage of PipelineIds with DocumentIds (a lot of plumbing but should be fairly straightforward overall) for the APZUpdater to use as its hash map keys.
- Figure out the WebRenderScrollData situation once the previous step has been properly sorted out
- Rename all the RenderRoots and Documents to Pipeline or whatever it is we settle on
Based on what I was seeing a month or so ago, there's a good chance there will be a few minor talos regressions after all this, so those will need to be sorted out as well.
After all this, I'll probably want to focus on helping to get retained display lists enabled in the parent process.
Comment 47•6 years ago
|
||
Hi Doug, can I ask a (probably naive) question
Does there need to be a separate document for the sidebar?
IIUC one aim of splitting is to reduce power consumption by reducing the number of vibrant (transparent/blurred) pixels being sent to the OS compositor per second. To do this you'll have a vibrant but small and infrequently updating document (the toolbar) and a large and frequently updating but opaque document (the content) & each document will be sent separately to the OS compositor.
Where does the sidebar fit? It's vibrant & I think it's part of the content document. If I open a vibrant sidebar, won't the whole content document become vibrant leading to a large, frequently updating and vibrant document thus negating the savings from splitting?
Assignee | ||
Comment 48•6 years ago
|
||
Since multiple documents are presently still being rendered to the same framebuffer, we're still giving the OS compositor the same number of pixels every time. Once we're sending different documents to different framebuffers I imagine this will open up different potential wins for us, but we first need to get multiple documents working with the same framebuffer.
Right now the chief goal for doc splitting is to reduce the amount of work we have to do when the chrome changes but the content does not. Content can be very simple or can be very complex - if it is very complex but relatively static, it can be very expensive right now to handle changes in the chrome area, and this can be bad because it feels like the browser itself is slow, rather than just the page you're on.
That being said, the sidebar is in a similar situation as the main toolbar, and I could certainly see it being worth it to give it its own document, but right now my only goal is to get two documents functioning properly. Once we have that, it should be much simpler to get an arbitrary number and arrangement of documents working.
Comment 49•6 years ago
|
||
Thanks very much! It sounds like we Mac users will have to wait a while longer for a battery-friendly opaque Firefox (equivalent to setting gfx.compositor.glcontext.opaque true). Cheers, Mark.
Comment 50•6 years ago
|
||
Comment 51•6 years ago
|
||
bugherder |
Comment 52•6 years ago
|
||
We are trying a similar approach with Servo. Questions:
- If I understand correctly, Chrome and content use 2 different WR documents, is that right?
- Is the content document origin moved below the chrome document or the display list are shifted down? In other words, do the documents overlap?
Assignee | ||
Comment 53•6 years ago
|
||
(In reply to Paul Rouget [:paul] from comment #52)
We are trying a similar approach with Servo. Questions:
- If I understand correctly, Chrome and content use 2 different WR documents, is that right?
- Is the content document origin moved below the chrome document or the display list are shifted down? In other words, do the documents overlap?
- Correct(ish). The top bar chrome gets its own document, and anything below that fold (sidebar, devtools, etc.) uses the content document. This means that content processes have no idea that there is any document splitting going on, but the parent process has to juggle two documents' display lists and other things.
- The documents do not overlap in the default setup. set_window_parameters is called with two disjoint rects for the chrome area and content area. However this is not strictly enforced, and if a user customizes their setup with weird css that keeps their URL bar at the top of the window and their tabs at the bottom or something, then we do not currently account for that which means that the content totally overlaps the chrome area.
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 54•6 years ago
|
||
I was hoping to get patches cleaned up enough for review today, but I've run into a few things I need to debug after rebasing. However, if anyone is interested in doing a drive-by on the patches, here is the condensed form with all the patches rolled into one:
https://hg.mozilla.org/try/rev/9b372d014146ba1d4573c4600153ba246b6cc546
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 56•6 years ago
|
||
Current status:
-
It's all been split out into N render roots rather than hard-coded to two
-
I've got patches functioning that make our APZ code document-aware by ensuring we have RenderRoots keying all of our hashtables and whatnot
-
Ran into some difficulties in the latest rebase due to not having the clip chain ids set up on the chain of stacking context that we clone for the content render root. Kats realized though that we should be able to just accumulate the offsets of the default stacking contexts and apply that when we create our content stacking context. I just finished out the patches for this, it resolved the issue and seems to be working well
-
Currently combing over all of the code that handles multiple render roots to clean it up. I originally implemented it with arrays of length wr::kRenderRootCount for all of the things we needed to split. This was fine but it's a bit ugly and difficult to read since we key them with RenderRoots which I don't want to be implicitly convertible to integers. So I added a RenderRootArray type which takes in RenderRoots as indices and I'm just bringing everything over to that
-
After this I'm going to make sure I've gone through all of the review comments and then get the new patches up for review
Assignee | ||
Comment 57•6 years ago
|
||
These aren't used, so I'm just getting rid of them as cleanup.
Assignee | ||
Comment 58•6 years ago
|
||
Fairly self-explanatory. With multiple documents this can be a problem.
Depends on D20693
Assignee | ||
Comment 59•6 years ago
|
||
This is a stab at what the correct approach to this should be. It
seems that we should be using the window size here and not the
screen_rect, as the screen_rect is not used to offset what we
normally draw, but instead generally for scissoring(?). The end
result is if we use an offset screen_rect, we end up applying
the offset of the chrome area twice, once because the document's
screen rect is offset, and once because of the tile.world_rect
offset.
Depends on D20696
Assignee | ||
Comment 60•6 years ago
|
||
Document splitting is crashing with early initialization of the debug
renderer. Not sure why, and this is just a temporary workaround, but
one that I think we want anyway, as we don't want to be unnecessarily
lazy-initting the debug renderer.
Depends on D20698
Assignee | ||
Comment 61•6 years ago
|
||
This just adds a few types that are commonly used by the rest of
the render root splitting patches.
Depends on D12844
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 62•6 years ago
|
||
Updated•6 years ago
|
Comment 63•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 64•6 years ago
|
||
Just a little rename for clarity - I ended up scratching my head at
something for a little more time than I should have because I assumed
this was synchronous without looking at the implementation.
Depends on D20701
Comment 65•6 years ago
|
||
Comment 66•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Assignee | ||
Comment 67•6 years ago
|
||
This corrects A) An issue encountered with our strategy for skipping
the end_pass call for all but an offscreen render target. See the
comment above the end_pass call for details, and B) An issue with
depth clearing where we do not clear the whole rect if there are
multiple non-intersecting documents.
Depends on D20701
Assignee | ||
Comment 68•6 years ago
|
||
Hey Neil, I have a question that mstange said you might be able to answer. As part of the core patch for this bug (link), I'm trying to add an attribute ("renderroot" - see the usage inside browser.xul in the patch) which when present will cause us to insert an nsDisplayRenderRoot into the display list. This is roughly similar to how nsDisplayOwnLayer works, so I cargo culted its approach and just added similar code into nsBoxFrame.cpp. However, this feels fairly hacky, and I wanted to get your take on what might be a better approach.
Ideally, to avoid future headaches, it should work on whatever XUL element we put it on. Do you have any thoughts on this? And perhaps whether we could refactor the "layer" attribute to use a similar approach?
(Apologies for the large patch - the changes in browser.xul, nsBoxFrame.cpp, and the addition of nsDisplayRenderRoot in nsDisplayList.cpp should be enough to show what the change is.)
Comment 69•6 years ago
|
||
Comment 70•6 years ago
|
||
(In reply to Doug Thayer [:dthayer] from comment #68)
Hey Neil, I have a question that mstange said you might be able to answer. As part of the core patch for this bug (link), I'm trying to add an attribute ("renderroot" - see the usage inside browser.xul in the patch) which when present will cause us to insert an nsDisplayRenderRoot into the display list. This is roughly similar to how nsDisplayOwnLayer works, so I cargo culted its approach and just added similar code into nsBoxFrame.cpp. However, this feels fairly hacky, and I wanted to get your take on what might be a better approach.
That's probably ok for now. Note that nsBoxFrame is used for anything that has CSS display: -moz-box (and related types that inherit it) and isn't specifically a XUL element. Some XUL elements that don't have children such as images and labels use nsLeafBoxFrame that does not inherit from nsBoxFrame. The patch here also adds renderroot="content" to some html:div elements in browser.xul but I don't see where that is handled.
If you want it to be supported on all elements, you might need to place the support somewhere in the display list handling (I'm not familiar enough with display lists to know what this would mean). I'm guessing that you probably want to only support this on specific container type elements, so in the long run you might want to create or require a specific element that does this, and wrap existing content inside it.
Comment 71•6 years ago
|
||
bugherder |
Assignee | ||
Comment 72•6 years ago
|
||
As discussed in IRC. AFAICT the ORTHO_NEAR|FAR_PLANE should match
up with the ranges of valid ZBufferIds, but please double-check
me.
Depends on D23056
Assignee | ||
Comment 73•6 years ago
|
||
Try runs:
Pref off: https://treeherder.mozilla.org/#/jobs?repo=try&revision=41e9fb24c1e82c73517d7ab724f53e98dcc35cfe
Pref on: https://treeherder.mozilla.org/#/jobs?repo=try&revision=485638ad90544da7c6c5f324378b4d524370c2c5
(They're still building at the time of me posting this. They were green before rebasing and adding the new changesets.)
Assignee | ||
Comment 74•6 years ago
|
||
Try did not seem to like that. Investigating shortly.
Assignee | ||
Comment 75•6 years ago
|
||
I'd like to move an ipc::ByteBuf member of a struct into a Maybe,
and in order for that to work IPDLParamTraits<Maybe> needs to support
the rvalue Write.
Depends on D23599
Assignee | ||
Comment 76•6 years ago
|
||
If we try to send them separately as we were before, we can run into
cases where we try to destroy the actors and then send the OpRemoveTexture,
which crashes.
Depends on D23986
Assignee | ||
Comment 77•6 years ago
•
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8b2342bfab4151003085eb871d10bc1102e45bed
Looks green to me? Let me know if it looks like I mis-classified anything.
Try with pref off (EDIT: on) is running here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=557dda58ad01f526ef29619f8578438952d11e32
Comment 78•6 years ago
|
||
(In reply to Doug Thayer [:dthayer] from comment #77)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8b2342bfab4151003085eb871d10bc1102e45bed
Looks green to me? Let me know if it looks like I mis-classified anything.
This looks ok to me.
Try with pref off is running here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=557dda58ad01f526ef29619f8578438952d11e32
This is with pref on and it's not looking so good, but I'm ok with landing it with the pref off and then add additional patches to clean this up.
Comment 79•6 years ago
|
||
Comment 80•6 years ago
|
||
Backed out 7 changesets (bug 1441308)for causing webrender build bustages
push that caused the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&selectedJob=235328305&revision=1764701d11d103a2ac02f8cfa5ff4511b8f5dd70
backout: https://hg.mozilla.org/integration/autoland/rev/699a6b6bee44710ba8710a2ee7740783a596a26a
Assignee | ||
Comment 81•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=800bc0452ccfb193493522dfc0a5160fdab12720
Going for it again...
Comment 82•6 years ago
|
||
Comment 83•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8cefa694f811
https://hg.mozilla.org/mozilla-central/rev/96da9d241051
https://hg.mozilla.org/mozilla-central/rev/e36670b15dd6
https://hg.mozilla.org/mozilla-central/rev/31eb0acf3a1d
https://hg.mozilla.org/mozilla-central/rev/1d405e872db4
https://hg.mozilla.org/mozilla-central/rev/8761ce294d2c
https://hg.mozilla.org/mozilla-central/rev/9bfd4e60ec4e
Comment 84•6 years ago
|
||
I run MotionMark test with gfx.webrender.split-render-roots:true. Sometimes rendering became all white or all black.
Assignee | ||
Updated•6 years ago
|
Comment 85•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 86•6 years ago
|
||
Summary of the current state of document splitting (with a view to my involvement with it and where that involvement should end):
Bug 1538540 - Crash in [@ core::option::expect_failed | webrender::renderer::TextureResolver::bind]
This seems to have died down close to nothing. I suspect that the remaining crashes fall into two categories. 1) Crashes that would be happening without the patches from this bug. 2) Crashes that only happen with the document splitting pref on. Regarding 1), I think that's clearly outside the scope of my involvement. Regarding 2), I don't have any specific leads as to what might be causing this. I've been looking through the source and I think it's going to take a deeper dive which someone more familiar with WebRender itself might be able to do more quickly. However I'd be happy to be a sounding board for their ideas, and if absolutely necessary I can tackle this, I just suspect I wouldn't be the most efficient choice.
Bug 1547351 - Contents on popup of Addons are shown as white when gfx.webrender.split-render-roots is true
I fixed this on OSX it seems, but the patch appears to not fix things for Windows (uncertain about Linux - will investigate). I will continue working on the remaining bits of this for non-OSX.
Bug 1548247 - document splitting: Sluggish autoscrolling
I have a patch which fixes the exact issue mentioned in the bug, but it seems there are still scrolling problems on about:support and other parent process pages which I haven't been able to sort out. I've been scratching my head against them but I think it will be best if kats takes the rest. I will put up my patches for fixing the autoscrolling issue for review by kats and then I think it will be most efficient if he can take it over.
Bug 1548688 - document splitting: Picture-in-Picture player buttons are visible, but the video itself is just white
I will take this one (unless it unearths some bigger problem that I don't know about. I think this is unlikely).
Bug 1549976 - document splitting: "minecraft.net has control of your mouse pointer" slips behind website content
I think this is going to be rather large. I have a sketch in mind of what we'll need to do, but I think it's going to be a fair bit of code. My proposal for this is that I write up patches to get this mostly working, and that someone more familiar with the gfx pipeline takes that over and hammers out the kinks. I am open to pushback on this, though. I think it's anyone's guess as far as whether I would be the most efficient person for this work after identifying the major pieces.
jbonisteel / pslawless, what are your thoughts? I think these bugs can be in good shape for 59. However, it's not certain that this encompasses all of the work needed to turn on document splitting on Nightly, and it's quite likely that there will be more work which will only surface when we do turn this on for Nightly, so we should probably articulate a plan for my involvement with those unknowns, yes?
Comment 87•6 years ago
|
||
Thanks Doug - that sounds good. For 1538540 we will leave this for now as it has died down and if it picks back up when we re-enable, we will figure out what to do. For 1549976 can you ping me when you have the patches up for the mostly working stuff? That will help determine who on GFX should help with the rest.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 88•5 years ago
|
||
With latest m-c, enabling document split with pref gfx.webrender.split-render-roots:true caused almost all test failures :(
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8360c69097cd7fa5e1588cb9131e9d38c3aa2e62
Updated•5 years ago
|
Updated•5 years ago
|
Description
•