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

71 Коммитов

Автор SHA1 Сообщение Дата
Jim Blandy 5c765edf96 Bug 1766754: Document WebGPU FFI `ErrorBuffer` types. r=jgilbert DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D144904
2022-04-28 05:27:25 +00:00
Jim Blandy 2910e76efe Bug 1766569: Remove `wgpu_bindings::server::GlobalExt` trait. r=jgilbert
Replace the `GlobalExt` trait with a simple `impl Global` block, which
has exactly the same effect.

Differential Revision: https://phabricator.services.mozilla.com/D144782
2022-04-28 05:26:26 +00:00
Tom Ritter 63ed48b5e1 Bug 1764659: Add wgpu bindings to Updatebot r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D143766
2022-04-27 20:09:38 +00:00
Jim Blandy dab2ea0580 Bug 1765462: Update wgpu to 0b61a191 (2022-4-18) r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D144074
2022-04-20 16:29:04 +00:00
Jim Blandy 8c4605cfa4 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 0f7608c52d Backed out changeset b67fef0360d9 (bug 1762730) for causing build bustages CLOSED TREE 2022-04-05 17:37:32 -04:00
Jim Blandy 8075da04f9 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
Emilio Cobos Álvarez 94d7e11a79 Bug 1758169 - Clean up WebGPU lifetime handling a bit. r=nical
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D140384
2022-03-08 15:00:39 +00:00
Nicolas Silva 7c8e9a875e Bug 1755503 - Support recording wgpu traces for multiple instances. r=kvark"
Record the trace of each instance into "$WGPU_TRACE/$IDX/" where $IDX is a monotonically increasing integer per instance.

Differential Revision: https://phabricator.services.mozilla.com/D138814
2022-02-16 19:04:20 +00:00
Marian-Vasile Laza 0bf097fcd0 Backed out changeset 27c56f453b34 (bug 1755503) for causing build bustages. CLOSED TREE 2022-02-16 15:18:54 +02:00
Nicolas Silva ffc6811e7d Bug 1755503 - Support recording wgpu traces for multiple instances. r=kvark"
Record the trace of each instance into "$WGPU_TRACE/$IDX/" where $IDX is a monotonically increasing integer per instance.

Differential Revision: https://phabricator.services.mozilla.com/D138814
2022-02-16 10:02:07 +00:00
Dzmitry Malyshau 95579c6443 Bug 1750866 - Omit WebGPU writeTexture checks on the client side r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D136279
2022-01-20 15:17:08 +00:00
Marian-Vasile Laza 5a163a3f13 Backed out changeset 6fb758e73dd9 (bug 1750866) for causing build bustages on Queue.cpp. CLOSED TREE 2022-01-20 06:47:42 +02:00
Dzmitry Malyshau b756d76e96 Bug 1750866 - Omit WebGPU writeTexture checks on the client side r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D136279
2022-01-20 00:58:39 +00:00
Dzmitry Malyshau 71dcb0b551 WIP: Bug 1747750 - Return null WebGPU adapter r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D135645
2022-01-12 15:34:55 +00:00
Dzmitry Malyshau a892c28812 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 870e917d28 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
Andi-Bogdan Postelnicu b2883570dd Bug 1617369 - Reformat recent rust changes with rustfmt r=necko-reviewers,kershaw
Updated with rustfmt 1.4.37-stable (f1edd04 2021-11-29)

Depends on D132868

Differential Revision: https://phabricator.services.mozilla.com/D132869
2021-12-06 17:15:33 +00:00
Dzmitry Malyshau caaffc3a03 Bug 1622846 - Update wgpu to 28ba9d8 r=jimb,emilio
Update GPUTextureUsage bit names to match upstream.

Differential Revision: https://phabricator.services.mozilla.com/D132058
2021-11-29 21:57:04 +00:00
Csoregi Natalia 9c8715f550 Backed out changeset 9e97159bb402 (bug 1622846) for causing bp-hybrid bustages on WebGPUChild.cpp CLOSED TREE 2021-11-29 21:30:42 +02:00
Dzmitry Malyshau 35ccd380fa Bug 1622846 - Update wgpu to 5f6c067 r=jimb,emilio
Update GPUTextureUsage bit names to match upstream.

