Commit Graph

596 Commits

Author SHA1 Message Date
Tom Ritter
4c7e1cff5c Bug 1899874: Plumb forceSoftwareRendering down the stack. r=jgilbert
willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL

Differential Revision: https://phabricator.services.mozilla.com/D212178
2024-08-07 00:31:45 +00:00
Kelsey Gilbert
ef3160faba Bug 1909372 - Remove WebGLContextAttributes.colorSpace. r=gfx-reviewers,webidl,lsalzman,saschanaz
The WebGL spec never added this, and WebGL expects this to change via
drawingBufferColorSpace, so I don't think we should push for a spec
addition for .colorSpace.

Differential Revision: https://phabricator.services.mozilla.com/D217350
2024-07-23 18:02:41 +00:00
Jamie Nicol
1938ca6418 Bug 1898238 - Keep SharedSurface_EGLImages alive but do not recycle them. r=sotaro,jgilbert
We must ensure that a SharedSurface_EGLImage outlives its
corresponding RenderEGLImageTextureHost, so that
RenderEGLImageTextureHost does not attempt to wait on an EGLSync that
has been destroyed. This can be achieved by passing the surface to
RemoteTextureOwnerClient::PushTexture(), ensuring the RemoteTextureMap
keeps it alive.

However, we must be careful not to recycle the SharedSurface_EGLImage,
as that is currently not supported. To achieve this, we make
RemoteTextureMap::RecycleTexture() only recycle SharedSurfaces whose
mDesc.canRecycle value is true.

Differential Revision: https://phabricator.services.mozilla.com/D211292
2024-07-22 20:23:38 +00:00
Iulian Moraru
724263a29c Backed out 5 changesets (bug 1898238) for causing non unified build bustages on RenderEGLImageTextureHost.cpp. CLOSED TREE
Backed out changeset ae8e94c8f819 (bug 1898238)
Backed out changeset 549abd685d11 (bug 1898238)
Backed out changeset 6359e558d765 (bug 1898238)
Backed out changeset 332c668a15bc (bug 1898238)
Backed out changeset 19fa8d4af66f (bug 1898238)
2024-07-22 20:27:45 +03:00
Jamie Nicol
132d7452a5 Bug 1898238 - Keep SharedSurface_EGLImages alive but do not recycle them. r=sotaro,jgilbert
We must ensure that a SharedSurface_EGLImage outlives its
corresponding RenderEGLImageTextureHost, so that
RenderEGLImageTextureHost does not attempt to wait on an EGLSync that
has been destroyed. This can be achieved by passing the surface to
RemoteTextureOwnerClient::PushTexture(), ensuring the RemoteTextureMap
keeps it alive.

However, we must be careful not to recycle the SharedSurface_EGLImage,
as that is currently not supported. To achieve this, we make
RemoteTextureMap::RecycleTexture() only recycle SharedSurfaces whose
mDesc.canRecycle value is true.

Differential Revision: https://phabricator.services.mozilla.com/D211292
2024-07-22 16:02:34 +00:00
Kelsey Gilbert
2fc4d570e3 Bug 1885032 - Support EXT_depth_clamp in webgl. r=gfx-reviewers,webidl,lsalzman,smaug
Differential Revision: https://phabricator.services.mozilla.com/D215713
2024-07-17 21:12:23 +00:00
Cristian Tuns
eaf1eefde7 Backed out 2 changesets (bug 1899874) It is crashing the browser on windows and linux, Bug 1906687. CLOSED TREE
Backed out changeset cd0e7d18bbff (bug 1899874)
Backed out changeset 347c3fe4a18f (bug 1899874)
2024-07-09 17:48:05 -04:00
Sandor Molnar
13c039b842 Backed out changeset 8609f288794c (bug 1885032) for causing mochitest failures @ test_2_conformance__extensions__ext-depth-clamp.html CLOSED TREE 2024-07-04 21:46:19 +03:00
Kelsey Gilbert
ecdd44c7ed Bug 1885032 - Support EXT_depth_clamp in webgl. r=gfx-reviewers,webidl,lsalzman,smaug
Differential Revision: https://phabricator.services.mozilla.com/D215713
2024-07-04 17:47:25 +00:00
Kelsey Gilbert
e11c7fa652 Bug 1906155 - Add pref webgl.1.request_es2:true. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D215665
2024-07-03 18:55:33 +00:00
Tom Ritter
5d0545e0db Bug 1899874: Plumb forceSoftwareRendering down the stack. r=jgilbert
willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL

