Commit Graph

2548 Commits

Author SHA1 Message Date
sotaro
7d06300567 Bug 1861605 - Use IDXGIResource1::CreateSharedHandle() instead of IDXGIResource::GetSharedHandle() r=gfx-reviewers,lsalzman
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().

The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.

HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.

Differential Revision: https://phabricator.services.mozilla.com/D192173
2023-12-19 09:23:21 +00:00
Lee Salzman
772134201a Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-18 18:10:46 +00:00
Andrew Osmond
9850d508cd 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
Jamie Nicol
e757333eb9 Bug 1869569 - Avoid CompositorOGL::BeginFrame's glInvalidateFramebuffer optimization on Xclipse 920 GPU. r=gfx-reviewers,nical
In CompositorOGL (used by software webrender on Android) as an
optimization we use glInvalidateFramebuffer rather than glClear for
the color attachment if there is no non-opaque invalid region. This
causes rendering glitches on the Samsung Xclipse 920 GPU. This patch
marks GLfeature::invalidate_framebuffer as unsupported on this GPU,
causing us to fall back to the glClear pach which avoids the glitches.

Differential Revision: https://phabricator.services.mozilla.com/D196416
2023-12-14 14:07:20 +00:00
Jamie Nicol
d20809a078 Bug 1866020 - Override buggy colorspace conversion on Pixel devices. r=gw,padenot,geckoview-reviewers,owlish
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.

When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.

This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.

Differential Revision: https://phabricator.services.mozilla.com/D195800
2023-12-14 10:45:08 +00:00
Butkovits Atila
fcac574890 Merge autoland to mozilla-central. a=merge 2023-12-13 23:40:45 +02: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
Jamie Nicol
3104637fd7 Bug 1868825 - Leak EGLDisplays on Samsung S22 devices. r=gfx-reviewers,nical,ahale
We are seeing crashes on the european Samsung S22 family of devices in
eglTerminate after updating to Android 14. To work around this we
deliberately leak the EGLDisplay on affected devices. In practice we
only ever use the default EGLDisplay on Android, and calling
eglInitialize multiple times is allowed, so this is fine.

Note this only occurs when running webgl in the content process, which
will occur naturally following enough GPU process crashes that we
disable the GPU process. When webgl is running in the GPU process
webrender keeps the EGLDisplay alive, meaning we never terminate it.

Differential Revision: https://phabricator.services.mozilla.com/D196146
2023-12-13 11:29:18 +00:00
Stanca Serban
7639e8a620 Backed out changeset 5105ca2d1171 (bug 1868825) for causing bp-nu bustages in GLLibraryEGL.h. CLOSED TREE 2023-12-13 12:29:58 +02:00
Narcis Beleuzu
4211076193 Backed out changeset 290917deea87 (bug 1866020) for wrench bustages. CLOSED TREE 2023-12-13 11:49:40 +02:00
Jamie Nicol
4bc580f7c5 Bug 1868825 - Leak EGLDisplays on Samsung S22 devices. r=gfx-reviewers,nical,ahale
We are seeing crashes on the european Samsung S22 family of devices in
eglTerminate after updating to Android 14. To work around this we
deliberately leak the EGLDisplay on affected devices. In practice we
only ever use the default EGLDisplay on Android, and calling
eglInitialize multiple times is allowed, so this is fine.

Note this only occurs when running webgl in the content process, which
will occur naturally following enough GPU process crashes that we
disable the GPU process. When webgl is running in the GPU process
webrender keeps the EGLDisplay alive, meaning we never terminate it.

Differential Revision: https://phabricator.services.mozilla.com/D196146
2023-12-13 09:39:59 +00:00
Jamie Nicol
96a8082a23 Bug 1866020 - Override buggy colorspace conversion on Pixel devices. r=gw,padenot,geckoview-reviewers,owlish
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.

When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.

This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.

Differential Revision: https://phabricator.services.mozilla.com/D195800
2023-12-13 09:06:29 +00:00
Lee Salzman
07a5849be8 Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-12 07:35:02 +00:00
sotaro
86d050de4e Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-09 11:55:15 +00:00
Stanca Serban
b57f879b5e Backed out changeset 54e35266f616 (bug 1866412) for causing bp-nu bustages in RenderD3D11TextureHost.cpp. CLOSED TREE 2023-12-08 11:00:31 +02:00
sotaro
3e3409b160 Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-08 05:13:57 +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
4cf322976a Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-05 09:37:02 +00:00
Sylvestre Ledru
ef35fa7374 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
clang-format version 17.0.6 (taskcluster-QueHFUviQeyM8Y7r_d7MQQ)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D195397
2023-12-04 10:09:36 +00:00
Cosmin Sabou
36061c2d62 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
f69f941a95 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
Ashley Hale
8c0266380b Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-29 21:45:27 +00:00
Butkovits Atila
fe1644b3dc Backed out changeset 8d11a3a0d707 (bug 1843782) for causing failures complaining about RemoteProcessMonitor . CLOSED TREE 2023-11-29 05:51:34 +02:00
Ashley Hale
5fed10025e Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-29 02:15:17 +00:00
Sandor Molnar
3b95748905 Backed out changeset c1e95a42b8d7 (bug 1843782) for causing gv-junit-fis failures. CLOSED TREE 2023-11-28 02:31:02 +02:00
Ashley Hale
5150f6a2bf Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-27 23:25:14 +00:00
sotaro
916658f69e Bug 1865991 - Allocate ID3D11Texture2D in SharedSurface_ANGLEShareHandle::Create() r=gfx-reviewers,lsalzman
In current gecko, SharedSurface_ANGLEShareHandle requests ANGLE to allocate ID3D11Texture2D. But Bug 1865984 and Bug 1861605 requests to change D3D11_TEXTURE2D_DESC::MiscFlags. To do it, the ID3D11Texture2D needs to be allocated by SharedSurface_ANGLEShareHandle.