Differential Revision: https://phabricator.services.mozilla.com/D132058
2021-11-29 18:37:21 +00:00
Jamie Nicol 0bf9787775 Bug 1741142 - Don't export ANativeWindow_setBuffersGeometry declaration from wgpu. r=kvark
It conflicts with the NDK header's declaration, causing a build
failure.

Differential Revision: https://phabricator.services.mozilla.com/D131115
2021-11-15 17:21:22 +00:00
Mike Hommey 2f1f02f311 Bug 1736483 - Remove unused surfaces field in Identities. r=gfx-reviewers,kvark
Differential Revision: https://phabricator.services.mozilla.com/D128824
2021-10-27 02:05:47 +00:00
Dzmitry Malyshau 313f426df3 Bug 1729751 - Update wgpu and ron 3rd parties r=jimb
Brings a few important fixes:
  - better WGSL support
  - Solaris build (1729751)
  - crash in "_MTLCommandEncoder dealloc" (1729648)

Differential Revision: https://phabricator.services.mozilla.com/D125103
2021-09-10 18:24:02 +00:00
Dzmitry Malyshau 56f4d4bdc1 Bug 1730014 - Avoid ASCII intermediate for WGSL shader code r=jgilbert,webidl,emilio
we were doing UTF16 -> ASCII null term -> UTF8, and we were losing information on the way.
Now we go UTF16 -> UTF8 -> UTF8 null term
Also, we no longer accept SPIR-V

Differential Revision: https://phabricator.services.mozilla.com/D125123
2021-09-10 17:19:41 +00:00
Dzmitry Malyshau 5695f517a5 Bug 1726626 - Move gfx/wgpu into a 3rd party dependency r=jgilbert,bholley
This update makes wgpu a vendored dependency instead of having it in gfx/wgpu.

## Notes


It relies on https://phabricator.services.mozilla.com/D123157

It has a quirk related to OpenGL ES backend. Previousy, we manually had to disable GL backend
in order to avoid vendoring WASM dependencies in. This time, manual editing is more complicated,
so instead this change adds a few cargo patch lines to point WASM dependencies to dummy projects.

The update also totally removes SPIRV-Cross, since the latest `wgpu` doesn't depend on it any more.
The compiled binary size for Gecko should improve with this.

Differential Revision: https://phabricator.services.mozilla.com/D123153
2021-09-03 16:52:08 +00:00
Dzmitry Malyshau 1da5651ba2 Bug 1622846 - Update WebGPU API to latest and wgpu-core to 0.9 r=webidl,jgilbert,jimb,emilio
This *mostly* gets us the latest WebIDL API of WebGPU. There is a few limits we are missing, and maybe some things I didn't notice.
But it gets us the new `GPUCanvasContext`, `GPUSupportedLimits`, and `GPUVertexStepMode`.

Differential Revision: https://phabricator.services.mozilla.com/D120764
2021-08-18 14:11:21 +00:00
Brindusan Cristian 1cdd46e3ba Backed out changeset e34f15d5e74d (bug 1622846) for causing linux toolchain build bustages.
CLOSED TREE
2021-08-18 07:58:38 +03:00
Dzmitry Malyshau 6d7cfc6c90 Bug 1622846 - Update WebGPU API to latest and wgpu-core to 0.9 r=webidl,jgilbert,jimb,emilio
This *mostly* gets us the latest WebIDL API of WebGPU. There is a few limits we are missing, and maybe some things I didn't notice.
But it gets us the new `GPUCanvasContext`, `GPUSupportedLimits`, and `GPUVertexStepMode`.