Differential Revision: https://phabricator.services.mozilla.com/D212178
2024-07-03 08:29:51 +00:00
Stanca Serban
81b1ce4a56 Backed out 20 changesets (bug 1900828, bug 1900863, bug 1902359, bug 1901771, bug 1902671, bug 1901291, bug 1902003, bug 1901799, bug 1897271, bug 1901260, bug 1899874, bug 1903609, bug 1902086, bug 1902364) for causing multiple failures. CLOSED TREE
Backed out changeset 93cd1edda657 (bug 1900828)
Backed out changeset 693209b2919f (bug 1899874)
Backed out changeset b73df6e562de (bug 1899874)
Backed out changeset a93ca984ca88 (bug 1903609)
Backed out changeset 8303598ec6b0 (bug 1903609)
Backed out changeset e3a3c98b34fd (bug 1903609)
Backed out changeset 962fe23bb97a (bug 1903609)
Backed out changeset 00f2e924c9f2 (bug 1903609)
Backed out changeset 0ade4bbe618d (bug 1901291)
Backed out changeset a13f96530518 (bug 1901260)
Backed out changeset 510bc857cdf4 (bug 1902671)
Backed out changeset 754801e10b4b (bug 1902364)
Backed out changeset 7dc2bd362cb9 (bug 1902359)
Backed out changeset 502943b3d954 (bug 1902086)
Backed out changeset 1368337eb6d5 (bug 1902086)
Backed out changeset 0add6564e69b (bug 1902003)
Backed out changeset 929d9508ad19 (bug 1901799)
Backed out changeset 5baeea7c14f6 (bug 1901771)
Backed out changeset 8cf0f72c6a98 (bug 1897271)
Backed out changeset f32d78084462 (bug 1900863)
2024-06-25 16:08:06 +03:00
Tom Ritter
dce3002d08 Bug 1899874: Plumb forceSoftwareRendering down the stack. r=jgilbert
willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL

Differential Revision: https://phabricator.services.mozilla.com/D212178
2024-06-25 11:53:33 +00:00
Andrew McCreight
20fdd90f0f Bug 1838918 - Remove frequent "FuncScope not on stack!" warning. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D212184
2024-06-04 13:45:46 +00:00
Lee Salzman
2b51d84c47 Bug 1894929 - Disable gl::SwapChain's internal pooling when RemoteTextureMap is used. r=jnicol,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210864
2024-05-20 18:21:15 +00:00
Kelsey Gilbert
f72ec6e498 Bug 1885447 - Tonemap/color-manage webgl sdr/wcg output into Display profile as pre-compositor post-process. r=gfx-reviewers,webidl,smaug,ahale
Differential Revision: https://phabricator.services.mozilla.com/D207651
2024-05-06 23:36:51 +00:00
Stanca Serban
8996a6a522 Backed out changeset 995596d4362c (bug 1885447) for causing build bustages in AutoMappable.h. CLOSED TREE 2024-04-23 22:19:00 +03:00
Kelsey Gilbert
7393b7c768 Bug 1885447 - Tonemap/color-manage webgl sdr/wcg output into Display profile as pre-compositor post-process. r=gfx-reviewers,webidl,smaug,ahale
Differential Revision: https://phabricator.services.mozilla.com/D207651
2024-04-23 16:54:05 +00:00
Kelsey Gilbert
e4080e620a Bug 1887335 - Poll=4ms for WebGLSync completion, async-notify child. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D206294
2024-04-02 20:36:25 +00:00
Kelsey Gilbert
ecea021dd3 Bug 1883225 - webgl.texSubImage(video): re-enable gpu-blit for RGBA, and RGB iff RGB8+SRGB8 renderable. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D203698
2024-03-09 05:35:20 +00:00
Jeff Muizelaar
bff9a39458 Bug 1877726. Revert "Bug 1664063 - Ensure we consistently handle all errors from IDXGIKeyedMutex::AcquireSync.".
This reverts commit e25a5f344af32bdd689500bae7b4f24f205ba9f0.

We believe bug 1664063 was causing to hit some broken device reset
handling code.

Differential Revision: https://phabricator.services.mozilla.com/D201658
2024-02-13 04:25:35 +00:00
Kelsey Gilbert
f9468430e1 Bug 1794893 - WebGLMemoryTracker ensured-registered in WebGLContext::ctor. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D200851
2024-02-06 19:34:26 +00:00
Lee Salzman
25a04a247d 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
Lee Salzman
3c808bc246 Bug 1876506 - Check for CopyToSwapChain failure. r=aosmond
CopyToSwapChain was silently failing, causing no texture to get pushed
to RemoteTextureMap, so that when a wait on it was occurring, it would
timeout.

