Граф коммитов

136 Коммитов

Автор SHA1 Сообщение Дата
Lee Salzman f07311c7ab Bug 1877010 - Track forwarder transaction ids for RemoteTextureMap with WebGL and WebGPU. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D199876
2024-01-30 15:44:04 +00:00
Kelsey Gilbert d863a61ba5 Bug 1876818 - ClientWebGLContext::Run serialization now coerces to HostWebGLContext arg types. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D199768
2024-01-30 00:15:10 +00:00
Stanca Serban f5f63e51c6 Backed out changeset 7b7eadc28250 (bug 1876818) for causing hazard-linux bustage in ClientWebGLContext.h. CLOSED TREE 2024-01-27 09:55:16 +02:00
Kelsey Gilbert b57a1adbad Bug 1876818 - ClientWebGLContext::Run serialization now coerces to HostWebGLContext arg types. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D199768
2024-01-27 02:46:24 +00:00
Lee Salzman 2215011b5e Bug 1829026 - Remove unused ClientWebGLContext local extensions. r=jgilbert,aosmond
DrawTargetWebgl is transitioning away from using ClientWebGLContext, so
local extensions that were added to support that use-case are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D194346
2023-12-18 18:10:44 +00:00
Sebastian Hengst 4d6a5b9742 Backed out 10 changesets (bug 1829026) for causing bug 1869760 and bug 1869738. a=backout
Backed out changeset 4c619422efe5 (bug 1829026)
Backed out changeset 77da89c7dab7 (bug 1829026)
Backed out changeset 19d28d8f75a4 (bug 1829026)
Backed out changeset 674b60ba54b1 (bug 1829026)
Backed out changeset 31935f164ef0 (bug 1829026)
Backed out changeset 13c9bf69085f (bug 1829026)
Backed out changeset 330a6732fc0b (bug 1829026)
Backed out changeset 974c08a3791b (bug 1829026)
Backed out changeset 3ba040642ddc (bug 1829026)
Backed out changeset 9d9b3a68858c (bug 1829026)
2023-12-13 19:20:00 +01:00
Lee Salzman a2f06c0392 Bug 1829026 - Remove unused ClientWebGLContext local extensions. r=jgilbert,aosmond
DrawTargetWebgl is transitioning away from using ClientWebGLContext, so
local extensions that were added to support that use-case are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D194346
2023-12-12 07:35:01 +00:00
Cosmin Sabou 6f5d4853e5 Backed out 8 changesets (bug 1829026) for causing several mochitest failures. CLOSED TREE
Backed out changeset 790ba6aa65e4 (bug 1829026)
Backed out changeset 2ff1f5f41380 (bug 1829026)
Backed out changeset de6ddf5eb2a7 (bug 1829026)
Backed out changeset 773e7b31ac6e (bug 1829026)
Backed out changeset e09602ab096d (bug 1829026)
Backed out changeset fe16d4ac1049 (bug 1829026)
Backed out changeset c0fe0aea86c2 (bug 1829026)
Backed out changeset 53d6f69055f1 (bug 1829026)
2023-12-05 16:08:36 +02:00
Lee Salzman c14ed2a57d Bug 1829026 - Remove unused ClientWebGLContext local extensions. r=jgilbert,aosmond
DrawTargetWebgl is transitioning away from using ClientWebGLContext, so
local extensions that were added to support that use-case are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D194346
2023-12-05 09:37:01 +00:00
Andrew Osmond 34f04947f7 Bug 1781526 - Implement means to use VideoFrame with WebGL. r=webidl,smaug,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D181118
2023-09-20 22:40:24 +00:00
Peter Van der Beken 627ac90e0c Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-20 09:42:02 +00:00
Cosmin Sabou 680b4364c7 Backed out 13 changesets (bug 1690111) for causing fetch related crashes.
Backed out changeset 5f2c25d194ad (bug 1690111)
Backed out changeset 76c408bcd053 (bug 1690111)
Backed out changeset 6d0649fdafff (bug 1690111)
Backed out changeset c1330b5e8c43 (bug 1690111)
Backed out changeset 5fa36d8fd2a5 (bug 1690111)
Backed out changeset daf7d747853a (bug 1690111)
Backed out changeset f70e09a7f5c6 (bug 1690111)
Backed out changeset 40c6d6eed7f8 (bug 1690111)
Backed out changeset 692f2a759573 (bug 1690111)
Backed out changeset 7140866dd9f6 (bug 1690111)
Backed out changeset 2865fe682139 (bug 1690111)
Backed out changeset 9dcd2416f8a5 (bug 1690111)
Backed out changeset 9c411bf84079 (bug 1690111)
2023-09-11 17:55:24 +03:00
Peter Van der Beken 5738c01ba3 Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-11 12:52:20 +00:00
sotaro 50ab537300 Bug 1839314 - Force sync IPC if there are many flushed cmds without calling ClientWebGLContext::GetFrontBuffer() r=ipc-reviewers,nika,gfx-reviewers,lsalzman
There were cases that a lot of cmds messages were sent by WebGLChild::FlushPendingCmds() without calling ClientWebGLContext::GetFrontBuffer(). And the IPC messages were waiting to be handled by WebGLParent, since OpenGL handling could take longer. Then there were cases that pending IPC messages were accumulated and it caused out of file descriptor on Linux. The sync IPC could reduce the pending IPC messages if there are a lot of cmds flashes.

