gecko-dev/gfx
Lee Salzman 1d9820a99d Bug 1777426 - Support fast readbacks in CopyToSwapChain with async present. r=sotaro,jgilbert
Currently CopyToSwapChain creates spurious copies of the back buffer when SharedSurfaces aren't exportable (= ToSurfaceDescriptor returns Nothing from SharedSurface_Basic). These then later get read back into a CPU memory buffer when PresentFrontBufferToCompositor is used to send the buffer to RemoteTextureMap. This has associated performance and memory costs.

Conceptually, we want Present/CopyToSwapChain to just do the right thing and automatically push buffers to RemoteTextureMap, rather than secondarily needing a hidden call to PresentFrontBufferToCompositor. Then we can get rid of the need to create front buffers whose only purpose is to shuttle data to PresentFrontBufferToCompositor which then shuttles it RemoteTextureMap.

This patch achieves this by refactoring the guts of PresentFrontBufferToCompositor into Present/CopyToSwapChain. The remote texture ids are sent along inside SwapChainOptions if async present is enabled. Those remote texture ids are cached in ClientWebGLContext so that GetFrontBuffer can return them without any subsequent need for an IPDL call.

On the parent side, CopyToSwapChain will now notice if async present is to be used and if a SurfaceFactory does not generate SharedSurfaces that can be exported. In that case it cuts out the middle man and reads from the WebGLFramebuffer's back buffer directly into a CPU buffer to send to RemoteTextureMap.

This also adds a forceAsyncPresent option to SwapChainOptions so that in the future we can have a separate pref for Accelerated Canvas2D that will allow enabling async present independent of the global WebGL pref.

Differential Revision: https://phabricator.services.mozilla.com/D150720
2022-07-12 06:56:19 +00:00
..
2d Bug 1777209 - Use DrawSurface rather than FillRect to paint <canvas>, and don't use EXTEND_PAD when writing to PDF. r=jrmuizel 2022-07-05 07:55:56 +00:00
angle Bug 1661450 - 5/8 Fix build system to handle undefined MOZ_X11 r=stransky 2022-04-20 09:32:08 +00:00
cairo Bug 1778158 - quartz: Avoid reading beyond the end of image surfaces. r=jfkthame 2022-07-06 12:25:10 +00:00
config Bug 1778431 - Allocate canvas render thread for out-of-process WebGL r=gfx-reviewers,aosmond 2022-07-08 04:02:41 +00:00
docs Bug 1771364 - Add basic testing section to APZ docs. r=botond 2022-05-27 20:44:02 +00:00
gl Bug 1777426 - Support fast readbacks in CopyToSwapChain with async present. r=sotaro,jgilbert 2022-07-12 06:56:19 +00:00
graphite2
harfbuzz Bug 1776802 - Remove obsolete lines from harfbuzz moz.build and enable warnings-as-errors. r=jfkthame 2022-07-11 16:28:05 +00:00
ipc Bug 1778431 - Allocate canvas render thread for out-of-process WebGL r=gfx-reviewers,aosmond 2022-07-08 04:02:41 +00:00
layers Bug 1777426 - Support fast readbacks in CopyToSwapChain with async present. r=sotaro,jgilbert 2022-07-12 06:56:19 +00:00
ots Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana 2022-06-07 12:32:55 +00:00
qcms Bug 1772048 - Update rustc_version and semver crates. r=emilio,webdriver-reviewers,kinetik,whimboo 2022-06-07 10:01:32 +00:00
skia Bug 1774522 - Make Skia C++20 compatible by replacing deprecated std::result_of_t. r=lsalzman 2022-06-17 02:13:46 +00:00
src Bug 1778855 - Use e.g. gfxEnv::MOZ_GL_DEBUG() instead of gfxEnv::GlDebug(). r=gfx-reviewers,jrmuizel 2022-07-11 23:59:53 +00:00
tests Bug 1775162 - Fix C++20 build error in BSPPolygon template class definition. r=gfx-reviewers,jrmuizel 2022-06-22 04:06:47 +00:00
thebes Bug 1777927 - Force-disable VAAPI if vaapitest() failed, r=gfx-reviewers,aosmond 2022-07-12 01:49:39 +00:00
vr Bug 1771515 - [webxr] Support Oculus Quest2 controllers. r=jgilbert 2022-06-02 05:10:17 +00:00
webrender_bindings Bug 1778622 - Disable video overlay by IDXGISwapChain3::SetColorSpace1() error. r=gfx-reviewers,lsalzman 2022-07-08 23:25:02 +00:00
wgpu_bindings Bug 1770219 - Disallow large buffer allocations. r=jimb 2022-07-08 11:51:55 +00:00
wr Bug 1778150 - Override UV rect for cs_scale when source is external texture. r=gfx-reviewers,nical 2022-07-07 16:38:21 +00:00
ycbcr Bug 1698699 - P7 - add missing include for hybrid builds. r=ng 2022-06-28 16:29:41 +00:00
metrics.yaml Bug 1772223: Add some additional probes for measuring important WebRender internals. r=jrmuizel,chutten 2022-06-08 13:41:19 +00:00
moz.build