Commit Graph

302 Commits

Author SHA1 Message Date
Kelsey Gilbert
7ea4efbaf1 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
d637e86042 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
5d1f17b38f 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
Kelsey Gilbert
9321a69023 Bug 1655101 - Padded<T,PaddedSize> to paper over mingw-32's smaller sizeof(std::string). r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D197543
2024-01-04 18:38:53 +00:00
Kelsey Gilbert
0ce272935b Bug 1655101 - Allow webgl.texImage gpu-blit for RGB8 if supported. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D194943
2024-01-04 18:38:52 +00:00
Lee Salzman
be8b918d1b 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
cdce9d5ae9 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
5e38cdd61d 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
Andrew Osmond
ed08ff90d5 Bug 1868397 - Make WebGL use VideoBridge to avoid copies with GPUVideoImage. r=jgilbert
This patch makes it so that WebGL that runs in the compositor process
can take advantage of the fact that GPUVideoImage should have an already
created TextureHost between the compositor process and the producing
utility process. For software decoders, this will allow us to avoid a
copy into a shmem from the utility process, and another copy into a
shmem to the compositor process.

Differential Revision: https://phabricator.services.mozilla.com/D195559
2023-12-06 19:31:32 +00:00
Cosmin Sabou
088aba68e8 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
9fefc77110 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
Cosmin Sabou
0db4b6a2ba Backed out changeset 7aa58b8ef68a (bug 1655101) for causing bustages on dom/WebGLIpdl.h. CLOSED TREE 2023-11-30 21:06:53 +02:00
Kelsey Gilbert
b8e33d2390 Bug 1655101 - Allow webgl.texImage gpu-blit for RGB8 if supported. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D194943
2023-11-30 17:40:42 +00:00
Kelsey Gilbert
a010588258 Bug 1855780 - Generate INVALID_ENUM in ProvokingVertex for bad mode. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D193828
2023-11-18 00:03:07 +00:00
Peter Van der Beken
4a7386597a Bug 1849037 - Add ErrorResult to TypedArray::Create. r=necko-reviewers,extension-reviewers,media-playback-reviewers,webidl,profiler-reviewers,farre,padenot,smaug,robwu,jesup,aabh
Differential Revision: https://phabricator.services.mozilla.com/D191418
2023-11-11 08:24:05 +00:00
Peter Van der Beken
6651aa0aff Bug 1849037 - Make TypedArray::Create either take a length or a Span. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D191417
2023-11-11 08:24:04 +00:00
Peter Van der Beken
64b9731b0e Bug 1849037 - Pass objects that support conversion to a Span directly to TypedArray::Create as a Span. r=necko-reviewers,extension-reviewers,media-playback-reviewers,profiler-reviewers,farre,padenot,jesup
Differential Revision: https://phabricator.services.mozilla.com/D191416
2023-11-11 08:24:04 +00:00
Stanca Serban
fa9cf4e6a5 Backed out 3 changesets (bug 1849037) for causing mochitests failures in test_gamepad_extensions.html.
Backed out changeset 27fd9f6f57ea (bug 1849037)
Backed out changeset 89aa49de2473 (bug 1849037)
Backed out changeset c336a8c78928 (bug 1849037)
2023-11-08 17:12:40 +02:00
Peter Van der Beken
d0efcee341 Bug 1849037 - Add ErrorResult to TypedArray::Create. r=necko-reviewers,extension-reviewers,media-playback-reviewers,webidl,profiler-reviewers,farre,padenot,smaug,robwu,jesup
Differential Revision: https://phabricator.services.mozilla.com/D191418
2023-11-08 11:29:05 +00:00
Peter Van der Beken
5c8b0d6910 Bug 1849037 - Make TypedArray::Create either take a length or a Span. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D191417
2023-11-08 11:29:04 +00:00
Peter Van der Beken
5b25b370be Bug 1849037 - Pass objects that support conversion to a Span directly to TypedArray::Create as a Span. r=necko-reviewers,extension-reviewers,media-playback-reviewers,profiler-reviewers,farre,padenot,jesup
Differential Revision: https://phabricator.services.mozilla.com/D191416
2023-11-08 11:29:04 +00:00
Sandor Molnar
3a1231bada Backed out changeset b09d48d2b473 (bug 1655101) for causing mochitest webgl failures on dom/canvas/TexUnpackBlob.cpp 2023-09-26 19:09:49 +03:00
Jamie Nicol
4a2f7a772b Bug 1655101 - Allow blit to GL_RGB texture for webgl texture uploads. r=aosmond
On devices where GL_RGB is a color-renderable format, allow blitting
to GL_RGB textures to implement texture upload. This allows us to stay
on the fast-path when the source data is video and the target texture
format is GL_RGB. In fact, on Android this makes it work at all, as
the slow-path is not actually implemented.