async Ping is used for checking if IPC message is congested at WebGLParent. If a count of flushes since last congestion check reaches maybeIPCMessageCongestion, we think that IPC message is congested at WebGLParent. Then send sync SyncPing message to flush pending IPC messages.

Differential Revision: https://phabricator.services.mozilla.com/D181484
2023-06-27 18:23:41 +00:00
sotaro 1ca2772206 Bug 1831548 - Force sync IPC if there are many flushed cmds between GetFrontBuffer() r=gfx-reviewers,lsalzman
Enabling async remote texture removes sync IPC PWebGLChild::SendGetFrontBuffer(). With the change, there are cases that pending IPC messages are accumulated and it caused out of file descriptor. The sync IPC SendGetFrontBuffer() could reduce the pending IPC messages if there are a lot of cmds flashes.

Differential Revision: https://phabricator.services.mozilla.com/D181033
2023-06-15 08:41:57 +00:00
Tim Huang d72f344231 Bug 1816189 - Part 3: Moving ShouldResistFingerprinting() to nsICanvasRenderingContextInternal from ClientWebCLContext and add a RFPTarget as an input argument. r=tjr,lsalzman
This patch moves ShouldResistFingerprinting() and add a RFPTarget as
input argument. We will use this function to check if canvas
fingerprinting protection is enabled.

We also modify the caller to pass the right RFPTarget for Canvas image
data extraction prompt. Note that, we need to set the default argument
for the function to known because it's used for WebGL fingerprinting
protection too. However, We don't cut over this part in this patch and
will do it in a future bug.

Differential Revision: https://phabricator.services.mozilla.com/D175608
2023-05-08 14:04:34 +00:00
Kelsey Gilbert 1741f9c46a Bug 1829756 - E.g. DeleteTexture in ~WebGLTextureJS. r=gfx-reviewers,lsalzman
Otherwise GCing will not release them.

Differential Revision: https://phabricator.services.mozilla.com/D176828
2023-05-01 20:20:23 +00:00
Kelsey Gilbert f11a202eea Bug 1826678 - Add webgpu CanvasContext.canvas backlink. r=gfx-reviewers,webidl,jimb,smaug,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D174831
2023-04-13 19:15:00 +00:00
Jamie Nicol 942a3f5367 Bug 1826134 - Avoid interleaving glBufferSubData calls with draw calls in DrawTargetWebgl. r=gfx-reviewers,jgilbert,lsalzman
DrawTargetWebgl renders a path by uploading vertex data to the back of
a large VBO using glBufferSubData then issuing a draw call, orphaning
the buffer when it becomes full. This results in many glBufferSubData
calls being interleaved with draw calls. On Mali GPUs this causes
severe performance issues as the driver is unable to determine that
any pending draw calls do not reference the updated region of the
buffer, and therefore must create a copy of the buffer for each
update.

