Commit Graph
100 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 1bd0da8bf7 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 22:04:17 +00:00
iulian moraru 480fc572da Revert "Bug 2036439, Bug 2033243 - Deal with ownerGlobal -> documentGlobal rename in extensions. r=robwu,home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit 4f62279d01.

Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug"

This reverts commit 91a4ece356.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 5a95a889e1.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 7177a68e67.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 5263254690.
2026-05-02 16:43:35 +00:00
Emilio Cobos Álvarez 7177a68e67 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 15:33:23 +00:00
rperta d4cc71008d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" on developer request
This reverts commit e58e122135.

This reverts commit 84ca206f3e.

This reverts commit a7945292ed.

This reverts commit 367d83d299.
2026-05-02 06:20:30 +00:00
Emilio Cobos Álvarez a7945292ed Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-01 11:58:14 +00:00
agoloman c814da612d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" for causing multiple failures.
This reverts commit c7246654bc.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 8873ddf33c.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 8bf999e03c.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 7dea1af2e0.
2026-04-30 20:13:14 +00:00
Emilio Cobos Álvarez 8bf999e03c Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-04-30 17:47:11 +00:00
Jim Blandy 56a8c9a001 Bug 1870699: WebGPU: Supply device in QueueOnSubmittedWorkDone. r=webgpu-reviewers,teoxoy
In `wgpu_bindings::Message::QueueOnSubmittedWorkDone`, include the id
of the device to which the queue belongs. Pass this value in
`mozilla::webgpu::Queue::OnSubmittedWorkDone`. Ignore it for now in
`wgpu_bindings::server::process_message`; later commits will use it to
request wgpu device polling.

Differential Revision: https://phabricator.services.mozilla.com/D285434
2026-03-23 04:40:45 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Teodor Tanasoaia c3cd2ab853 Bug 2005105 - Make all mPendingXPromises fields private and add enqueue/dequeue methods to access them. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D279653
2026-01-23 17:34:06 +00:00
Teodor Tanasoaia 03a627fbce Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-27 11:22:00 +00:00
agoloman db150f25f2 Revert (Bug 1981187, Bug 1981225) - for causing build bustages RenderBundle.cpp.
This reverts commit cb3f1a84bb.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 793a7e81db.
2025-08-26 14:12:22 +00:00
Teodor Tanasoaia 793a7e81db Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 13:23:27 +00:00
agoloman 167b30ae21 Revert (Bug 1981187, Bug 1981225)- for causing build bustages @RefPtr.h.
This reverts commit 5fb5283ac4.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 2d0cd2975f.
2025-08-26 11:18:12 +00:00
Teodor Tanasoaia 2d0cd2975f Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 10:07:28 +00:00
Jamie Nicol c6206cdfd8 Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
When importing an external texture in the content process, call
BuildSurfaceDescriptorGPUVideoOrBuffer() instead of
BuildSurfaceDescriptorBuffer(), in order to avoid a readback of GPUVideo
images into a shmem.

In the GPU process, handle GPUVideo surface descriptors. For Tnull_t, if
the remote texture host is a BufferTextureHost we can use the existing
CreateFromBufferDesc() path to create the required wgpu textures. For
TSurfaceDescriptorD3D10 and TSurfaceDescriptorDXGIYCbCr we add new paths
to import the textures directly into wgpu via their shared
handles. SurfaceDescriptorDXGIYCbCr always requires 3 textures and
views: for Y, Cb, and Cr planes respectively. SurfaceDescriptorD3D10 can
come in a variety of formats, which we attempt to handle.

If a CompositeProcessFencesHolderId is provided we must ensure we wait
on the appropriate write fence prior to reading from the texture. To
ensure this occurs, we make the ExternalTextureSourceHost hold on to its
fences holder ID. When submitting command buffers, we pass the list of
used external texture sources to the host side, then on the host side
for each source we call OnBeforeQueueSubmit(). This obtains the write
fence's shared handle and the value which must be waited for from the
CompositeProcessD3D11FencesHolderMap, then imports the fence from the
shared handle and inserts a wait for the specified value into the
command queue.

If available, we request wgpu's TEXTURE_FORMAT_NV12,
TEXTURE_FORMAT_P010, and TEXTURE_FORMAT_16BIT_NORM features. The first
is required for NV12 format textures, and the latter 2 are required for
P010. If unavailable, we will gracefully fail to create these textures
but other content will continue to work. It would be surprising,
however, if the decoder were to provide us with textures in these
formats when they are not supported.

