Commit Graph
56 Commits
Author SHA1 Message Date
Teodor Tanasoaia 902def3633 Bug 2031993 - Update wgpu to revision 0b4bdaf9cea213ce614405a834ff049b9dfba103. r=webgpu-reviewers,supply-chain-reviewers,webidl,smaug,aleiserson
Differential Revision: https://phabricator.services.mozilla.com/D294416
2026-04-17 11:12:13 +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
Andy Leiserson 2fdfd6c735 Bug 1980891 - Color attachments should be nullable r=webgpu-reviewers,webidl,smaug,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D280125
2026-01-23 22:57:10 +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
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 c10f7dd0fc Bug 1975714 - Replace uses of make_slice with FfiSlice. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D257749
2025-07-25 16:34:40 +00:00
Teodor Tanasoaia 1dbaf92aec Bug 1975714 - Use FfiSlice in remaining places. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D257748
2025-07-25 16:34:37 +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 62add844bf Bug 1975714 - Replace uses of make_slice with FfiSlice. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D257749
2025-07-24 17:05:38 +00:00
Andy Leiserson b8dc666d50 Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D255033
2025-07-02 23:32:43 +00:00
Serban Stanca 5fa41eb1d3 Revert "Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical" for causing reftests failures.
This reverts commit f1ebe8385b.
2025-06-27 23:13:30 +00:00
Andy Leiserson f1ebe8385b Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D255033
2025-06-27 18:32:44 +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 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 e2ae6e549f Bug 1968122 - Wrap device actions in Message::Device. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D253954
2025-06-23 15:16:11 +00:00
Teodor Tanasoaia bbd511a722 Bug 1969286 - Mark indirect buffers as used by encoders r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D252158
2025-06-04 09:57:07 +00:00
Andy Leiserson 645026db0e Bug 1878804 - Implement the 5-argument overload of setBindGroup r=webgpu-reviewers,ErichDonGubler,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D242961
2025-03-26 23:08:13 +00:00
Erich Gubler e600107e7f Bug 1954725 - remove default value for GPURenderCommandsMixin.set{Index,Vertex}Buffer's size argument r=webgpu-reviewers,webidl,smaug,nical
Differential Revision: https://phabricator.services.mozilla.com/D241987
2025-03-19 20:51:19 +00:00
Brad Werth f3e24d843c Bug 1925398 Part 1: Restore WebGPU encoder cycle collection, fix Cleanup(). r=teoxoy
Cleanup() should not call End(), because doing so exposes us to timing
dependencies on the cycle collection. Specifically, as noted in the
patches for Bug 1907457, cycle collection of encoders and their
resources could result in the resource getting destructed before the
encoder. Bug 1907457 "fixed" that by allowing cycles. This patch instead
fixes it by changing encoder Cleanup() to just tidy up resources and not
attempt to complete the work of the encoder by passing it to wgpu.

This also removes mUsedTextureViews from the RenderBundleEncoder, as it
is unused. RenderBundleEncoders have no reliance on TextureViews.

Differential Revision: https://phabricator.services.mozilla.com/D226200
2024-10-23 22:15:23 +00:00
Brad Werth 9fd4c45a90 Bug 1905383: Make WebGPU encoders not cycle check their subresources. r=webgpu-reviewers,teoxoy
The encoder classes already have strong references to the resources they
rely upon. That is enough to prevent those resources from being
released before the encoder. That's all we need! Including the resources
in cycle checking is just making it possible for the resource and the
encoder to be unlinked in the same cycle, in arbitrary order. That's
dangerous because it's the same outcome as if the encoder didn't have a
strong reference to the resource at all.

Differential Revision: https://phabricator.services.mozilla.com/D225914
2024-10-17 13:43:49 +00:00
Brad Werth 0f23ffb689 Bug 1896843: Make webgpu setBindGroup take an optional bind group, matching spec. r=webidl,webgpu-reviewers,nical,saschanaz,ErichDonGubler
This includes a test that checks that setBindGroup can be passed a null
bindGroup.