However, since *we* know that we never overwrite a region that is
referenced by a submitted draw call, we can force the driver to avoid
making these copies. We do so by adding a new function
UnsynchronizedBufferSubData(), which acts like BufferSubData so long
as this rule is followed. Internally, this uses glMapBufferRange with
GL_MAP_UNSYNCHRONIZED_BIT, allowing the driver to omit the extraneous
copies.

Differential Revision: https://phabricator.services.mozilla.com/D174685
2023-04-07 07:25:50 +00:00
Kelsey Gilbert 40d1327d04 Bug 1822867 - Only generate "ClientWaitSync not ready yet" warning after 100th time. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D172806
2023-04-03 21:23:30 +00:00
Kelsey Gilbert 7a17e909ef Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-04-01 00:33:25 +00:00
Noemi Erli c41e3f4330 Backed out changeset bc8c5f1973ff (bug 1825673) for causing mochitest failures in test_GridElementWidthResizer.html CLOSED TREE 2023-03-31 23:14:09 +03:00
Kelsey Gilbert 91a9368bb8 Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-03-31 18:48:20 +00:00
Kelsey Gilbert eaf3360db2 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-21 18:05:09 +00:00
Cristina Horotan 34c1361f96 Backed out changeset 7657d29cd872 (bug 1812932) for causing bc failures at browser_view_image.js CLOSED TREE 2023-03-07 09:26:40 +02:00
Kelsey Gilbert 0f88607820 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-07 04:52:04 +00:00
Jeff Muizelaar 3a46da3d80 Bug 1803375. Use different coordinates when running on AMD. r=lsalzman,jgilbert
This updates the version wpf-gpu-raster which adds support for
GPUs/drivers that use truncation instead of rounding when converting
vertices to fixed point.

It also adds the GL vendor to InitContextResult so that we can detect
AMD on macOS and tell wpf-gpu-raster that truncation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D167503
2023-01-27 01:45:17 +00:00
Tom Schuster ca628bdcc0 Bug 1810489 - Do more precise RFP checks in WebGL. r=gfx-reviewers,nical,tjr
Depends on D166897

Differential Revision: https://phabricator.services.mozilla.com/D166898
2023-01-18 08:19:49 +00:00
sotaro 02d18ed8c1 Bug 1776885 - Add capability of async remote texture on WebGL if CanvasRenderThread is used r=gfx-reviewers,lsalzman
The remote texture is processed asynchronously, but the WebGL rendering results are rendered synchronously with WebRender transaction by WebRender.

Async remote texture support is enabled only when CanvasRenderThread is used. This is to simplify implementation.

In async mode, remote texture of current RemoteTextureId might not be created yet when WebRenderImageHost::UseRemoteTexture() is called. In this case, RemoteTextureHostWrapper uses its own external image ID, otherwise the RemoteTextureHostWrapper uses compatible old remote texture for creating wr display list. RenderTextureHostWrapper calls RemoteTextureMap::GetExternalImageIdOfRemoteTextureSync() before is ussage. The GetExternalImageIdOfRemoteTextureSync() synchronously waits until remote texture becomes ready. The wait works since WebGL IPC handling is always done in CanvasRenderThread in async mode.

PWebGLChild::SendGetFrontBuffer() triggers sync IPC. It is called to ensure the compatible remote texture in RemoteTextureMap during RemoteTextureMap::GetRemoteTextureForDisplayList() call.

Differential Revision: https://phabricator.services.mozilla.com/D162971
2022-12-07 02:24:57 +00:00
Stanca Serban d0ad6a0b22 Backed out changeset d78a41db7a82 (bug 1776885) for causing reftests failures in ReleaseCompositableRef. CLOSED TREE 2022-12-06 17:34:12 +02:00
sotaro e23cea6ac1 Bug 1776885 - Add capability of async remote texture on WebGL if CanvasRenderThread is used r=gfx-reviewers,lsalzman
The remote texture is processed asynchronously, but the WebGL rendering results are rendered synchronously with WebRender transaction by WebRender.

Async remote texture support is enabled only when CanvasRenderThread is used. This is to simplify implementation.