Differential Revision: https://phabricator.services.mozilla.com/D261424
2025-08-21 23:32:55 +00:00
agoloman f76adaf46c Revert "Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy" for causing build bustages @ExternalTexture.cpp.
This reverts commit 83147dd2e2.
2025-08-21 14:59:23 +00:00
Jamie Nicol 83147dd2e2 Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
When importing an external texture in the content process, call
BuildSurfaceDescriptorGPUVideoOrBuffer() instead of
BuildSurfaceDescriptorBuffer(), in order to avoid a readback of GPUVideo
images into a shmem.

In the GPU process, handle GPUVideo surface descriptors. For Tnull_t, if
the remote texture host is a BufferTextureHost we can use the existing
CreateFromBufferDesc() path to create the required wgpu textures. For
TSurfaceDescriptorD3D10 and TSurfaceDescriptorDXGIYCbCr we add new paths
to import the textures directly into wgpu via their shared
handles. SurfaceDescriptorDXGIYCbCr always requires 3 textures and
views: for Y, Cb, and Cr planes respectively. SurfaceDescriptorD3D10 can
come in a variety of formats, which we attempt to handle.

If a CompositeProcessFencesHolderId is provided we must ensure we wait
on the appropriate write fence prior to reading from the texture. To
ensure this occurs, we make the ExternalTextureSourceHost hold on to its
fences holder ID. When submitting command buffers, we pass the list of
used external texture sources to the host side, then on the host side
for each source we call OnBeforeQueueSubmit(). This obtains the write
fence's shared handle and the value which must be waited for from the
CompositeProcessD3D11FencesHolderMap, then imports the fence from the
shared handle and inserts a wait for the specified value into the
command queue.

If available, we request wgpu's TEXTURE_FORMAT_NV12,
TEXTURE_FORMAT_P010, and TEXTURE_FORMAT_16BIT_NORM features. The first
is required for NV12 format textures, and the latter 2 are required for
P010. If unavailable, we will gracefully fail to create these textures
but other content will continue to work. It would be surprising,
however, if the decoder were to provide us with textures in these
formats when they are not supported.

Differential Revision: https://phabricator.services.mozilla.com/D261424
2025-08-21 13:27:18 +00:00
Jamie Nicol 361fefaf48 Bug 1979110 - Hold reference to layers::Image until all external texture work using it is done. r=webgpu-reviewers,teoxoy
And then eagerly destroy external textures and external texture sources
when possible.

We must retain a reference to the layers::Image from which an external
texture source was imported as long as any work involving external
textures created from that source is outstanding. This prevents the
decoder from attempting to recycle the underlying resource too early,
e.g. decoding a future video frame into the texture while wgpu is still
to render the previous frame.

On the other hand, we don't want to hold on to resources longer than
required in order to prevent excess memory usage.

For each external texture, keep track of submission index at which work
involving the external texture was last submitted, and the index of the
last such submission whose work has since completed. When all submitted
work for an external texture has completed, and the external texture
has been expired, eagerly destroy the external texture.

Additionally, when the external texture is destroyed also release its
reference to the external texture source. This means the source will
itself be destroyed as soon as there are no more live external textures
that were created from it. When the source is destroyed the last
reference to the layes::Image will be dropped, indicating to the
decoder that it can reuse the underlying resources.

Differential Revision: https://phabricator.services.mozilla.com/D260826
2025-08-13 10:11:58 +00:00
Jamie Nicol 589362b665 Bug 1982408 - Keep separate deque of pending work done promises per each queue. r=webgpu-reviewers,teoxoy
For each individual queue we know that the pending work done promises
will be resolved FIFO. However, there are no guarantees about the order
in which separate queues will complete work. We must therefore keep a
separate deque of promises for each queue to ensure that we resolve
the correct one.

Differential Revision: https://phabricator.services.mozilla.com/D260816
2025-08-12 13:21:49 +00:00
Jamie Nicol fb77729315 Bug 1979108 - Implement ExternalTexture expiration. r=webgpu-reviewers,media-playback-reviewers,teoxoy,alwu
ExternalTextures imported from HTMLVideoElements get "expired" in the
"automatic expiry task source", which is implemented by scheduling a
stable state task. ExternalTextures imported from VideoFrames get
expired when the VideoFrame is closed.

Keep track of each external texture used by any used bind group when
encoding compute and render passes. When submitting, if any passes
contain expired external textures then raise a validation error.

Currently we always create a new ExternalTexture when
importExternalTexture() is called. When support for reusing previously
imported textures is added, we must ensure they are correctly
"unexpired".

