3211 Commits

Author SHA1 Message Date
Nicolas Silva
928305487e Bug 1973975 - Ensure that glMakeCurrent is called when rendering without presenting. r=gfx-reviewers,aosmond a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D255987
2025-07-10 13:19:41 +00:00
Erich Gubler
f04e931425 Bug 1973947 - revert removal of remove_dir_all crate a=pascalc
Bug 1959801 removed the `remove_dir_all` crate. However, there was a regression we didn't discover until Firefox 140 reached stable: third-party DLL injection on Windows caused problems for the call sites that had had usages of `remove_dir_all::remove_dir_all` replaced with `std::fs::remove_dir_all`!

DLL injection by third parties were causing these crashes because they incorrectly detour calls to `NtOpenFile`, crashing with Rust's current usage of it in `std::fs::remove_dir_all`. The issue has been reported upstream as [rust#143078], and a mitigation is in place in Rust's Nightly release channel. At time of writing this patch message, the fix is projected to become available in a stable Rust toolchain with version 1.90—roughly 11 weeks away.

[rust#143078]: https://github.com/rust-lang/rust/issues/143078#issue-3181510282

After considering multiple mitigation options, this patch represents the decision of some stakeholders (@gstoll, @dmeehan, @yjuglaret, @gsvelto, @leggert, @ErichDonGubler) to mitigate the issue by directly backing out the patch for bug 1959801. The current plan is to eventually remove `remove_dir_all` again, once Rust 1.90 becomes the minimum supported version for `mozilla-central` (see bugs linked against bug 1973947 for more details), thus guaranteeing that our usage of `std::fs::remove_dir_all` is robust against this issue.

We may or may not engage with third parties to fix DLL injection; it has
not been decided at this time.

Original Revision: https://phabricator.services.mozilla.com/D256027

Differential Revision: https://phabricator.services.mozilla.com/D256040
2025-07-04 06:42:12 +00:00
Markus Stange
9cff078efd Bug 1969253 - Call PostRender on all execution paths where PreRender was called. a=RyanVM
Calling PreRender twice without a PostRender call in between causes us to hit a deadlock.
BeginFrame can return false when called for windows that are still in the process of
being opened, during which time they return a size of 0x0.

A new early return without a PostRender call was added in https://phabricator.services.mozilla.com/D245565 .

Original Revision: https://phabricator.services.mozilla.com/D252243

Differential Revision: https://phabricator.services.mozilla.com/D252346
2025-06-03 18:29:40 +00:00
Sylvestre Ledru
01c27257dc Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers,whimboo
Updated with rustfmt 1.8.0-stable (17067e9ac6 2025-05-09)

Differential Revision: https://phabricator.services.mozilla.com/D249881
2025-05-21 17:36:16 +00:00
Lars Eggert
23c6bfec45 Bug 1959801 - Remove remove_dir_all r=supply-chain-reviewers,gfx-reviewers,ErichDonGubler
As far as I can tell, this code does not rely on the slight differences provided by the `remove_dir_all` crate that make it different than `std::fs::remove_dir_all`, but #gfx-reviewers should please confirm that.

Differential Revision: https://phabricator.services.mozilla.com/D245133
2025-05-21 10:05:09 +00:00
Sylvestre Ledru
8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
sotaro
6043320ed2 Bug 1962966 - Add offset handling to eglCreatePbufferFromClientBuffer() r=gfx-reviewers,lsalzman
Add the following attributes handling
- EGL_TEXTURE_OFFSET_X_ANGLE
- EGL_TEXTURE_OFFSET_Y_ANGLE

Differential Revision: https://phabricator.services.mozilla.com/D247213
2025-04-30 04:20:06 +00:00
sotaro
18ce3bdef3 Bug 1959015 - Do not disable native compositor when profiler takes screenshot with WebRender layer compositor r=gfx-reviewers,lsalzman
When profiler takes async screenshot and WebRender uses layer compositor, WebRender  tries to use only one swap chain without overlay.

Differential Revision: https://phabricator.services.mozilla.com/D246200
2025-04-28 23:03:18 +00:00
Nicolas Silva
194a741253 Bug 1961115 - Avoid scheduling an extra frame when a transaction is rendered immediately. r=gfx-reviewers,lsalzman
In addition, rename NotifyDidSceneBuild into ScheduleFrameAfterSceneBuild. Right now it is only used for that purpose but it would cause issues if we start relying on it to be called after all scene builds since with this patch we won't call it if we do not need a new frame.

Differential Revision: https://phabricator.services.mozilla.com/D245898
2025-04-18 12:56:23 +00:00
Nicolas Silva
a1c5094586 Bug 1961115 - Skip compositor-related work when rendering without presenting. r=gfx-reviewers,gw
Differential Revision: https://phabricator.services.mozilla.com/D245565
2025-04-18 12:56:23 +00:00
Nicolas Silva
a7fed60e37 Bug 1961115 - Pass new_frame_ready parameters via a struct. r=gfx-reviewers,gw
This patch is a preliminary refactoring to make it simpler to pass additional information to the C++ side and should not affect behavior.
In a followup patch the widget glue will have special handling for frames that need to be rendered but not presented.

Differential Revision: https://phabricator.services.mozilla.com/D245564
2025-04-18 12:56:22 +00:00
Cosmin Sabou
9f12bed22c Backed out 3 changesets (bug 1961115) for causing build bustages. CLOSED TREE
Backed out changeset 272e5fda747a (bug 1961115)
Backed out changeset 9f795cb0c6ae (bug 1961115)
Backed out changeset 12836f4f3c36 (bug 1961115)
2025-04-18 12:00:27 +03:00
Nicolas Silva
e555fa0b81 Bug 1961115 - Avoid scheduling an extra frame when a transaction is rendered immediately. r=gfx-reviewers,lsalzman
In addition, rename NotifyDidSceneBuild into ScheduleFrameAfterSceneBuild. Right now it is only used for that purpose but it would cause issues if we start relying on it to be called after all scene builds since with this patch we won't call it if we do not need a new frame.

Differential Revision: https://phabricator.services.mozilla.com/D245898
2025-04-18 08:21:58 +00:00
Nicolas Silva
c86cd04014 Bug 1961115 - Skip compositor-related work when rendering without presenting. r=gfx-reviewers,gw
Differential Revision: https://phabricator.services.mozilla.com/D245565
2025-04-18 08:21:58 +00:00
Nicolas Silva
91b6df8974 Bug 1961115 - Pass new_frame_ready parameters via a struct. r=gfx-reviewers,gw
This patch is a preliminary refactoring to make it simpler to pass additional information to the C++ side and should not affect behavior.
In a followup patch the widget glue will have special handling for frames that need to be rendered but not presented.

Differential Revision: https://phabricator.services.mozilla.com/D245564
2025-04-18 08:21:58 +00:00
Glenn Watson
015302f9fd Bug 1959843 - Add support for rounded compositor clip to DirectComposition r=jgilbert,gfx-reviewers,ahale
This also adds the plumbing for implementing the rounded compositor
clip in CoreAnimation and SWGL compositors, though they will be
implemented in follow up patches.

Differential Revision: https://phabricator.services.mozilla.com/D245166
2025-04-17 00:06:19 +00:00
Cristina Horotan
b6161c18c7 Backed out changeset 79cca1493923 (bug 1341913) for causing frequent failures at test_ext_contentscript_data_url.html. CLOSED TREE 2025-04-17 05:09:47 +03:00
Markus Stange
bf876dc17f Bug 1341913 - Use GL symbols from the shared context when creating a new WR window. r=gw
This avoids repeated symbol lookups on macOS.

Maybe WrShaders is no longer the right name for this struct.
We could rename it to WrSharedGlState or something along those lines.

Differential Revision: https://phabricator.services.mozilla.com/D245679
2025-04-16 20:09:42 +00:00
stransky
af7a3e00ff Bug 1959975 [Wayland] Don't create unused textures for DMABuf / Webrender compositor r=gw
Differential Revision: https://phabricator.services.mozilla.com/D245558
2025-04-16 06:36:26 +00:00
sotaro
397e2d4830 Bug 1959856 - Add FenceD3D11 handling to hardware decoded video r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D245202
2025-04-15 10:49:16 +00:00
Markus Stange
2c5187f68c Bug 1959846 - Use separate tasks on the RenderThread for individual calls to device.create_program. r=gw
This avoids keeping the thread blocked for too long in case the
call to glProgramBinary is slow. Slow glProgramBinary has been
observed with the Xclipse GPU driver.

Differential Revision: https://phabricator.services.mozilla.com/D245174
2025-04-11 02:59:48 +00:00
Markus Stange
31418ac43e Bug 1959846 - Cache the Device in the WrShaders object. r=gw
By itself, this makes wr_shaders_delete cheaper, because we won't
need to look up the GL symbols again when recreating the device.

But the actual reason I'm doing this is that I want to have
individual calls for each shader's preallocation, from separate
event loop tasks, and each of those calls will need a Device.

Differential Revision: https://phabricator.services.mozilla.com/D245173
2025-04-11 02:59:48 +00:00
Markus Stange
5f5dc149a3 Bug 1959846 - Move the precaching out of the shader creation. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D245172
2025-04-11 02:59:47 +00:00
sotaro
42b68a027f Bug 1959279 - Rename GpuProcessFencesHolderId to CompositeProcess FencesHolderId r=gfx-reviewers,lsalzman
With Bug 1958752 fix, GpuProcessFencesHolderId needs to be renamed to CompositeProcessFencesHolderId.

Differential Revision: https://phabricator.services.mozilla.com/D244868
2025-04-09 09:26:39 +00:00
Markus Stange
f2bd02ddbc Bug 1959165 - Move the MakeCurrent call to a place that makes more sense. r=lsalzman
The MakeCurrent() call that this patch moves was added in
https://phabricator.services.mozilla.com/D196864 .

I think the WebRenderShaders destructor is a more reasonable
place for this call; WebRenderShaders already stores the GLContext.

Differential Revision: https://phabricator.services.mozilla.com/D244782
2025-04-08 16:37:59 +00:00
sotaro
84b97ec5c9 Bug 1958752 - Rename GpuProcessD3D11FencesHolderMap to CompositeProcessD3D11FencesHolderMap r=gfx-reviewers,lsalzman
By Bug 1957563, GpuProcessD3D11FencesHolderMap is changed to instantiate also in Parent process when GPU process does not exist. Then it seems better to change its name.

Differential Revision: https://phabricator.services.mozilla.com/D244684
2025-04-08 16:26:28 +00:00
Florian Quèze
9885783942 Bug 1956726 - remove leftover Telemetry.h includes in .cpp files, r=chutten,geckoview-reviewers,cookie-reviewers,win-reviewers,dom-storage-reviewers,gstoll,valentin,m_kato,janv.
Differential Revision: https://phabricator.services.mozilla.com/D244351
2025-04-08 13:03:02 +00:00
Emilio Cobos Álvarez
4c42399f22 Bug 1958711 - Remove unused BufferMode on FallbackRenderer. r=win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D244528
2025-04-07 20:36:21 +00:00
sotaro
2cc8d30558 Bug 1957563 - Replace SurfaceDescriptorD3D10::fenceInfo with GpuProcessFencesHolderId r=gfx-reviewers,lsalzman
Remove FenceInfo. Instead use GpuProcessFencesHolderId and GpuProcessD3D11FencesHolderMap.

GpuProcessD3D11FencesHolderMap is changed to instantiate also in Parent process when GPU process does not exist. Then it seems better to change its name. The name change is going to be handled in Bug 1958752.

Differential Revision: https://phabricator.services.mozilla.com/D244539
2025-04-07 11:48:23 +00:00
sotaro
ceeb8ba7b7 Bug 1957001 - Use FenceD3D11 for shnchronization in DXGIYCbCrTextureData r=media-playback-reviewers,gfx-reviewers,alwu,lsalzman
DXGIYCbCrTextureData uses keyed mutex for synchronization. But it is inefficient than FenceD3D11. And it caused the performance problem when DXGIYCbCrTextureData has multiple users like Bug 1956305

Differential Revision: https://phabricator.services.mozilla.com/D243622
2025-04-04 05:27:37 +00:00
Cosmin Sabou
a9967c7389 Merge mozilla-central to autoland. CLOSED TREE 2025-04-03 18:04:39 +03:00
Cosmin Sabou
cc39e0c0e8 Backed out changeset c860af62a31c (bug 1957001) for D3D11 crashes. a=backout 2025-04-03 17:59:55 +03:00
Florian Quèze
4b88e75c19 Bug 1956726 - Migrate histograms to use Glean APIs in gfx/, r=chutten,jgilbert,firefox-desktop-core-reviewers ,mconley.
Differential Revision: https://phabricator.services.mozilla.com/D242765
2025-04-03 13:42:51 +00:00
sotaro
c55933b247 Bug 1957001 - Use FenceD3D11 for shnchronization in DXGIYCbCrTextureData r=media-playback-reviewers,gfx-reviewers,alwu,lsalzman
DXGIYCbCrTextureData uses keyed mutex for synchronization. But it is inefficient than FenceD3D11. And it caused the performance problem when DXGIYCbCrTextureData has multiple users like Bug 1956305

Differential Revision: https://phabricator.services.mozilla.com/D243622
2025-04-03 02:01:59 +00:00
sotaro
c5d31b2aba Bug 1957528 - Remove ID3D11Query wait of D3D11Texture2D copy complete just before blitting with non Intel GPUs r=gfx-reviewers,lsalzman
Since Bug 1912368 fix, the ID3D11Query wait seems not necessary.

Differential Revision: https://phabricator.services.mozilla.com/D243743
2025-04-01 23:11:31 +00:00
Markus Stange
c2d63228bc Bug 1686109 - Only create NativeLayerRootSnapshotter when profiler screenshots are enabled. r=jrmuizel
On macOS, the snapshotter creates its own GLContext.
Creating a GLContext spends some time (10ms+) looking up GL symbols.

The only purpose of the snapshotter is to capture screenshots for the profiler,
so this patch saves the symbol lookup cost when we're not capturing screenshots.

Profile: https://share.firefox.dev/4lbIDKj

Differential Revision: https://phabricator.services.mozilla.com/D243618
2025-03-31 15:44:13 +00:00
sotaro
fd64e41c85 Bug 1955950 - Add a capability to use DCompositionSurface instead of swap chain with layer compositor enabled r=gfx-reviewers,lsalzman
When IDCompositionSurface is used instead of swap chain, rendering update becomes synchronous.

Differential Revision: https://phabricator.services.mozilla.com/D242712
2025-03-25 10:12:52 +00:00
Nicolas Silva
49d7220749 Bug 1954798 - Add debug markers in WR's display list. r=emilio
And use DebugMarker(1) to signify that the next item is a view-transition snapshot.
This specific marker is not meant to stay forever (although the infrastructure is), but it is useful right now.

Differential Revision: https://phabricator.services.mozilla.com/D242023
2025-03-19 17:12:24 +00:00
Goloman Adrian
1f1fa5f70c Backed out changeset 9c15b8950f9d (bug 1954798) for causing build bustages. 2025-03-19 11:11:13 +02:00
Nicolas Silva
46eae23cc9 Bug 1954798 - Add debug markers in WR's display list. r=emilio
And use DebugMarker(1) to signify that the next item is a view-transition snapshot.
This specific marker is not meant to stay forever (although the infrastructure is), but it is useful right now.

Differential Revision: https://phabricator.services.mozilla.com/D242023
2025-03-19 08:45:10 +00:00
sotaro
1a332d6f97 Bug 1954621 - Add Wait after first present in DCSwapChain::Present() r=gfx-reviewers,lsalzman
The wait is necessary to prevent flickering.

Differential Revision: https://phabricator.services.mozilla.com/D241901
2025-03-18 03:57:14 +00:00
Emilio Cobos Álvarez
0ff8015e82 Bug 1922333 - Land view transition plumbing for live capture behind a default-off pref. r=view-transitions-reviewers,boris
It is mostly working, but there are some tests that hit crashes and
asserts that we should sort out. For now, land it default-off.

This does implement other bits that are on by default tho, like creating
image frames for ::view-transition-new() pseudo-elements and so on. I
think that is fine (it's just that for now they are all transparent).

Differential Revision: https://phabricator.services.mozilla.com/D239382
2025-03-05 11:18:18 +00:00
Glenn Watson
8a4b916c17 Bug 1950768 - Support debug and profiler overlay with layer-compositor enabled r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D239832
2025-02-27 19:27:25 +00:00
stransky
8d58db2e9e Bug 1950610 [Wayland] Always use WR compositor to paint D&D popups r=lsalzman
We can't use native compositor to paint D&D popups as Wayland doesn't implement subsurfaces for it.

Differential Revision: https://phabricator.services.mozilla.com/D239733
2025-02-27 07:59:45 +00:00
Emilio Cobos Álvarez
6ba2ddce30 Bug 1950177 - Pass snapshot around via StackingContextParams. r=nical,gfx-reviewers
No behavior change, but this seemed a bit nicer / more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D239381
2025-02-26 12:29:47 +00:00
Cristina Horotan
5bc51022a0 Backed out 9 changesets (bug 1922300, bug 1950362, bug 1919333, bug 1950176, bug 1948058, bug 1950177, bug 1922298) for causing multiple Wr failures
Backed out changeset 54c87e09251a (bug 1919333)
Backed out changeset 813274ba35a0 (bug 1919333)
Backed out changeset a37d91fc2a7a (bug 1950362)
Backed out changeset 97f67f9048b5 (bug 1922298)
Backed out changeset 4c11b366fcaf (bug 1919333)
Backed out changeset dbde76fa73a9 (bug 1948058)
Backed out changeset ba3d9d95cd56 (bug 1922300)
Backed out changeset 0fe786bf2709 (bug 1950177)
Backed out changeset 8d9f52e91779 (bug 1950176)
2025-02-26 06:23:09 +02:00
Emilio Cobos Álvarez
d82a905a47 Bug 1950177 - Pass snapshot around via StackingContextParams. r=nical,gfx-reviewers
No behavior change, but this seemed a bit nicer / more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D239381
2025-02-25 22:48:29 +00:00
Butkovits Atila
d1846f9d0f Backed out 2 changesets (bug 1949858) for causing WebRender failures. CLOSED TREE
Backed out changeset 311381302426 (bug 1949858)
Backed out changeset a43a261a4dbb (bug 1949858)
2025-02-24 16:55:15 +02:00
Erich Gubler
2ed17e7034 Bug 1949858 - build(rust): upgrade core-graphics 0.23.1 → 0.24.0, core-text 20.1.0 → 21.0.0 r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D239210
2025-02-24 13:41:46 +00:00
Butkovits Atila
515aa5ce36 Backed out 2 changesets (bug 1949858) forcausing wrench bustages. CLOSED TREE
Backed out changeset a38ace2f6538 (bug 1949858)
Backed out changeset a56ed79b9609 (bug 1949858)
2025-02-22 06:25:42 +02:00