Differential Revision: https://phabricator.services.mozilla.com/D223884
2024-09-30 15:08:02 +00:00
teoxoy 04696bebed Bug 1918739 - Update wgpu to revision c8beade1877251c494036fc3661b04ec6aad63a9. r=webgpu-reviewers,supply-chain-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D222155
2024-09-17 21:44:15 +00:00
Norisz Fay b6992edc1c Backed out changeset 128de7e126a3 (bug 1918739) for causing wgpu_bindings related bustages CLOSED TREE 2024-09-14 03:16:45 +03:00
teoxoy 9fd15cf9ae Bug 1918739 - Update wgpu to revision c8beade1877251c494036fc3661b04ec6aad63a9. r=webgpu-reviewers,supply-chain-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D222155
2024-09-13 23:53:22 +00:00
Brad Werth b1a7f826f6 Bug 1712963: Simplify mValid handling in some WebGPU classes. r=webgpu-reviewers,nical
Primarily this standardizes ComputePassEncoder, RenderBundleEncoder and
RenderPassEncoder on the "if (!mValid)" pattern for early exits for ffi
functions. It also attempts to make each class have at most two ways to
become invalid:

1) RenderBundleEncoder and RenderPassEncoder can become invalid at
construction time.
2) Those classes and ComputePassEncoder all now have an implementation
of their ::Cleanup method, which is called from the destructor, and the
Cleanup method is responsible for making the object invalid and
releasing internal resources (possibly by calling another method).

Together these changes make it easier to reason about what mValid means
for these classes, and what is the state of their internal resources.

Differential Revision: https://phabricator.services.mozilla.com/D208183
2024-04-23 15:28:22 +00:00
Nicolas Silva f48166d78b Bug 1880081 - Don't crash the content process if the GPU process goes down. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D201715
2024-02-13 16:57:08 +00:00
Erich Gubler deddddedf9 Bug 1875543: re-format RenderBundleEncoder.cpp r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D199162
2024-01-23 15:06:41 +00:00
Nicolas Silva 7563a27051 Bug 1873047 - Move CommandEncoder and RenderBundleEncoder ::Finish to their respective file. r=webgpu-reviewers,ErichDonGubler
Depends on D198401

Differential Revision: https://phabricator.services.mozilla.com/D198402
2024-01-20 01:18:59 +00:00
Nicolas Silva e73a26fd5c Bug 1873047 - Generate a valid Texture object on the JS side even if IPC is down. r=webgpu-reviewers,ErichDonGubler
These JS proxies are always safe to create. The ids are validated on the other side so if the GPU process comes back up and we try to use the object (on a new device), it will generate an error as expected.

Depends on D197799

Differential Revision: https://phabricator.services.mozilla.com/D197800
2024-01-20 01:18:55 +00:00
Kelsey Gilbert efb53a90f9 Bug 1873503 - Replace Scoped with std::unique_ptr in dom/webgpu. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D198088
2024-01-17 19:19:05 +00:00
Nicolas Silva f7ad5f97c4 Bug 1837990 - Depduplicate code to calculate a texture's format's block size. r=webgpu-reviewers,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D180818
2023-06-15 21:22:54 +00:00
Jim Blandy 687c4fe125 Bug 1772557: Assign WebGPU RenderBundles ids even if encoding fails. r=webgpu-reviewers,ErichDonGubler
In `RenderBundleEncoder::Finish`, never construct RenderBundles with
an id of zero, as this will cause a panic in the GPU process when we
deserialize command buffers that refer to such bundles.

Instead, assign the invalid RenderBundle an id, and report to the GPU
process that this id is associated with an error.