Differential Revision: https://phabricator.services.mozilla.com/D260295
2025-08-12 08:49:36 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Teodor Tanasoaia 3ba482a279 Bug 1975714 - Assert that the IDs in server messages are the same as the ones the WebGPUChild actor expects. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D258257
2025-07-25 16:34:51 +00:00
Teodor Tanasoaia dd6d8df538 Bug 1978369 - Stop leaking queues. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D258241
2025-07-25 16:34:47 +00:00
Sandor Molnar 752f8e9d7d Revert "Bug 1975714 - Promote tests out of backlog. r=webgpu-reviewers,nical" for causing build bustages @ ComputePassEncoder.cpp
This reverts commit 22fb6f2691.

Revert "Bug 1975714 - Update backlog expectations. r=webgpu-reviewers,nical"

This reverts commit 72b4644a09.

Revert "Bug 1975714 - Use `MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `reportCompilationMessagesToConsole`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 4394625f93.

Revert "Bug 1975714 - Assert that the IDs in server messages are the same as the ones the `WebGPUChild` actor expects. r=webgpu-reviewers,nical"

This reverts commit 5ce8cf9b12.

Revert "Bug 1978369 - Stop leaking queues. r=webgpu-reviewers,nical"

This reverts commit 32ab875eab.

Revert "Bug 1975714 - Move remaining ID creation/destruction into resource creation/destruction functions. r=webgpu-reviewers,nical"

This reverts commit 122e1a6529.

Revert "Bug 1975714 - Replace uses of `make_slice` with  `FfiSlice`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 62add844bf.

Revert "Bug 1975714 - Use `FfiSlice` in remaining places. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 3812af72dd.

Revert "Bug 1975714 - Use an opaque pointer for `WebGPUParent`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit bf83ea6553.

Revert "Bug 1975714 - Remove unneeded `#[allow(dead_code)]`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit a84b40d4b8.

Revert "Bug 1977861 - Stop leaking BGLs returned by GPUPipelineBase.getBindGroupLayout(). r=webgpu-reviewers,ErichDonGubler"

This reverts commit b5ec027bf9.

Revert "Bug 1975714 - Turn function pointers into extern fns. r=webgpu-reviewers,nical"

This reverts commit d3681b7012.

Revert "Bug 1975714 - Make sure to resolve/reject all pending promises in `ClearActorState`. r=webgpu-reviewers,nical"

This reverts commit 2f607174ce.

Revert "Bug 1975714 - Do not immediately resolve the lost promise on `device.destroy()`. r=webgpu-reviewers,nical"

This reverts commit 1c10e1f698.

Revert "Bug 1960399 - Reject async pipeline creation with `GPUPipelineError`. r=webgpu-reviewers,nical"

This reverts commit ee47165e63.

Revert "Bug 1975714 - Correct comments. r=webgpu-reviewers,nical"

This reverts commit 9e0aabda0e.
2025-07-24 18:02:12 +00:00
Teodor Tanasoaia 5ce8cf9b12 Bug 1975714 - Assert that the IDs in server messages are the same as the ones the WebGPUChild actor expects. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D258257
2025-07-24 17:05:49 +00:00
Teodor Tanasoaia 32ab875eab Bug 1978369 - Stop leaking queues. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D258241
2025-07-24 17:05:45 +00:00
Erich Gubler f7f1595bfe Bug 1947159 - fix(webgpu): allow sequences for GPUOrigin2D r=webgpu-reviewers,teoxoy
As this is only used in the `source.origin` field for
`GPUQueue.copyExternalImageToTexture`, we can keep this validation in
the body of this method, for now.

Differential Revision: https://phabricator.services.mozilla.com/D255663
2025-07-01 20:35:28 +00:00
Teodor Tanasoaia 1d828ac8f5 Bug 1968122 - Avoid bincode serialization/deserialization overhead for inline buffer data. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253978
2025-06-23 15:17:22 +00:00
Teodor Tanasoaia 045d762e13 Bug 1968122 - Queue messages in WebGPUChild. r=webgpu-reviewers,profiler-reviewers,canaltinova,nical
Differential Revision: https://phabricator.services.mozilla.com/D253977
2025-06-23 15:17:19 +00:00
Teodor Tanasoaia 6197d6b665 Bug 1968122 - Move QueueOnSubmittedWorkDone into our Message enum. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253973
2025-06-23 15:17:07 +00:00
Teodor Tanasoaia 9bf4977179 Bug 1968122 - Add inline support to Message::QueueWrite. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253961
2025-06-23 15:16:32 +00:00
Teodor Tanasoaia 85589a3719 Bug 1968122 - Move QueueWriteAction into our Message enum. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253960
2025-06-23 15:16:29 +00:00
Teodor Tanasoaia 8b2c72e3e6 Bug 1968102 - add QueueWriteBufferInline to avoid shmem overhead on small buffers r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253549
2025-06-23 15:16:06 +00:00
Teodor Tanasoaia 8423cbfeda Bug 1970670 - remove DropAction, only the content process should free IDs r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D252687
2025-06-06 19:57:58 +00:00
Kagami Sascha Rosylight a100ce2456 Bug 1957934 - Part 4: Autogenerate headers with IDL identifiers r=edgar,media-playback-reviewers,padenot
This adds BindingFwd.h for each webidl file and adds:

1. Interface declarations
2. Dictionary declarations
3. Union aliases

Differential Revision: https://phabricator.services.mozilla.com/D245340
2025-04-29 14:28:51 +00:00
Erich Gubler 39b36a3858 Bug 1938257 - feat(webgpu): permit AllowSharedBufferSource in WebGPU r=webgpu-reviewers,webidl,smaug,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D244382
2025-04-12 20:58:12 +00:00
Andy Leiserson 5209057988 Bug 1956004 - Part 2: Reduce the amount of data copied by writeTexture r=webgpu-reviewers,perftest-reviewers,nical,sparky
Differential Revision: https://phabricator.services.mozilla.com/D244449
2025-04-11 21:54:24 +00:00
Andy Leiserson 6e3b396e8d Bug 1956004 - Part 1: Fixes for WebGPU CTS image_copy tests r=ErichDonGubler,webgpu-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D244412
2025-04-11 21:54:23 +00:00
teoxoy 4d54ae104c Bug 1922097 - add support for HTMLImageElement to copyExternalImageToTexture r=webgpu-reviewers,webidl,emilio,smaug,nical
Differential Revision: https://phabricator.services.mozilla.com/D240876
2025-03-21 10:13:19 +00:00
Alex Franchuk ce069a465c Bug 1942129 pt4b - Remove use of RawShmem r=ipc-reviewers,nika,webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D236749
2025-03-04 22:11:11 +00:00
Butkovits Atila 2406ce261c Backed out 8 changesets (bug 1942129) for causing bustages at SharedMemoryMapping.h. CLOSED TREE
Backed out changeset 8d9053f1c203 (bug 1942129)
Backed out changeset 393e3c507c27 (bug 1942129)
Backed out changeset 8240d353d224 (bug 1942129)
Backed out changeset 8c4cd026b720 (bug 1942129)
Backed out changeset 742634b0d6e9 (bug 1942129)
Backed out changeset d16857f9812f (bug 1942129)
Backed out changeset 7ff7af041ee7 (bug 1942129)
Backed out changeset ef41d9e4c7de (bug 1942129)
2025-03-04 00:43:23 +02:00
Alex Franchuk 57e4ff560c Bug 1942129 pt4b - Remove use of RawShmem r=ipc-reviewers,nika,webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D236749
2025-03-03 19:53:19 +00:00
Erich Gubler 8bec89e0db Bug 1835636 - fix(webgpu): throw OperationErrors instead of OOM errors in GPUQueue.writeBuffer calls r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D233125
2025-01-06 16:54:35 +00:00
Erich Gubler 757feb7757 Bug 1835636 - fix(webgpu): throw OperationErrors instead of AbortErrors in GPUQueue.writeBuffer calls r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D233124
2025-01-06 16:54:34 +00:00
Erich Gubler 2c46c1a2e3 Bug 1835636 - fix(webgpu): use byte offset, not element offset, in buffer writes r=webgpu-reviewers,nical
Well, this was embarrassing!

Differential Revision: https://phabricator.services.mozilla.com/D233123
2025-01-06 16:54:34 +00:00
teoxoyandErich Gubler 9111bf40ea Bug 1933492 - Update wgpu to revision 66d51b6059127b81c7385ec3f2d49c3e81f76f0e. r=webgpu-reviewers,supply-chain-reviewers,nical
Co-authored-by: Erich Gubler <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D230946
2024-12-05 11:39:10 +00:00
Goloman Adrian d2a39124c7 Backed out changeset 9b662ae8100d (bug 1933492) for causing build bustages. CLOSED TREE 2024-12-04 13:09:07 +02:00
teoxoyandErich Gubler 5698dd07fe Bug 1933492 - Update wgpu to revision 66d51b6059127b81c7385ec3f2d49c3e81f76f0e. r=webgpu-reviewers,supply-chain-reviewers,nical
Co-authored-by: Erich Gubler <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D230946
2024-12-04 10:16:19 +00:00
Erich Gubler d8054006cd Bug 1933328 - refactor(webgpu): handle 2024-08 image copy renames from upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio
Driven by [gpuweb#4838](https://github.com/gpuweb/gpuweb/pull/4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
2024-11-27 13:02:13 +00:00