Partial Invalidation on Windows
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox72 | --- | fixed |
People
(Reporter: sotaro, Assigned: sotaro)
References
(Blocks 1 open bug)
Details
(Whiteboard: [wr-q41])
Attachments
(2 files, 7 obsolete files)
|
2.76 KB,
patch
|
Details | Diff | Splinter Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
Once we have the infrastructure in WR for partial rects. We could implement partial invalidation on Windows. Partial invalidation is also necessary for android.
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
•
|
||
- It seems reasonable to use infrastructure of WR Picture caching to calculate invalidated rects for Partial Invalidation. But current picture caching does not cover whole window rendering. Bug 1575767 might be related.
- WR partial rendering should update only within invalidated rects.
- Invalidated rects might needs to be simple if we want to get performance. Chromium uses only one rect for partial invalidation.
- When window is resized, WR needs to render whole window.
| Assignee | ||
Comment 2•6 years ago
|
||
:kamidphish, do you have an interest to this bug? It is also necessary for get performance with DirectComposition.
| Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 3•6 years ago
•
|
||
The patch uses WR dirty rects(Bug 1581650 ) for present swap chain. But it does not expect to reduce GPU task with the current patch.
| Assignee | ||
Comment 4•6 years ago
|
||
The following has an information about partial present.
https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-1-2-presentation-improvements
Updated•6 years ago
|
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Assignee | ||
Comment 9•6 years ago
•
|
||
Attachment 9105152 [details] [diff] has2 problems.
-[1] CopySubresourceRegion() seemed not to work as expected
- But error did not reported with pref gfx.direct3d11.enable-debug-layer : true
-[2] Black square appeared when content showed a scrollable web page and mouse was around browser UI and content.
- The black square did not appear during showing about:support or about:config.
| Assignee | ||
Comment 10•6 years ago
|
||
The patch enables partial present in WR. But it does full Present() at RenderCompositorANGLE::EndFrame(). It should work, since RenderCompositorANGLE allocates one buffer SwapChain with DXGI_SWAP_EFFECT_SEQUENTIAL. The SwapChain works as Bitblt model swap chain.
https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-1-2-presentation-improvements#bitblt-model-swap-chain-with-dirty-rectangles
But with the patch, [2] in Comment 9 still happened. With it, WR's partial rendering might have a problem. The problem could happen more frequently with the followings.
- "Bookmarks Toolbar" is enabled and has links.
- Browser shows a web site.
- Move mouse around the links and the web site.
| Assignee | ||
Comment 11•6 years ago
|
||
:gw, can you comment to Comment 10? Do you have an idea about how the black square could happen?
Comment 12•6 years ago
|
||
I don't quite understand what you're doing here. Why is the CopySubresourceRegion call needed? According to the partial present documentation, Present1 should be doing all the necessary copying automatically. You just need to make sure to give it the right dirty rects and draw to those same dirty rects. (Maybe WebRender is drawing to the wrong dirty rects? Maybe the coordinates are upside down?)
| Assignee | ||
Comment 13•6 years ago
|
||
You just need to make sure to give it the right dirty rects and draw to those same dirty rects.
Yea. You are right. I am going to check the coordinates. CopySubresourceRegion is necessary when WR uses partial present, but RenderCompositorANGLE does not do partial present.
Comment 14•6 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #13)
CopySubresourceRegion is necessary when WR uses partial present,
Why?
| Assignee | ||
Comment 15•6 years ago
|
||
Removed CopySubresourceRegion usage.
| Assignee | ||
Comment 16•6 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #14)
(In reply to Sotaro Ikeda [:sotaro] from comment #13)
CopySubresourceRegion is necessary when WR uses partial present,
Why?
For example, in CompositorD3D11, partial present is disabled for NVIDIA GPU, but compositor renders only part of back buffer.
| Assignee | ||
Updated•6 years ago
|
Comment 17•6 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #16)
(In reply to Markus Stange [:mstange] from comment #14)
(In reply to Sotaro Ikeda [:sotaro] from comment #13)
CopySubresourceRegion is necessary when WR uses partial present,
Why?
For example, in CompositorD3D11, partial present is disabled for NVIDIA GPU, but compositor renders only part of back buffer.
In the case that partial present is disabled, could you initialize WR with max_partial_presents = 0, and then behavior is the same? Or is it likely faster to emulate partial present with the CopySubResourceRegion ?
| Assignee | ||
Comment 18•6 years ago
•
|
||
(In reply to Glenn Watson [:gw] from comment #17)
In the case that partial present is disabled, could you initialize WR with
max_partial_presents = 0, and then behavior is the same? Or is it likely faster to emulate partial present with theCopySubResourceRegion?
It seems likely faster than simple full present.
| Assignee | ||
Comment 19•6 years ago
|
||
I might find the cause of rendering problem. There might be 2 problems.
- [1] composite_simple() counts dirty_rect_count. But there is a case that dirty_rect_count == 0. In this case, WR does not do rendering. But RenderCompositorANGLE::EndFrame() flip swap chain, since no dirty rect is also used for meaning full rendering.
- [2] PartialPresentMode::Multi seemed not work as expected. When PartialPresentMode::Multi is used, draw_tile_list() checks only dirty_rect that is set in a Tile. But there are overlapping Tiles. They also need to be re-rendered.
Comment 21•6 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #19)
I might find the cause of rendering problem. There might be 2 problems.
Nice work!
Comment 22•6 years ago
|
||
Thanks for investigating, I'll take a look at this today!
| Assignee | ||
Comment 23•6 years ago
|
||
Thanks!
Comment 24•6 years ago
|
||
There is a patch up to fix the partial present semantics in WR (https://bugzilla.mozilla.org/show_bug.cgi?id=1593154).
This WIP patch builds on top of this - it skips Present1() call completely if WR returns no dirty rects at all.
From what I can see, this fixes the issues with partial present. I didn't notice any glitches during browsing. I also saw from logging that we are often presenting very small rects, or none at all (completely skipping Present1). It also fixes the error code returns we were getting from Present1() when WR was supplying an empty dirty rect.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 25•6 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
| bugherder | ||
Description
•