Commit graph

79 commits

Author SHA1 Message Date
Brad Werth
41ee0ff78e Bug 1896195: Make CommandEncoder check for bridge existence when ending compute passes and render passes. r=webgpu-reviewers,nical
Because EndComputePass and EndRenderPass are called during cleanup, it's
necessary for the CommandEncoder to check for a non-null bridge. This is
noted as being necessary in dom/webgpu/ObjectModel.h.

Differential Revision: https://phabricator.services.mozilla.com/D210244
2024-05-14 15:03:27 +00:00
Nicolas Silva
d66485ea0f Bug 1889873 - Remove IsOpen in favor of CanSend. r=webgpu-reviewers,teoxoy
They are the same and the latter is more self explanatory.
The patch also addresses a couple of Cleanup methods where I forgot to check the bridge pointer.

Differential Revision: https://phabricator.services.mozilla.com/D206785
2024-04-05 15:59:38 +00:00
Nicolas Silva
411be68c90 Bug 1881518 - Recycle indices again. r=webgpu-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D202433
2024-04-05 07:42:05 +00:00
Erich Gubler
b5225f4bb4 Bug 1883810: fix(webgpu): don't enqueue OffscreenCanvases for presentation
Differential Revision: https://phabricator.services.mozilla.com/D203960
2024-03-13 16:03:11 +00:00
Erich Gubler
1a670cacb4 Bug 1883810: refactor(webgpu): subvert/targetContext/presentationContext for CommandEncoders r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D203959
2024-03-13 16:03:11 +00:00
Nicolas Silva
1682d832a6 Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-26 08:31:37 +00:00
Nicolas Silva
3de8db6f68 Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-26 08:31:37 +00:00
Sandor Molnar
4fe00e0322 Backed out 3 changesets (bug 1878308) for causing webgpu failures. CLOSED TREE
Backed out changeset 2887e360adb9 (bug 1878308)
Backed out changeset c5f276e2774d (bug 1878308)
Backed out changeset b3fb55591aa7 (bug 1878308)
2024-02-13 09:00:38 +02:00
Nicolas Silva
28dad5781e Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-13 04:59:05 +00:00
Nicolas Silva
1a0ae0fce6 Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-13 04:59:04 +00:00
Noemi Erli
f035c09b37 Backed out 3 changesets (bug 1878308) for causing wgpu_bindings related build bustages CLOSED TREE
Backed out changeset 330e9b1f94c2 (bug 1878308)
Backed out changeset c4a9d3751619 (bug 1878308)
Backed out changeset 36b086dfbd13 (bug 1878308)
2024-02-07 18:19:30 +02:00
Nicolas Silva
9d22a20b3b Bug 1878308 - Move the compute pass remoting logic into wgpu bindings. r=webgpu-reviewers,ErichDonGubler
Depends on D200444

Differential Revision: https://phabricator.services.mozilla.com/D200460
2024-02-07 15:53:26 +00:00
Nicolas Silva
58b6b2e66d Bug 1878308 - Move the render pass remoting logic into wgpu's bindings. r=webgpu-reviewers,ErichDonGubler
Depends on D200359

Differential Revision: https://phabricator.services.mozilla.com/D200444
2024-02-07 15:53:25 +00:00
Nicolas Silva
c13234b7b6 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
d3b847b4e6 Bug 1865830 - Implement CommandEncoder.clearBuffer. r=webgpu-reviewers,webidl,emilio,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D194233
2023-12-05 15:26:41 +00:00
Iulian Moraru
8af1c585c1 Backed out changeset 774b13e9f1e7 (bug 1865830) for causing mass build bustages. CLOSED TREE 2023-12-05 01:27:27 +02:00
Nicolas Silva
bc39e78852 Bug 1865830 - Implement CommandEncoder.clearBuffer. r=webgpu-reviewers,webidl,emilio,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D194233
2023-12-04 22:11:21 +00:00
Nicolas Silva
0187077a32 Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-22 14:15:35 +00:00
Brad Werth
e88f442492 Bug 1861985 - Let the parent process handle validating command encoders. r=webgpu-reviewers,webidl,saschanaz,jimb
This makes sure we never create an invalid (zero) ID after incorrect usage of a command encoder.
It also simplifies the code. The JS object should not do any validaion (per spec) and simply forward the commands to the parent process where all of the validation is done.

Differential Revision: https://phabricator.services.mozilla.com/D192839
2023-11-22 14:15:35 +00:00
Natalia Csoregi
000c9b4bb4 Backed out 4 changesets (bug 1861985, bug 1860958, bug 1865364) for causing bustage due to CommandEncoder. CLOSED TREE
Backed out changeset 3d6b04449863 (bug 1865364)
Backed out changeset 1e35eb31a789 (bug 1861985)
Backed out changeset e3f53b794c1d (bug 1861985)
Backed out changeset d676e8a3a515 (bug 1860958)
2023-11-22 13:52:44 +02:00
Nicolas Silva
3a7b3c6c1f Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-22 10:57:58 +00:00
Brad Werth
87097f8bed Bug 1861985 - Let the parent process handle validating command encoders. r=webgpu-reviewers,webidl,saschanaz,jimb
This makes sure we never create an invalid (zero) ID after incorrect usage of a command encoder.
It also simplifies the code. The JS object should not do any validaion (per spec) and simply forward the commands to the parent process where all of the validation is done.