Differential Revision: https://phabricator.services.mozilla.com/D167159
2023-09-26 14:58:09 +00:00
Andrew Osmond
461b1b50c5 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
e664ec3758 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
c3effd7450 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
312137a408 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
Markus Stange
70bd936589 Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
sotaro
31ad5bf633 Bug 1845697 - Always enable IPC congestion check in WebGLChild::FlushPendingCmds() r=jgilbert,gfx-reviewers,lsalzman
IPC congestion check was added by Bug 1839314. It is enabled only when async remote texture is enabled and after first ClientWebGLContext::GetFrontBuffer() call. There were cases that it does not work like the followings.
- ClientWebGLContext::GetFrontBuffer() was not called during IPC congestion.
- When gfx::gfxVars::WebglOopAsyncPresentForceSync() = true.

When the IPC congestion happened, it caused ouf of file descriptor on Linux. Then it is better always to enable the IPC congestion check in WebGLChild::FlushPendingCmds().

Differential Revision: https://phabricator.services.mozilla.com/D184917
2023-08-01 00:18:12 +00:00
sotaro
369536c473 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
Tim Huang
543d9541f0 Bug 1829635 - Introduce RFPTargets for WebGL. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181739
2023-06-27 09:29:14 +00:00
sotaro
881b5464a5 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
sotaro
3e27db98be Bug 1834302 - Add WebGL context lost handling to RemoteTextureMap r=lsalzman,gfx-reviewers
When WebGL context is lost, we could not expect that pending remote texture becomes ready. We do not need to wait the remote texture ready.

Differential Revision: https://phabricator.services.mozilla.com/D180303
2023-06-09 06:48:55 +00:00
Tim Huang
336eee430c Bug 1816189 - Part 4: Add random noise when extracting data from canvas element when canvas randomization is enabled. r=tjr,lsalzman
This patch introduces random noises to data extraction functions of
canvas element and offscreen canvas. The random noise is based on the
random key of the cookieJarSettings and the image data itself.

The random noises would interfere the ability of fingerprinters that
use canvas data to fingerprint users. The random noise will make unique
canvas finerprint to for every browsing session. Therefore, fingerprinter
cannot use canvas fingerprint to tracker individuals across browsing
sessions.

Differential Revision: https://phabricator.services.mozilla.com/D175499
2023-05-08 14:04:35 +00:00
Tim Huang
711f354ff0 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
e5132654ba 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
sotaro
7ee65aa092 Bug 1828088 - Handle wait of async RemoteTexture at WebRenderAPI r=gfx-reviewers,lsalzman
In current m-c, async RemoteTexture wait at RenderThread stops window update when the wait is too long. If async RemoteTexture is handled by WebRenderAPI, window could be updated during long async RemoteTexture wait.

async RemoteTexture wait of root WebRenderBridgeParent are disabled to simplify WebRenderAPI's wait handling.

offscreen canvas case is handled by WebRenderImageHost by Bug 1827578.

Differential Revision: https://phabricator.services.mozilla.com/D175590
2023-04-18 20:38:20 +00:00
Jamie Nicol
443e931b81 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
7ca5d9164c 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
a136c10eb3 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
ac328fe39f 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
9d47482195 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
ecd474bc06 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
4f0c1988f7 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
947ce14974 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
Tom Schuster
5422bb4186 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
Nika Layzell
8c037ef668 Bug 1806709 - Part 2: Clean up some trivial nsIPrincipal helper methods from nsIGlobalObject, r=asuth
These methods only existed because nsIGlobalObject::PrincipalOrNull was not
available off-main-thread, so can now be removed.

Depends on D165198

Differential Revision: https://phabricator.services.mozilla.com/D165199
2022-12-21 15:53:22 +00:00
sotaro
51aa6c3acf Bug 1688020 - Release image of SurfaceDescriptorD3D10 after WebGLContext::TexImage() also with in-process WebGL r=gfx-reviewers,lsalzman
Like Bug 1798624, image of SurfaceDescriptorD3D10  needs to be kept alive until WebGLContext::TexImage() call with in-process WebGL.

Differential Revision: https://phabricator.services.mozilla.com/D165109
2022-12-20 04:25:15 +00:00
Andrew McCreight
0a2c5523a4 Bug 1805931, part 1 - Declare Root and Unroot inline to save on boilerplate. r=smaug
Bug 181137 made ContentIteratorBase no longer refcounted, but
it did not remove this bit of CC boilerplate. With the inline
root, using this macro in a non-refcounted class is an error.

ObjectModel.h and ClientWebGLContext.cpp used macros to define
root and unroot, but that is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D164828
2022-12-15 19:45:00 +00:00
sotaro
7dc86c1c3b 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