Differential Revision: https://phabricator.services.mozilla.com/D194332
2023-11-23 00:28:09 +00:00
sotaro
b0e7e3f3ea Bug 1865986 - Remove ScopedLockTexture r=gfx-reviewers,lsalzman
ScopedLockTexture is not used.

Differential Revision: https://phabricator.services.mozilla.com/D194330
2023-11-22 08:04:52 +00:00
stransky
61f8c45661 Bug 1856560 [Wayland] Rename SavedGLSurface to WaylandOffscreenGLSurface r=lsalzman
Depends on D190152

Differential Revision: https://phabricator.services.mozilla.com/D193545
2023-11-15 08:54:58 +00:00
stransky
f84a5585aa Bug 1856560 Implement GLContextEGL::DestroySurface() and use to release EGL surfaces r=lsalzman
Use sigle point of release for EGL surfaces (GLContextEGL::DestroySurface()) and also release Wayland related structures here.

Differential Revision: https://phabricator.services.mozilla.com/D190152
2023-11-15 08:54:58 +00:00
Andrew Osmond
10a47bd453 Bug 1863367 - Part 2. Refactor ReadPixelsIntoDataSurface to allow reading into buffers. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D192884
2023-11-14 02:04:04 +00:00
Makoto Kato
36497ee57a Bug 1858843 - Remove pre-Lollipop code from C/C++. r=geckoview-reviewers,media-playback-reviewers,padenot,owlish,jnicol
Differential Revision: https://phabricator.services.mozilla.com/D191602
2023-11-09 17:39:59 +00:00
Andrew Osmond
1744ad88d1 Bug 1859591 - Add gfxCriticalNote when failing to load EGL/GLES DLLs on Windows. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D191206
2023-10-17 19:37:23 +00:00
Cristian Tuns
611c19c49e Backed out changeset a484de713258 (bug 1859591) for causing build bustages in GLLibraryEGL.cpp CLOSED TREE 2023-10-17 13:43:17 -04:00
Andrew Osmond
c768201685 Bug 1859591 - Add gfxCriticalNote when failing to load EGL/GLES DLLs on Windows. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D191206
2023-10-17 16:06:34 +00:00
sotaro
4e0db835b2 Bug 1855598 - Split GpuProcessD3D11TextureMap class to its own file r=gfx-reviewers,lsalzman
Preparation for Bug 1855277.

Differential Revision: https://phabricator.services.mozilla.com/D189448
2023-09-28 05:07:06 +00:00
Sandor Molnar
deca8deb21 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
7f0f3aa199 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
954f36d2de Bug 1850259. r=lsalzman,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D188617
2023-09-19 20:08:48 +00:00
Mike Hommey
9331b9fb07 Bug 1851529 - Set clang-format ColumnLimit consistently. r=sylvestre,necko-reviewers,kershaw
For some reason, its value in the Google style we use is 80... except
for Objective-C, where it's 100, which led to things like:
https://hg.mozilla.org/mozilla-central/rev/31bf68247e6e
https://hg.mozilla.org/mozilla-central/rev/64ceb33533a4.

There's probably a discussion to have about whether 80 is the right
limit, but since it's what's used for everything except ObjC, let's roll
with it.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D187409
2023-09-05 11:23:01 +00:00
Masatoshi Kimura
26001e8973 Bug 1843681 - Remove dead code from gfx/gl/GLLibraryEGL.cpp. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D183101
2023-08-16 12:25:30 +00:00
sotaro
2cae2b6402 Bug 1847665 - Reduce SyncObjectD3D11Host::Synchronize() call in RenderCompositorANGLE::BeginFrame() r=gfx-reviewers,lsalzman
SyncObjectD3D11Host::Synchronize() could spend time when GPU is busy.
The Synchronize() call is not necessary when all RenderDXGITextureHosts have GpuProcessTextureId or KeyedMutex.

Differential Revision: https://phabricator.services.mozilla.com/D185619
2023-08-08 04:50:54 +00:00
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
Masatoshi Kimura
df85c08d7f Bug 1842497 - Unship d3dcompiler_47.dll. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183100
2023-07-15 12:29:51 +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
stransky
be6d95b423 Bug 1833855 [Linux] Build dmabuf support on Linux/Gtk and don't request Wayland for it r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178634
2023-06-22 13:42:38 +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
stransky
8753e5afaf Bug 1833855 [Linux] Build dmabuf support on Linux/Gtk and don't request Wayland for it r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178634
2023-06-22 11:17:23 +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