The failure occurred in DrawTargetWebgl::FlushFromSkia, because the
DT's size actually exceeded the value of the texture limit pref when
it was attempting to allocate a temporary texture to blend back a
Skia layer to the WebGL framebuffer. This is fixed by allowing layering
to bypass this limit, as it is always expected that layer blending
succeed.

To guard against future instances of this bug, CopyToSwapChain now returns
a boolean result so that it is fallible and can signal to CanvasTranslator
that it needs to take appropriate fallback measures on failure.

Differential Revision: https://phabricator.services.mozilla.com/D199794
2024-01-27 15:56:04 +00:00
sotaro
f52ae4f4f6 Bug 1875980 - Always notify context lost RemoteTextureOwner in WebGLContext::Present() r=gfx-reviewers,lsalzman
During testing Bug 1863257, there were cases that test failed with timeout in RemoteTextureMap::WaitRemoteTextureReady(). In this case, RemoteTextureOwner was not registered since first Surface allocation was failed at GeckoProcessManager.getSurfaceAllocator().

Even with the case, RemoteTextureOwner should be registered as context lost.

Differential Revision: https://phabricator.services.mozilla.com/D199312
2024-01-23 06:55:02 +00:00
Lee Salzman
899e73a619 Bug 1875193 - Don't recycle SharedSurfaces from different SurfaceFactory. r=sotaro
It looks like we're accidentally putting SharedSurfaces that came from a different
SurfaceFactory back into a different one recycling. This happens because on context
loss in CanvasTranslator, the old GL context may go away, though the RemoteTextureOwnerClient
has a shared recycling bin that might accidentally keep the old surfaces.

This also tries to clear the old recycled surfaces as soon as possible on a context
loss now.

Differential Revision: https://phabricator.services.mozilla.com/D198918
2024-01-18 06:46:51 +00:00
Lee Salzman
2364029b02 Bug 1874534 - Fix DrawTargetWebgl and RemoteTextureMap context loss handling. r=aosmond
When a context loss occurs on DrawTargetWebgl, this may result in a fallback TextureData
being created. Each of these are currently managed by two different RemoteTextureOwnerClients.
This is not really safe at all.

To fix this, CopyToSwapChain is modified so that it can be supplied a RemoteTextureOwnerClient.
Then CanvasTranslator can inject its own RemoteTextureOwnerClient into CopyToSwapChain, rather
than letting CopyToSwapChain use its own separate internal RemoteTextureOwnerClient.

This also tries to address a few other data consistency bugs with the fallback TextureData.

Differential Revision: https://phabricator.services.mozilla.com/D198487
2024-01-13 18:19:24 +00:00
sotaro
c66558645d Bug 1868927 - Remove RemoteTextureHostWrapper's async mode r=gfx-reviewers,lsalzman
By removing the async mode, remote texture implementation becomes simpler.

Differential Revision: https://phabricator.services.mozilla.com/D197323
2024-01-07 22:47:05 +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
c25839df68 Bug 1872087 - Share recycling across WebGL framebuffers on a single context. r=aosmond,gfx-reviewers
This was a change for bug 1872087 that somehow got lost when I was rebasing. The idea
here is that DrawTargetWebgls use a single shared WebGL context, so it makes sense for
them to share recycle texture data, much like CanvasTranslator shares recycling of
texture data for D2D. This should increase the efficiency of use-cases that create and
destroy a lot of canvases every frame and would not normally benefit from recycling.

Depends on D197375

Differential Revision: https://phabricator.services.mozilla.com/D197376
2023-12-28 20:29:58 +00:00
Norisz Fay
85c1b98629 Backed out 3 changesets (bug 1872087, bug 1767344, bug 1872159) for causing gpu related leak failures CLOSED TREE
Backed out changeset 2c0ef884644c (bug 1872087)
Backed out changeset 0cf50076e7ee (bug 1872159)
Backed out changeset a4148511920c (bug 1767344)
2023-12-28 21:24:33 +02:00
Lee Salzman
065613ca66 Bug 1872087 - Share recycling across WebGL framebuffers on a single context. r=aosmond,gfx-reviewers
This was a change for bug 1872087 that somehow got lost when I was rebasing. The idea
here is that DrawTargetWebgls use a single shared WebGL context, so it makes sense for
them to share recycle texture data, much like CanvasTranslator shares recycling of
texture data for D2D. This should increase the efficiency of use-cases that create and
destroy a lot of canvases every frame and would not normally benefit from recycling.