In async mode, remote texture of current RemoteTextureId might not be created yet when WebRenderImageHost::UseRemoteTexture() is called. In this case, RemoteTextureHostWrapper uses its own external image ID, otherwise the RemoteTextureHostWrapper uses compatible old remote texture for creating wr display list. RenderTextureHostWrapper calls RemoteTextureMap::GetExternalImageIdOfRemoteTextureSync() before is ussage. The GetExternalImageIdOfRemoteTextureSync() synchronously waits until remote texture becomes ready. The wait works since WebGL IPC handling is always done in CanvasRenderThread in async mode.

PWebGLChild::SendGetFrontBuffer() triggers sync IPC. It is called to ensure the compatible remote texture in RemoteTextureMap during RemoteTextureMap::GetRemoteTextureForDisplayList() call.

Differential Revision: https://phabricator.services.mozilla.com/D162971
2022-12-06 13:56:19 +00:00
Lee Salzman cb9096e766 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 08:06:44 +00:00
Iulian Moraru f838c68136 Backed out 3 changesets (bug 1799402) for causing windows build bustages. CLOSED TREE
Backed out changeset e51cd76008ef (bug 1799402)
Backed out changeset 3ff660b475ff (bug 1799402)
Backed out changeset 9cfa7581565e (bug 1799402)
2022-11-12 08:33:24 +02:00
Lee Salzman bea9f37e42 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 05:42:30 +00:00
sotaro 6b45a3fe5d Bug 1795050 - Set mResetLayer = true in ClientWebGLContext::Event_webglcontextrestored() r=gfx-reviewers,lsalzman
There was still a timing that hit the assert. When ClientWebGLContext::Event_webglcontextrestored() was called just before ClientWebGLContext::UpdateWebRenderCanvasData() the assert was failed.

Differential Revision: https://phabricator.services.mozilla.com/D161243
2022-11-05 04:14:31 +00:00
Kelsey Gilbert 4e7b4b5647 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-16 22:52:40 +00:00
Iulian Moraru b3fd738eb1 Backed out 2 changesets (bug 1794956) for causing wpt failures on offscreencanvas.transfer.to.imagebitmap.html. CLOSED TREE
Backed out changeset 7b3067b086e6 (bug 1794956)
Backed out changeset 3abcf6ccf88a (bug 1794956)
2022-10-15 19:09:01 +03:00
Kelsey Gilbert 4253cbe5b3 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-15 09:01:46 +00:00
Kelsey Gilbert 2853c1d91c Bug 1795372 - Keepalive mNotLost within FuncScope. r=gfx-reviewers,lsalzman
Also remove unused FuncScopeId.

Differential Revision: https://phabricator.services.mozilla.com/D159428
2022-10-14 23:10:19 +00:00
Kelsey Gilbert 61dc37049b Bug 1795193 - Remove unused chrome-only API MozGetIPCContext. r=gfx-reviewers,jrmuizel,emilio
And also remove SetIsIPC.

Differential Revision: https://phabricator.services.mozilla.com/D159351
2022-10-14 18:02:28 +00:00
Olli Pettay 93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Lee Salzman 4a88a37cf6 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 09:25:35 +00:00
Bogdan Szekely 8702a09262 Backed out changeset 458aae4c5d0a (bug 1777872) for causing mochitest failures on Shmem.cpp CLOSED TREE 2022-07-12 12:03:35 +03:00
Lee Salzman 72406ec267 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 08:32:40 +00:00
Lee Salzman 2d7d1de46e Bug 1779010 - Rely on WebGL zero initializing buffers in DrawTargetWebgl. r=aosmond,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151511
2022-07-12 08:11:06 +00:00
Cristian Tuns 452dd9b5cf Backed out changeset 2c17688069a7 (bug 1777872) for causing mochitest failures in browser_rules_flexbox-highlighter-on-mutation.js CLOSED TREE 2022-07-12 03:44:25 -04:00
Lee Salzman 0e9626ea47 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 07:00:05 +00:00
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
sotaro a807c798e9 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 09:32:29 +00:00
Norisz Fay f70f5a4b0f Backed out changeset af98fb4ff148 (bug 1712486) for causing build bustages on LayersSurfaces CLOSED TREE 2022-06-29 09:06:45 +03:00