Differential Revision: https://phabricator.services.mozilla.com/D120764
2021-08-17 15:22:45 +00:00
Noemi Erli a523fe1ad1 Backed out changeset 3cb3442efede (bug 1622846) for causing Bug 1722702 CLOSED TREE 2021-07-29 20:14:46 +03:00
Dzmitry Malyshau 9963bd1ee1 Bug 1622846 - Update WebGPU API to latest and wgpu-core to 0.9 r=webidl,jgilbert,jimb,emilio
This *mostly* gets us the latest WebIDL API of WebGPU. There is a few limits we are missing, and maybe some things I didn't notice.
But it gets us the new `GPUCanvasContext`, `GPUSupportedLimits`, and `GPUVertexStepMode`.

Differential Revision: https://phabricator.services.mozilla.com/D120764
2021-07-27 22:37:46 +00:00
Andi-Bogdan Postelnicu d844b7a2dd Bug 1617369 - Reformat recent rust changes with rustfmt r=necko-reviewers,webdriver-reviewers,kvark
Updated with rustfmt 1.4.36-stable (7de6968 2021-02-07)

Differential Revision: https://phabricator.services.mozilla.com/D117906
2021-06-17 11:00:22 +00:00
Dzmitry Malyshau e6cefd8df1 Bug 1713179 - Update wgpu to eadaa1b7d8f585761e28445904fe619b180aca0d r=jimb
Includes a number of correctness fixes.
Also, optimizes resource tracking for cases like the Animometer benchmark.

Differential Revision: https://phabricator.services.mozilla.com/D116491
2021-06-03 17:09:01 +00:00
Dzmitry Malyshau cee0219fda 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 163a4a7ed8 Bug 1709462 - Fix freeing of WebGPU bind group layouts r=jimb
When the pipeline layout is implicit at pipeline creation,
we collect the IDs of BGLs, to be able to produce GPUBindGroupLayout
object upon user request. However, the produced object didn't know if
it owns the ID or borrows it, so it would issue a "drop" when going out of scope.

This change establishes this distinction. In addition, it gets the Pipeline Layout ID,
and together with the BGL ids, they are sent to GPU process upon pipeline destruction.

When the GPU process is done with these IDs used, it will kick back a message to the
Content process, allowing the IDs to be reclaimed.

Differential Revision: https://phabricator.services.mozilla.com/D114649
2021-05-18 16:26:27 +00:00
Andi-Bogdan Postelnicu a2692f41ac Bug 1617369 - Reformat recent rust changes with rustfmt. r=webdriver-reviewers,kvark
Updated with rustfmt 1.4.36-stable (7de6968 2021-02-07)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113295
2021-04-27 06:05:08 +00:00
Dzmitry Malyshau cdb4fe1fcb Bug 1622846 - Update BlendFactor API in WebGPU r=webidl,jimb,smaug
This is another incremental update of wgpu and WebGPU APIs.
It increases stability and makes us run most of the Austin's samples (again).
Likely fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1704148

Differential Revision: https://phabricator.services.mozilla.com/D112828
2021-04-22 19:18:49 +00:00
Dzmitry Malyshau 89ced952fc Bug 1622846 - Update wgpu and WebGPU IDL for the new copy views API r=webidl,jgilbert,smaug
Updates wgpu, WebGPU IDL, in particular the ImageCopyXxx types and render pass attachments.
Adds explicit mapping of the GPUTextureFormat enum. Our old casting was incorrect, because the enums diverged a bit.

Differential Revision: https://phabricator.services.mozilla.com/D110997
2021-04-08 14:35:42 +00:00
Butkovits Atila 8d90cf4b42 Backed out changeset 5b033d5d6e6d (bug 1622846) for causing bustages on WebGPUChild.cpp. CLOSED TREE 2021-04-08 06:08:25 +03:00
Dzmitry Malyshau 92d0383ea9 Bug 1622846 - Update wgpu and WebGPU IDL for the new copy views API r=webidl,jgilbert,smaug
Updates wgpu, WebGPU IDL, in particular the ImageCopyXxx types and render pass attachments.
Adds explicit mapping of the GPUTextureFormat enum. Our old casting was incorrect, because the enums diverged a bit.

Differential Revision: https://phabricator.services.mozilla.com/D110997
2021-04-07 22:46:47 +00:00
Dzmitry Malyshau 5249d3e499 Bug 1697509 - Fix WebGPU shaders and adapter limits r=jgilbert
Expose adapter limits, hook up spirv-cross