Differential Revision: https://phabricator.services.mozilla.com/D192839
2023-11-22 10:57:57 +00:00
Cristian Tuns
b428472b9e Backed out 3 changesets (bug 1861985, bug 1860958) for causing build bustages in RefPtr.h CLOSED TREE
Backed out changeset 13f07117425f (bug 1861985)
Backed out changeset 0bdc4c60018e (bug 1861985)
Backed out changeset 5e6f2b2e19c6 (bug 1860958)
2023-11-21 14:07:35 -05:00
Nicolas Silva
26eccaa309 Bug 1861985 - Handle CommandBuffer/CommandBuffer lifecycle correctly. r=webgpu-reviewers,ErichDonGubler
In wgpu, command encoders and command buffers actually share the same identity and resource, so dropping one drops the other. This commit makes it so that our gecko wrappers take that into account. The lifetime is now tied to the encoder which may be held alive by a command buffer if there is one.

Differential Revision: https://phabricator.services.mozilla.com/D193313
2023-11-21 18:16:25 +00:00
Brad Werth
d8ba26f353 Bug 1861985 - Let the parent process handle validating command encoders. r=webgpu-reviewers,webidl,saschanaz,jimb
This makes sure we never create an invalid (zero) ID after incorrect usage of a command encoder.
It also simplifies the code. The JS object should not do any validaion (per spec) and simply forward the commands to the parent process where all of the validation is done.

Differential Revision: https://phabricator.services.mozilla.com/D192839
2023-11-21 18:16:25 +00:00
Nicolas Silva
c8f4b69bcd Bug 1865311 - Fix inconsistent destroy/drop naming in webgpu IPC. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D193894
2023-11-17 20:11:22 +00:00
Nicolas Silva
e7766e3c9e Bug 1856306 - Crash when an object is created with an invalid ID. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D189941
2023-10-27 13:06:18 +00:00
Erich Gubler
c9709fa89f Bug 1830762: refactor(webgpu): move ConvertExtent{,3DToFFI} to new Utility module r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D176847
2023-05-09 20:24:08 +00:00
Erich Gubler
11602a7aee Bug 1785863: typo: s/Unexptected/Unexpected r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D176106
2023-04-21 14:56:56 +00:00
Erich Gubler
16c7a51e67 Bug 1785863: fix(webgpu): s/0/1 for fallback field values of GPUExtent3D's sequence variant r=webgpu-reviewers,nical
We've been doing fallback values for the `sequence` variant of `GPUExtent3D` wrong! The WebGPU spec currently states in the description of the [`GPUExtent3D` type](https://gpuweb.github.io/gpuweb/#typedefdef-gpuextent3d) (emphasis mine):

> For a given `GPUExtent3D` value extent, depending on its type, the syntax:
>
> -   …
>
> -   `extent.height` refers to either `GPUExtent3DDict.height` or the second item of the sequence (**1 if not present**).
>
> -   `extent.depthOrArrayLayers` refers to either `GPUExtent3DDict.depthOrArrayLayers` or the third item of the sequence (**1 if not present**).

Implement spec-compliant behavior, that is, fill in 1s for missing `GPUExtent3D` fields.

Differential Revision: https://phabricator.services.mozilla.com/D176088
2023-04-21 14:56:56 +00:00
Nicolas Silva
1fe9277420 Bug 1827421 - wgpu api changes. r=webgpu-reviewers,webidl,teoxoy,smaug
Differential Revision: https://phabricator.services.mozilla.com/D175262
2023-04-19 21:53:19 +00:00
Nicolas Silva
ba23af9d48 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
d4e4ae35a5 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
c2f7c229ec 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
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
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
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
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
Dzmitry Malyshau
179d3960ce Bug 1713162 - Detect copies into WebGPU swapchain for presentation r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D116132
2021-05-27 17:20:28 +00:00
Dzmitry Malyshau
b1ba8a1269 Bug 1711587 - Support multiple canvases in WebGPU command encoder r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D115305
2021-05-20 19:20:03 +00:00
Dzmitry Malyshau
f25cc08f2a Bug 1710550 - Detect resolving into WebGPU canvas r=gw
Differential Revision: https://phabricator.services.mozilla.com/D114811
2021-05-11 05:42:20 +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
Joshua Groves
efea742965 Bug 1622846 - Use view instead of attachment to match upstream WebIDL r=kvark,emilio
Differential Revision: https://phabricator.services.mozilla.com/D107402
2021-03-08 16:20:34 +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