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

544 Коммитов

Автор SHA1 Сообщение Дата
Chris Peterson 29300d010e Bug 1846113 - Remove some always-true macOS version checks now that Firefox only supports macOS >= 10.15. r=gfx-reviewers,jgilbert
Also remove mNeedsFakeNoStencil_UserFBs code in WebGLContext.h/cpp that was only needed on Intel macOS <= 10.11.

Differential Revision: https://phabricator.services.mozilla.com/D184880
2023-08-01 05:05:48 +00:00
stransky dc37018740 Bug 1833855 [Linux] Replace kIsX11 and kIsWayland with kIsLinux r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178647
2023-06-22 13:42:39 +00:00
Cristian Tuns ac8a8744d7 Backed out 14 changesets (bug 1833855) for causing build bustages in DMABufSurface.cpp CLOSED TREE
Backed out changeset b8daeb03b670 (bug 1833855)
Backed out changeset cc17af8bae3d (bug 1833855)
Backed out changeset 2d4f6b8ad5d3 (bug 1833855)
Backed out changeset 3b75e59357bb (bug 1833855)
Backed out changeset 86948033f163 (bug 1833855)
Backed out changeset 3e6387b95e39 (bug 1833855)
Backed out changeset 7f22e082786c (bug 1833855)
Backed out changeset 9d5ae056d3c8 (bug 1833855)
Backed out changeset b0a7ca2dfbd6 (bug 1833855)
Backed out changeset ac0947e6e601 (bug 1833855)
Backed out changeset a058367a436a (bug 1833855)
Backed out changeset 7b4da292159c (bug 1833855)
Backed out changeset d50ae530998d (bug 1833855)
Backed out changeset 895b93846598 (bug 1833855)
2023-06-22 08:05:40 -04:00
stransky cdf6d0a8fa Bug 1833855 [Linux] Replace kIsX11 and kIsWayland with kIsLinux r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178647
2023-06-22 11:17:24 +00:00
Cristian Tuns 684fec2fef Backed out 14 changesets (bug 1833855) for causing build bustages in SharedSurface.cpp CLOSED TREE
Backed out changeset c3f7d1963902 (bug 1833855)
Backed out changeset 347c47f5542a (bug 1833855)
Backed out changeset 2c0807d0b39a (bug 1833855)
Backed out changeset 013d1d16194d (bug 1833855)
Backed out changeset 2e49d43a627c (bug 1833855)
Backed out changeset ea21e90a71dd (bug 1833855)
Backed out changeset 8d5d0690668c (bug 1833855)
Backed out changeset 4eb11068275d (bug 1833855)
Backed out changeset 15120d9c5b24 (bug 1833855)
Backed out changeset b75750bb7596 (bug 1833855)
Backed out changeset 6f94e3f002ed (bug 1833855)
Backed out changeset 3235825211f9 (bug 1833855)
Backed out changeset 47a6e9ed8828 (bug 1833855)
Backed out changeset b8013c43aa20 (bug 1833855)
2023-06-22 05:29:12 -04:00
stransky 46005fd4fc Bug 1833855 [Linux] Replace kIsX11 and kIsWayland with kIsLinux r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178647
2023-06-22 08:35:58 +00:00
sotaro ce31ef5433 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
Jeff Muizelaar 5a6b419ed6 Bug 1833030. Don't use native_srgb on Windows. r=jgilbert
There was confusion about the purpose of this pref. Just hard code
it for now.

Differential Revision: https://phabricator.services.mozilla.com/D178355
2023-05-26 01:35:33 +00:00
Kelsey Gilbert 58bc15010f Bug 1804368 - Add webgl.forbid-software/forbid-hardware on Mac. r=gfx-reviewers,lsalzman
I would prefer to leave "this doesn't work on linux/windows/android as open bugs to be handled later.

Differential Revision: https://phabricator.services.mozilla.com/D164016
2023-04-03 21:25:41 +00:00
stransky 626d67ee7b Bug 1809026 [Linux] Implement fast DMABuf WebGL textures upload r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D167240
2023-02-27 11:20:09 +00:00
sotaro d55f5ec846 Bug 1810097 - Support AHardwareBuffer of out-of-process WebGL on Android r=lsalzman,gfx-reviewers
Modify AHardwareBuffer implementation as to support gl::SharedSurface of out-of-process WebGL. And remove unused AHardwareBuffer implementation.

By limiting AHardwareBuffer only in GPU process, AHardwareBuffer implementation becomes simpler. We do not need to handle cross process AHardwareBuffer delivery and cross process android Fence delivery.

Differential Revision: https://phabricator.services.mozilla.com/D167911
2023-01-27 21:35:26 +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
sotaro 44518c888e Bug 1808818 - Add RemoteTextureOwnerClient::PushDummyTexture() for handling remote texture allocation failure r=gfx-reviewers,lsalzman
Push dummy texture when remote texture allocation is failed.