Differential Revision: https://phabricator.services.mozilla.com/D107840
2021-03-16 22:57:08 +00:00
Dzmitry Malyshau 29595bee3e Bug 1696066 - Serialize Queue write commands with Rust r=jgilbert
Based on https://phabricator.services.mozilla.com/D107013
Refactors our Queue write commands to use less of WebGPUSerialize.h
Also routes the errors from all queue operations properly to the client.

Differential Revision: https://phabricator.services.mozilla.com/D107162
2021-03-05 00:07:24 +00:00
Dzmitry Malyshau 27e5308381 Bug 1622846 - Update WebGPU API with wgpu r=jgilbert,webidl,smaug
This is another WebGPU API update, it picks up a lot of changes that were made recently:
  - new bind group layout
  - new render pipeline descriptor
  - new vertex formats
  - limits
  - compressed texture formats
  - index format
  - query sets
  - and more small ones!

It also brings in the updated `gfx/wgpu` to support these API changes.

Differential Revision: https://phabricator.services.mozilla.com/D107013
2021-03-04 21:25:46 +00:00
Brindusan Cristian cae8a0ef30 Backed out changeset 0c0c723b0a0e (bug 1622846) for build bustages in Device.h. CLOSED TREE 2021-03-04 22:02:58 +02:00
Dzmitry Malyshau 65199ec16a Bug 1622846 - Update WebGPU API with wgpu r=jgilbert,webidl,smaug
This is another WebGPU API update, it picks up a lot of changes that were made recently:
  - new bind group layout
  - new render pipeline descriptor
  - new vertex formats
  - limits
  - compressed texture formats
  - index format
  - query sets
  - and more small ones!

It also brings in the updated `gfx/wgpu` to support these API changes.

Differential Revision: https://phabricator.services.mozilla.com/D107013
2021-03-04 17:48:28 +00:00
Dzmitry Malyshau 57efe16247 Bug 1693329 - Update WebGPU code to use the new drop IPC r=jgilbert
Instead of having a separate IPC message type for every kind of object ID freeing,
we are encoding this into Rust enums and passing under the same DropAction.
This saves a bunch of lines of code, and allows us to free IDs in bulk where we need it.

Differential Revision: https://phabricator.services.mozilla.com/D105492
2021-03-02 20:11:31 +00:00
Dzmitry Malyshau 6b5716d415 Bug 1680376 - WebGPU error handling infrastructure r=jgilbert,webidl,smaug
the goal of this PR is to provide the necessary
infrastructure to handle errors on the GPU process side and send them
back to the client side, triggering the uncaptured error events.

Differential Revision: https://phabricator.services.mozilla.com/D98542
2020-12-18 20:07:47 +00:00
Dzmitry Malyshau 8f74799ba5 Bug 1676916 - Implicit bind group layouts in WebGPU r=jgilbert,webidl,smaug
This change updates and enables Naga to get the
SPIRV shaders parsed, validated, and reflected back into
implicit bind group layouts.
WebGPU examples heavily rely on the implicit layouts now,
and the PR also updates the WebIDL to make that possible.
With the change, we are able to run most of the examples again!

Differential Revision: https://phabricator.services.mozilla.com/D96850
2020-11-13 14:15:49 +00:00
Dzmitry Malyshau f9116a751d Bug 1622846 - Serialize WebGPU descriptors via Serde for IPC r=jgilbert,webidl,smaug
This PR updates wgpu to the latest and changes the way we pass object descriptors to the GPU process.
Instead of trying to convert them between DOM-CPP-IPDL-FFI-Rust, we now do DOM-FFI-Rust
and serialize them by serde into ipc::ByteBuf objects.

Differential Revision: https://phabricator.services.mozilla.com/D94908
2020-11-07 02:43:09 +00:00
Csoregi Natalia 1a3ae2644d Backed out changeset bdd3d7eb5927 (bug 1622846) for linux bustage on gfx/wgpu/wgpu-types/src/lib.rs. CLOSED TREE 2020-11-07 00:48:50 +02:00