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

250 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 4b37a00d47 Bug 1689834. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146102
2022-05-17 14:14:12 +00:00
Andrew Osmond c2aed688a2 Bug 1768337. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146222
2022-05-17 14:01:34 +00:00
Jim Blandy 6ca282be89 Bug 1769633: Update wgpu to b51fd851. r=jgilbert
Fix Firefox for compute_pass_dispatch functions renamed upstream.

Remove set_index_buffer ffi functions; they're now in wgpu.

Differential Revision: https://phabricator.services.mozilla.com/D146509
2022-05-17 03:09:07 +00:00
Molnar Sandor 8713e0bf9c Backed out changeset db25bd6ef77e (bug 1689834) for causing build bustages in webgpu/Buffer.cpp. CLOSED TREE 2022-05-17 03:58:25 +03:00
Molnar Sandor f4c40b82c0 Backed out 2 changesets (bug 1769633) for causing build bustages in jimb/rust/wgpu/wgpu-core. CLOSED TREE
Backed out changeset d7b9bac2ace5 (bug 1769633)
Backed out changeset 82d7d8a51cdd (bug 1769633)
2022-05-17 03:39:06 +03:00
Andrew Osmond 2fd8458561 Bug 1689834. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146102
2022-05-17 00:34:13 +00:00
Jim Blandy ec00294922 Bug 1769633: Update wgpu to b51fd851. r=jgilbert
Fix Firefox for compute_pass_dispatch functions renamed upstream.

Remove set_index_buffer ffi functions; they're now in wgpu.

Differential Revision: https://phabricator.services.mozilla.com/D146509
2022-05-17 00:26:01 +00:00
Jim Blandy 2b4ba22045 Bug 1752538: Properly report GPURenderPassDescriptors with too many color attachments. r=jgilbert
The WebGPU spec says that `beginRenderPass` should generate a
validation error if the valid usage rules for
`GPURenderPassDescriptor` are not satisfied. In particular, a
`GPURenderPassDescriptor` may not contain more than eight color
attachments.

The `wgpu-core` crate will panic if a
`wgpu_core::command::RenderPassDescriptor` contains too many color
attachments.  This is safe, but panics are not acceptable in Firefox,
so it falls to our WebGPU implementation to perform the error checks
described by the spec.

Since WebGPU error handling records the first error to occur within
each error scope, the API is sensitive to the order in which errors
are generated. To ensure that the error is properly ordered with
respect to other messages sent to the device, we must send the error
to compositor process. The WebGPUParent will then handle it
interleaved appropriately with other Device timeline activity.

Differential Revision: https://phabricator.services.mozilla.com/D146391
2022-05-17 00:25:35 +00:00
Andrew Osmond 54c2eb6792 Bug 1768848 - Update GPUComputePassEncoder method names to follow WebGPU spec. r=gfx-reviewers,lsalzman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D146072
2022-05-13 10:37:08 +00:00
Norisz Fay f9687fa0cf Backed out changeset fcf35978c791 (bug 1768848) for causing build bustages on WebGPUBinding.cpp CLOSED TREE 2022-05-12 18:01:56 +03:00
Andrew Osmond 4e812d5189 Bug 1751064 - Expose additional supported limits for WebGPU. r=gfx-reviewers,lsalzman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D146071
2022-05-12 14:46:56 +00:00
Andrew Osmond eac9952307 Bug 1768848 - Update GPUComputePassEncoder method names to follow WebGPU spec. r=gfx-reviewers,lsalzman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D146072
2022-05-12 14:45:27 +00:00
Kagami Sascha Rosylight cb9dcf1864 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
Kagami Sascha Rosylight 54d369d804 Bug 1768189 - Part 41: Apply modernize-concat-nested-namespaces to dom/webgpu/BindGroup.h ... r=andi
Depends on D145776

Differential Revision: https://phabricator.services.mozilla.com/D145777
2022-05-09 20:41:19 +00:00
Kagami Sascha Rosylight 11340de5d4 Bug 1768189 - Part 40: Apply modernize-concat-nested-namespaces to dom/webauthn/PublicKeyCredential.h ... r=andi
Depends on D145775

Differential Revision: https://phabricator.services.mozilla.com/D145776
2022-05-09 20:41:19 +00:00
Jim Blandy 92953cf50f Bug 1752869: Handle invalid BindGroupLayouts better. r=jgilbert
Arrange for passing an invalid `BindGroupLayout` to `CreatePipelineLayout` or
`CreateBindGroup` to produce an invalid `PipelineLayout`/`BindGroup`, instead of
trying to pass the `BindGroupLayout`'s bogus `RawId` (which is zero) over to the
GPU process, causing a panic in deserialization (thank you, Rust!).