Differential Revision: https://phabricator.services.mozilla.com/D166516
2023-01-11 22:23:01 +00:00
sotaro 954c16acec Bug 1805209 - Use RemoteTexture for WebGPU r=gfx-reviewers,lsalzman
WebGPU uses CompositableInProcessManager to push TextureHost directly from WebGPUParent to WebRender. But CompositableInProcessManager plumbing has a problem and caused Bug 1805209.

gecko already has a similar mechanism, called RemoteTextureMap. It is used in oop WebGL. If WebGPU uses RemoteTextureMap instead of CompositableInProcessManager, both WebGPU and oop WebGL use same mechanism.

WebGPUParent pushes a new texture to RemoteTextureMap. The RemoteTextureMap notifies the pushed texture to WebRenderImageHost.

Before the change, only one TextureHost is used for one swap chain. With the change, multiple TextureHosts are used for one swap chain with recycling.

The changes are followings.

- Use RemoteTextureMap instead of CompositableInProcessManager.
- Use RemoteTextureOwnerId instead of CompositableHandle.
- Use WebRenderCanvasData instead of WebRenderInProcessImageData.
- Add remote texture pushed callback functionality to RemoteTextureMap. With it, RemoteTextureMap notifies a new pushed remote texture to WebRenderImageHost.
- Remove CompositableInProcessManager.

Differential Revision: https://phabricator.services.mozilla.com/D164890
2022-12-23 20:41:02 +00:00
sotaro ad6c294e3c Bug 1794380 - Fix RemoteTexture with WebGL sync present on Android r=gfx-reviewers,lsalzman
The change addressed followings problems.

- Recycling of gl::SharedSurface by RemoteTextureMap is not handled by gl::SwapChain.
- PrepareForUse()/NotifyNotUsed() of remote texture's TextureHost(SurfaceTextureHost) is not handled
- Wrapping of RenderAndroidSurfaceTextureHost by RenderTextureHostWrapper is not handled

PrepareForUse()/NotifyNotUsed() is called based on compositor ref count of TextureHost. Normally TextureHost is wrapped by WebRenderTextureHost, then the WebRenderTextureHost handles PrepareForUse()/NotifyNotUsed(). But in remote texture case, WebRenderTextureHost wraps RemoteTextureHostWrapper. And compositable ref of remote texture's TextureHost is updated within RemoteTextureMap::mMutex. Then PrepareForUse()/NotifyNotUsed() happen outside of WebRenderTextureHost in non compositor thread.

With pref gfx.canvas.accelerated=true, canvas renderings were broken on android emulator. The boroken rendering seemed to happen by GL of android emulator. The boroken rendering did not happen with tests on android hardware.

Differential Revision: https://phabricator.services.mozilla.com/D159261
2022-12-07 12:40:02 +00:00
Kelsey Gilbert e335b58f95 Bug 1801095 - Don't expose webgl_-prefixed uniforms to webgl. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D164007
2022-12-07 02:14:03 +00:00
Botond Ballo 68c71a503c Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Kelsey Gilbert a32dfd5297 Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-13 17:40:43 +00:00
Marian-Vasile Laza 7ec7dec6f1 Backed out changeset f1e6746037f7 (bug 1785925) for causing reftest failures on DCLayerTree.cpp. CLOSED TREE 2022-09-06 23:35:51 +03:00
Kelsey Gilbert 24a9bc97bb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-06 18:36:34 +00:00
Cristian Tuns 3d56a1da28 Backed out changeset b14b975aa6d7 (bug 1785925) for causing build bustages on GLBlitHelper.cpp CLOSED TREE 2022-09-02 20:12:33 -04:00
Kelsey Gilbert 75cccdd5cb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-02 22:15:58 +00:00
Lee Salzman ef71173113 Bug 1787959 - Reset packing state before reading pixels. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D156259
2022-09-02 18:12:14 +00:00
Andrew Osmond 0b66feace8 Bug 1783957 - Part 2. Ensure we can manage LRU WebGL contexts on different threads. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D154171
2022-08-20 17:03:51 +00:00
Andrew Osmond 6b34b549bd Bug 1783957 - Part 1. Fix up thread annotations for WebGLContext's LRU position. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D154170
2022-08-20 17:03:50 +00:00
Kelsey Gilbert f608e1f1e0 Bug 1778808 - Use stricter TiedFields instead of IsTriviallySerializable in WebGL's QueueParamTraits. r=lsalzman,nika
```
// We guarantee our robustness via these requirements:
// * Object.MutTiedFields() gives us a tuple,
// * where the combined sizeofs all field types sums to sizeof(Object),
//   * (thus we know we are exhaustively listing all fields)
// * where feeding each field back into ParamTraits succeeds,
// * and ParamTraits is only automated for BytesAlwaysValidT<T> types.
// (BytesAlwaysValidT rejects bool and enum types, and only accepts int/float
// types, or array or std::arrays of such types)
// (Yes, bit-field fields are rejected by MutTiedFields too)
```