Depends on D197375

Differential Revision: https://phabricator.services.mozilla.com/D197376
2023-12-28 16:31:07 +00:00
Lee Salzman
ab390835ca Bug 1872087 - Share recycled texture data across remote texture owners on a single client. r=sotaro,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D197324
2023-12-27 14:56:24 +00:00
Lee Salzman
69cc2255fd Bug 1829026 - Allow WebGLContext::PushRemoteTexture to specify an explicit pid. r=aosmond
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.

Differential Revision: https://phabricator.services.mozilla.com/D194348
2023-12-18 18:10:45 +00:00
Lee Salzman
f8c05c0396 Bug 1829026 - Allow WebGLContext to work without a host or client wrapper. r=jgilbert,aosmond
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.

Differential Revision: https://phabricator.services.mozilla.com/D194347
2023-12-18 18:10:45 +00:00
Andrew Osmond
90a104b8c5 Bug 1664063 - Ensure we consistently handle all errors from IDXGIKeyedMutex::AcquireSync. r=gfx-reviewers,lsalzman
When we call IDXGIKeyedMutex::AcquireSync, we need to check for a
general failure, WAIT_ABANDONED and WAIT_TIMEOUT. The last two are
special because Microsoft's SUCCEEDED and FAILED macros consider them
successful.

Differential Revision: https://phabricator.services.mozilla.com/D196668
2023-12-18 16:41:54 +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
38a4d8fc90 Bug 1829026 - Allow WebGLContext::PushRemoteTexture to specify an explicit pid. r=aosmond
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.

Differential Revision: https://phabricator.services.mozilla.com/D194348
2023-12-12 07:35:01 +00:00
Lee Salzman
794d964e19 Bug 1829026 - Allow WebGLContext to work without a host or client wrapper. r=jgilbert,aosmond
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.

Differential Revision: https://phabricator.services.mozilla.com/D194347
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
d3f66f907e Bug 1829026 - Allow WebGLContext::PushRemoteTexture to specify an explicit pid. r=aosmond
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.

Differential Revision: https://phabricator.services.mozilla.com/D194348
2023-12-05 09:37:02 +00:00
Lee Salzman
a9d18eacda Bug 1829026 - Allow WebGLContext to work without a host or client wrapper. r=jgilbert,aosmond
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.

Differential Revision: https://phabricator.services.mozilla.com/D194347
2023-12-05 09:37:02 +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
Cosmin Sabou
0cdca790f8 Backed out changeset 1e7d530afef0 (bug 1862039) for causing GLContext related crashes. 2023-11-09 19:27:41 +02:00
Nicolas Silva
523ffeabdb Bug 1862039 - Don't set GL_CONTEXT_FLAG_NO_ERROR_BIT with mesa. r=gfx-reviewers,jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D193053
2023-11-09 16:40:46 +00:00
Kelsey Gilbert
86319b38ea Bug 1841050 - Add pref webgl.gl_khr_no_error:true. r=gfx-reviewers,bradwerth
This allows for disabling WebGL's use of GL_KHR_no_error, rather than the default of enabled.

Use snake_case so that searching for KHR_no_error finds this more
easily.

Differential Revision: https://phabricator.services.mozilla.com/D188781
2023-10-25 00:20:59 +00:00
sotaro
162407e36c Bug 1854541 - Add webgpu::ExternalTexture handling to RemoteTextureMap r=gfx-reviewers,lsalzman
It is a preparation for Bug 1843891.
RemoteTextureMap needs to handle webgpu::ExternalTexture.

Differential Revision: https://phabricator.services.mozilla.com/D188928
2023-09-26 07:17:54 +00:00
sotaro
be652aeaf7 Bug 1851432 - Add error handling to WebGLContext::PushRemoteTexture() r=gfx-reviewers,lsalzman
SharedSurface_DMABUF::ToSurfaceDescriptor() could return Nothing() with error. It needs to be handled as failure.

SharedSurface::ToSurfaceDescriptor() is expected to return Nothing() only with SharedSurface_Basic.

Differential Revision: https://phabricator.services.mozilla.com/D188078
2023-09-14 00:24:42 +00:00