Arrange for a `PipelineLayout` constructed with a zero `RawId` to mark itself
invalid, as most other WebGPU content objects do. This permits
`WebGPUChild::DeviceCreatePipelineLayout` to return zero if the descriptor is
invalid.

Differential Revision: https://phabricator.services.mozilla.com/D145036
2022-04-29 00:31:20 +00:00
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
Andrew Osmond 6e033cd6a3 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
Andrew Osmond 6921ea66d8 Bug 1765816 - Expose front buffer canvas contents when painting for Firefox Screenshots for WebGPU. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D144868
2022-04-27 18:27:37 +00:00
Andrew Osmond bdc5c410a4 Bug 1755704 - Part 2. Implement stubbed out surface related WebGPU canvas methods. r=gfx-reviewers,lsalzman
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144309
2022-04-27 16:05:28 +00:00
Andrew Osmond ddc415daba Bug 1755704 - Part 1. Add support for reading back the front buffer for WebGPU. r=gfx-reviewers,lsalzman
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144308
2022-04-27 16:05:28 +00:00
Csoregi Natalia 8f3654680c Backed out 3 changesets (bug 1755704, bug 1765816) for causing reftest failures on webgl-color-test.html
Backed out changeset 2f074e2385d4 (bug 1765816)
Backed out changeset cd0b9e084bcd (bug 1755704)
Backed out changeset 39a846e43162 (bug 1755704)
2022-04-24 02:33:33 +03:00
Andrew Osmond 6504eb38b3 Bug 1752155 - Refactor WebGPU's ValidationError to make it constructable from JS. r=gfx-reviewers,lsalzman,webidl,edgar
Differential Revision: https://phabricator.services.mozilla.com/D144322
2022-04-23 18:15:51 +00:00
Andrew Osmond c55d373481 Bug 1755704 - Part 2. Implement stubbed out surface related WebGPU canvas methods. r=gfx-reviewers,lsalzman
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144309
2022-04-23 16:45:10 +00:00
Andrew Osmond 382feb7053 Bug 1755704 - Part 1. Add support for reading back the front buffer for WebGPU. r=gfx-reviewers,lsalzman
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144308
2022-04-23 16:45:10 +00:00
Molnar Sandor 86256102b3 Backed out 3 changesets (bug 1765816, bug 1755704) for causing bp hybrid bustages. CLOSED TREE
Backed out changeset 505897037daf (bug 1765816)
Backed out changeset bc4e2999a2a7 (bug 1755704)
Backed out changeset 26b11a2833b0 (bug 1755704)
2022-04-22 18:03:57 +03:00
Andrew Osmond c9e7d96bfe Bug 1755704 - Part 2. Implement stubbed out surface related WebGPU canvas methods. r=gfx-reviewers,lsalzman
This patch hooks up the improved CanvasManagerChild::GetSnapshot method
to the WebGPU canvas context object in order to do readbacks for various
DOM facing methods such as ConvertToBlob and for Firefox Screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144309
2022-04-22 15:05:43 +00:00
Andrew Osmond 720de7a009 Bug 1755704 - Part 1. Add support for reading back the front buffer for WebGPU. r=gfx-reviewers,lsalzman
This reworks the CanvasManagerChild::GetSnapshot method to work with
WebGPU. This will allow it to be called for a WebGPU context from any
thread, which is useful for screenshots.

Differential Revision: https://phabricator.services.mozilla.com/D144308
2022-04-22 15:05:42 +00:00
Jim Blandy 94f2ec8fbe Bug 1755702: Return NOT_IMPLEMENTED from mozilla::webgpu::CanvasContext::GetInputStream. r=jgilbert
Continue to set the returned stream to `nullptr` (which callers do not
check for, but is safe), but return `NS_ERROR_NOT_IMPLEMENTED` instead
of `NS_OK` --- callers do check the `nsresult`.

Returning an `NS_FAILED` result from our `GetInputStream`
implementation causes `HTMLCanvasElement.prototype.toDataURL` to
return the fallback value `"data:,"`.

Differential Revision: https://phabricator.services.mozilla.com/D144242
2022-04-21 18:01:38 +00:00
Jim Blandy 84f5976ec1 Bug 1765179: Remove dom/webgpu/ffi. r=jgilbert DONTBUILD
Remove the unused source directory `dom/webgpu/ffi`.