BytesAlwaysValidT<T> is the same as the IsTriviallySerializable<T> that
it replaces, however the emphasis is different, and should discourage
tagging structs as IsTriviallySerializable, since they more clearly
aren't BytesAlwaysValid.

Differential Revision: https://phabricator.services.mozilla.com/D151676
2022-08-09 21:01:55 +00:00
Lee Salzman 2273a39e73 Bug 1781064 - Get buffer size directly from BufferTextureData. r=aosmond,gfx-reviewers
Since the BufferTextureData is getting created based on ImageDataSerialize::ComputeRGBBufferSize,
the stride may be padded for alignment which doesn't agree with the simple calculation duplicated
here. In general, it is less error-prone to just ask the BufferTextureData itself for its buffer
size, so just do that here instead rather than trying to make duplicate calculations with invalid
assumptions.

Differential Revision: https://phabricator.services.mozilla.com/D153868
2022-08-05 18:48:48 +00:00
Iulian Moraru 27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Kelsey Gilbert 5702c0640c Bug 1771374 - Use {bool, T} instead of Maybe<T> for now. r=gfx-reviewers,lsalzman
`Maybe` isn't is_trivially_copyable, and std::optional isn't either on
the old libstdc++ we use from gcc7 still.

I'm working on more robust approach to serialization but that's beyond
the scope of this bug.

Differential Revision: https://phabricator.services.mozilla.com/D151421
2022-08-01 19:49:28 +00:00
Kelsey Gilbert fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
Narcis Beleuzu dce2ae28ba Merge Mozilla-Central to autoland on a CLOSED TREE 2022-07-14 00:55:03 +03:00
Narcis Beleuzu a9e7761934 Backed out 4 changesets (bug 1771374) for causing Google docs and maps rendering regressions. a=backout
Backed out changeset 9c65411d1843 (bug 1771374)
Backed out changeset 9f5cf953fcc8 (bug 1771374)
Backed out changeset 8b39f60971e4 (bug 1771374)
Backed out changeset ef52a6c462b6 (bug 1771374)
2022-07-14 00:43:56 +03:00
Lee Salzman 911d479aa2 Bug 1779410 - Ensure SwapChainPresenter destructor is called before we access the front buffer. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D151732
2022-07-13 17:27:03 +00:00
Kelsey Gilbert 05864ec823 Bug 1771374 - Use {bool, T} instead of Maybe<T> for now. r=gfx-reviewers,lsalzman
`Maybe` isn't is_trivially_copyable, and std::optional isn't either on
the old libstdc++ we use from gcc7 still.

I'm working on more robust approach to serialization but that's beyond
the scope of this bug.

Differential Revision: https://phabricator.services.mozilla.com/D151421
2022-07-12 23:55:51 +00:00
Kelsey Gilbert 8eb05ff04b Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-07-12 23:55:50 +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
smolnar 3fa084ce2f Backed out 3 changesets (bug 1771374) for causing build bustage in gfx/gl/gtest/TestColorspaces.cpp CLOSED TREE
Backed out changeset 4d01f260c43a (bug 1771374)
Backed out changeset fc62679f0a6c (bug 1771374)
Backed out changeset f4f12470f8b7 (bug 1771374)
2022-06-30 21:19:17 +03:00
Kelsey Gilbert bb48a57a8a Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-30 17:56:26 +00:00
criss d5ece910a9 Backed out 3 changesets (bug 1771374) for causing bustages on Colorspaces.h. CLOSED TREE
Backed out changeset 498c27656dc3 (bug 1771374)
Backed out changeset 6f97bc39643f (bug 1771374)
Backed out changeset b4fdb70808b6 (bug 1771374)
2022-06-30 05:28:11 +03:00
Kelsey Gilbert c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +00:00
criss efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +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
sotaro 8a8d04cce2 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 05:05:47 +00:00
Andrew Osmond 3676efda31 Bug 1769739. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146842
2022-06-22 22:43:15 +00:00
Kelsey Gilbert edaf0ffd31 Bug 1703654 - Deal with Maybe<> not trivially_copyable on build-linux64-base-toolchains. r=gfx-reviewers,lsalzman
Start moving away from manual (risky!) IsTriviallySerializable<>.

Differential Revision: https://phabricator.services.mozilla.com/D145252
2022-05-02 23:54:10 +00:00
Kelsey Gilbert e722cdd3ed Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio,webidl,smaug
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-05-02 23:54:09 +00:00
Csoregi Natalia 9a8af5a95a Backed out changeset 718ead395698 (bug 1703654) for causing bustage on IPCMessageUtils.h. CLOSED TREE 2022-04-29 00:38:28 +03:00
Kelsey Gilbert c3a7e39783 Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-04-28 19:12:08 +00:00