Differential Revision: https://phabricator.services.mozilla.com/D177077
2023-06-14 23:33:29 +00:00
Noemi Erli 8b17d6be94 Backed out changeset 9e72228ed1e3 (bug 1772557) for causing failures in test_too_many_color_attachments.html CLOSED TREE
removed dom/webgpu/mochitest/test_too_many_color_attachments.html
2023-06-15 00:42:32 +03:00
Jim Blandy 5430ea04ce Bug 1772557: Assign WebGPU RenderBundles ids even if encoding fails. r=webgpu-reviewers,ErichDonGubler
In `RenderBundleEncoder::Finish`, never construct RenderBundles with
an id of zero, as this will cause a panic in the GPU process when we
deserialize command buffers that refer to such bundles.

Instead, assign the invalid RenderBundle an id, and report to the GPU
process that this id is associated with an error.

Differential Revision: https://phabricator.services.mozilla.com/D177077
2023-06-14 20:21:13 +00:00
Nicolas Silva 711966e43e Bug 1750576 - Avoid passing raw strings in a couple of wgpu bindings entry points. r=emilio
Inspired by emilio's suggestion in the shader module API patch. This tries to be the most straightforward way to go from the strings coming from IPC to the ones consumed by wgpu.

Differential Revision: https://phabricator.services.mozilla.com/D151024
2022-07-08 08:11:39 +00:00
Cristian Tuns 86c321ca45 Backed out 2 changesets (bug 1750576) for causing lint failures and build bustages. CLOSED TREE
Backed out changeset 21ede22c4113 (bug 1750576)
Backed out changeset be7493c6f3cb (bug 1750576)
2022-07-07 10:51:38 -04:00
Nicolas Silva 8b6ccb9427 Bug 1750576 - Avoid passing raw strings in a couple of wgpu bindings entry points. r=emilio
Inspired by emilio's suggestion in the shader module API patch. This tries to be the most straightforward way to go from the strings coming from IPC to the ones consumed by wgpu.

Differential Revision: https://phabricator.services.mozilla.com/D151024
2022-07-07 14:35:29 +00:00
Kagami Sascha Rosylight 50f0e30a17 Bug 1768189 - Part 42: Apply modernize-concat-nested-namespaces to dom/webgpu/RenderBundle.h ... r=andi
Depends on D145777

Differential Revision: https://phabricator.services.mozilla.com/D145778
2022-05-09 20:41:19 +00:00
Andrew Osmond 5fe64d9beb Bug 1709951 - Make WebGPU handle GPU process loss. r=gfx-reviewers,webidl,jgilbert,smaug
Differential Revision: https://phabricator.services.mozilla.com/D143247
2022-04-27 21:13:21 +00:00
Jim Blandy 909ae6fcf3 Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert
New versions of several crates are introduced to third_party/rust, by
changing the versions requested in `gfx/wgpu_bindings/Cargo.toml` and
running `mach vendor rust`:

- `wgpu-core`, `wgpu-hal`, and `wgpu-types`, as used by `wgpu_bindings`
- `naga`, `ash`, and `metal`, as used by the above

These are all exact copies of the upstream sources, at the git
revisions listed in `.cargo/config.in`.

This brings in fixes for some upstream `wgpu` bugs that were fuzzblockers:

- Compute pipelines never freed at runtime, leaking memory #2564
  https://github.com/gfx-rs/wgpu/issues/2564

- Device::drop doesn't actually free the device when using backend::direct::Context #2563
  https://github.com/gfx-rs/wgpu/issues/2563

The Firefox sources also needed some adjustments to catch up with
upstream changes:

- The C type `mozilla::webgpu::ffi::WGPUTextureFormat` is now a struct
  containing a tag enum and a union, not just an enum. This is needed
  for [gfx-rs/wgpu#2477](https://github.com/gfx-rs/wgpu/pull/2477).

  (Note that Firefox's `WebGPU.webidl` is behind the current spec,
  so even though the newest ASTC texture formats are supported in `wgpu`,
  they're not available in Firefox yet.)

- `wgpu` got a new feature, `id32`, which cbindgen needed to be told
  about so that it would generate preprocessor-protected code like
  this:

      #if defined(WGPU_FEATURE_ID32)
      typedef uint32_t WGPUNonZeroId;
      #endif

      #if !defined(WGPU_FEATURE_ID32)
      typedef uint64_t WGPUNonZeroId;
      #endif

  instead of just spitting out two conflicting definitions of
  `WGPUNonZeroId`.

- The `wgpu_core::hub::IdentityHandlerFactory` trait's `spawn` method
  no longer takes a `min_index` argument. (Our implementations of that
  trait never used that argument anyway, so this was easy to
  accommodate.)

Differential Revision: https://phabricator.services.mozilla.com/D142779
2022-04-07 00:33:59 +00:00
Cristian Tuns c32609ba81 Backed out changeset b67fef0360d9 (bug 1762730) for causing build bustages CLOSED TREE 2022-04-05 17:37:32 -04:00
Jim Blandy b2c42307d0 Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert
New versions of several crates are introduced to third_party/rust, by
changing the versions requested in `gfx/wgpu_bindings/Cargo.toml` and
running `mach vendor rust`:

- `wgpu-core`, `wgpu-hal`, and `wgpu-types`, as used by `wgpu_bindings`
- `naga`, `ash`, and `metal`, as used by the above

These are all exact copies of the upstream sources, at the git
revisions listed in `.cargo/config.in`.

This brings in fixes for some upstream `wgpu` bugs that were fuzzblockers:

- Compute pipelines never freed at runtime, leaking memory #2564
  https://github.com/gfx-rs/wgpu/issues/2564

- Device::drop doesn't actually free the device when using backend::direct::Context #2563
  https://github.com/gfx-rs/wgpu/issues/2563

The Firefox sources also needed some adjustments to catch up with
upstream changes:

- The C type `mozilla::webgpu::ffi::WGPUTextureFormat` is now a struct
  containing a tag enum and a union, not just an enum. This is needed
  for [gfx-rs/wgpu#2477](https://github.com/gfx-rs/wgpu/pull/2477).

  (Note that Firefox's `WebGPU.webidl` is behind the current spec,
  so even though the newest ASTC texture formats are supported in `wgpu`,
  they're not available in Firefox yet.)

- `wgpu` got a new feature, `id32`, which cbindgen needed to be told
  about so that it would generate preprocessor-protected code like
  this:

      #if defined(WGPU_FEATURE_ID32)
      typedef uint32_t WGPUNonZeroId;
      #endif

      #if !defined(WGPU_FEATURE_ID32)
      typedef uint64_t WGPUNonZeroId;
      #endif

  instead of just spitting out two conflicting definitions of
  `WGPUNonZeroId`.

- The `wgpu_core::hub::IdentityHandlerFactory` trait's `spawn` method
  no longer takes a `min_index` argument. (Our implementations of that
  trait never used that argument anyway, so this was easy to
  accommodate.)

Differential Revision: https://phabricator.services.mozilla.com/D142779
2022-04-05 20:13:28 +00:00
Dzmitry Malyshau 57c2e6e6cf Bug 1746312 - Return WebGPU errors from RenderBundle creation r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D134986
2022-01-04 23:04:08 +00:00
Dzmitry Malyshau 03ac646a6e Bug 1743668 - WebGPU debug groups r=jimb,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D134018
2021-12-21 14:51:16 +00:00
Dzmitry Malyshau 2d5c98a492 Bug 1710679 - Implement WebGPU render bundles r=webidl,jgilbert,smaug
Differential Revision: https://phabricator.services.mozilla.com/D114878
2021-05-26 20:30:45 +00:00
Dzmitry Malyshau f85b99fbce Bug 1611024 - Turn WebGPU programmable passes into interface mixins r=jgilbert,webidl,bzbarsky
this makes us closer to the upstream spec and removes a bunch of useless code

Differential Revision: https://phabricator.services.mozilla.com/D62377
2020-02-11 03:03:47 +00:00