The `wgpu_ffi_generated.h` header actually #included by
`gfx/wgpu_bindings/wgpu.h` is generated by `gfx/wgpu_bindings/moz.build` at
build time and placed in the obj directory. The copy in the source directory is
ignored, and it's confusing to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D143931
2022-04-19 22:26:40 +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
Andrew Osmond 32123744b3 Bug 1753302 - Part 3. Add basic worker thread tests for WebGPU. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D141503
2022-04-04 16:42:02 +00:00
Andrew Osmond 3fe3f7ca98 Bug 1753302 - Part 1. Integrate WebGPU with OffscreenCanvas plumbing. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D141491
2022-04-04 16:42:02 +00:00
Andrew Osmond 0b303e481f Bug 1760810 - Mark WebGPU tests as failing on Ubuntu 18.04 and Windows 7. r=gfx-reviewers,lsalzman
The WebGPU tests are actually failing silently on Ubuntu 18.04 and
Windows 7. This is because we catch the exception thrown in the async
function wrapping the test and then discard it at the end. Now if we
catch any errors, we fail the test, which requires us to mark these
tests as failing on some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141793
2022-03-23 12:43:00 +00:00
Andrew Osmond 78afd0ab38 Bug 1760663 - Add blocklist support for WebGPU. r=gfx-reviewers,nical
This patch just adds the plumbing to allow for baked in blocklist rules
or the downloadable blocklist to prevent certain configurations from
getting WebGPU. It does not add any rules.

It also changes us from allowing WebGPU only in nightly, including
tests, to not release and not beta. This allows try to run the WebGPU
tests as expected, since even try builds forked from mozilla-central are
not considered nightly builds by CI (or so it seems).

Differential Revision: https://phabricator.services.mozilla.com/D141682
2022-03-22 15:22:39 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +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
Nika Layzell 9e65eb911e Bug 1751948 - Part 1: Fix IPDL unified build issues, r=ipc-reviewers,mccr8
The changes in this patch stack will change how IPDL generated files are built,
such that these issues are now surfaced, especially during non-unified builds.

Differential Revision: https://phabricator.services.mozilla.com/D137165
2022-02-28 21:01:47 +00:00
Andrew Osmond c18a944c15 Bug 1754978 - Part 2. Switch WebGPU to use async image pipelines for display. r=kvark
This patch removes more main thread dependencies from the content side
of WebGPU. Instead of issuing a resource update for an external image,
we now use an async image pipeline in conjunction with
CompositableInProcessManager from part 1. This allows us to update the
HTMLCanvasElement bound to the WebGPU device without having to go
through the main thread, or even the content process after the swap
chain update / readback has been requested.

Differential Revision: https://phabricator.services.mozilla.com/D138887
2022-02-18 15:59:13 +00:00
Iulian Moraru 3dbfe82835 Backed out 2 changesets (bug 1754978) for causing valgrind bustages.
Backed out changeset 491a985fc34a (bug 1754978)
Backed out changeset 98983bf9eaed (bug 1754978)
2022-02-18 00:36:31 +02:00
Andrew Osmond a18bf8a50c Bug 1754978 - Part 2. Switch WebGPU to use async image pipelines for display. r=kvark
This patch removes more main thread dependencies from the content side
of WebGPU. Instead of issuing a resource update for an external image,
we now use an async image pipeline in conjunction with
CompositableInProcessManager from part 1. This allows us to update the
HTMLCanvasElement bound to the WebGPU device without having to go
through the main thread, or even the content process after the swap
chain update / readback has been requested.

Differential Revision: https://phabricator.services.mozilla.com/D138887
2022-02-16 22:23:20 +00:00
Sylvestre Ledru 98949ee751 Bug 1754767 - Remove duplicate includes r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D138441
2022-02-11 10:01:15 +00:00
Andrew Osmond 5e0eefe182 Bug 1754556 - Update WebGPU external image resource only after present is complete. r=kvark
This patch ensures that we only update the external image resource for
WebGPU when there has been an actual change for the resource. In order
to guarantee this, we wait for the present to complete, and only then
issue the update. WebRenderBridgeChild::SendResourceUpdates will also
trigger a frame generation if any resources were changed, which means we
don't need to trigger a paint on the frame itself anymore.

Note that we still have a race condition when we write into the
MemoryTextureHost while in PresentCallback, and the renderer thread may
be accessing the pixel data to upload to the GPU.

Differential Revision: https://phabricator.services.mozilla.com/D138349
2022-02-11 01:26:42 +00:00
Andrew Osmond 8170056817 Bug 1754302 - WebGPU should consistently use GetCurrentSerialEventTarget instead of GetMainThreadSerialEventTarget. r=kvark
This is necessary for when WebGPU objects are accessed from a worker
thread instead of the main thread. It should be otherwise a
non-functional change.

Differential Revision: https://phabricator.services.mozilla.com/D138206
2022-02-09 22:01:48 +00:00