Commit graph

57 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Kagami Sascha Rosylight
fc9e75a985 Bug 1723050 - Part 32: Replace typedef by using in dom/webgpu/ r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D121330
2021-08-05 00:11:58 +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
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
Simon Giesecke
760cc7e936 Bug 1679522 - Fix include directives and forward declarations. r=andi,necko-reviewers,jgilbert
- Add missing include directives and forward declarations.
- Remove some extra include directives.
- Add missing namespace qualifications.
- Move include directives out of namespace in toolkit/xre/GlobalSemaphore.h

Differential Revision: https://phabricator.services.mozilla.com/D98894
2021-03-25 10:19:44 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Andi-Bogdan Postelnicu
522be9da14 Bug 1626555 - Add dom/webgpu to the list of non-unified-build-compatible directories. r=sg,kvark
Differential Revision: https://phabricator.services.mozilla.com/D97166
2020-11-16 19:57:04 +00:00
Razvan Maries
bd8ba64c9d Backed out 2 changesets (bug 1626555) as per Andi's request. CLOSED TREE
Backed out changeset 22e23d9340a2 (bug 1626555)
Backed out changeset 02ea10ade875 (bug 1626555)
2020-11-16 18:45:15 +02:00
Andi-Bogdan Postelnicu
575adf71a5 Bug 1626555 - Add dom/webgpu to the list of non-unified-build-compatible directories. r=sg,kvark
Differential Revision: https://phabricator.services.mozilla.com/D97166
2020-11-16 15:37:09 +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
Dzmitry Malyshau
505438ed91 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-06 18:59:27 +00:00
Dzmitry Malyshau
544f262737 Bug 1653161 - Implement Queue.writeBuffer and writeTexture in WebGPU r=jgilbert,webidl,smaug
Updates wgpu to bd50867bb8c66ac9dec50046d066c02b8f7a3fc1

Differential Revision: https://phabricator.services.mozilla.com/D83734
2020-07-28 22:26:21 +00:00
Dzmitry Malyshau
e1cc91964c Bug 1622846 - Update WebGPU IDL type definitions r=webidl,smaug
Using typedefs with enforced ranges, moved out of D83734

Differential Revision: https://phabricator.services.mozilla.com/D84214
2020-07-20 21:07:03 +00:00
Dzmitry Malyshau
02f2325796 Bug 1630072 - WebGPU CanvasContext invalidation r=jgilbert,aosmond
This change enables light tracking of the commands and submissions
that affect a CanvasContext. Upon reaching the GPUQueue, they send
a signal for the parent HTML Element to be invalidated.
We are also invalidating the HTML Element and requesting a new
frame to be built on the creation of the swapchain.

Differential Revision: https://phabricator.services.mozilla.com/D71194
2020-04-20 23:50:04 +00:00
Dzmitry Malyshau
d652ce10bb Bug 1602888 - WebGPU copy operations r=jgilbert,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D70637

--HG--
extra : moz-landing-system : lando
2020-04-13 13:59:24 +00:00
Dzmitry Malyshau
3021defc28 Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

--HG--
extra : moz-landing-system : lando
2020-04-06 22:29:18 +00:00
Cosmin Sabou
2f4d9af7d3 Backed out changeset bc6b2b003c6e (bug 1602133) for causing build bustages on CanvasRenderingContextHelper.cpp.
--HG--
extra : histedit_source : 917f3627a3e3f8dab0d806b69fc716bfd9f1d483
2020-04-06 23:46:51 +03:00
Dzmitry Malyshau
5004affc0e Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

--HG--
extra : moz-landing-system : lando
2020-04-06 20:10:03 +00:00
Bogdan Tara
7f7cc68c64 Backed out changeset 377a757c583d (bug 1602133) for webgpu related bustages CLOSED TREE 2020-04-06 21:59:57 +03:00
Dzmitry Malyshau
4c3a924336 Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

Differential Revision: https://phabricator.services.mozilla.com/D68032

--HG--
extra : moz-landing-system : lando
2020-04-02 19:55:01 +00:00
Dzmitry Malyshau
199a362906 Bug 1602131 - WebGPU render passes r=jgilbert,webidl,smaug
Adds support for recording render passes in WebGPU.
The `wgpu` logo is also added to the repository ("gfx/wgpu/logo.png") under [CC-BY-SA](https://creativecommons.org/licenses/by-sa/3.0/) license.

Differential Revision: https://phabricator.services.mozilla.com/D62461

--HG--
extra : moz-landing-system : lando
2020-02-19 19:25:30 +00:00
Dzmitry Malyshau
be7fae486d Bug 1609175 - WebGPU bind groups and compute pipelines r=jgilbert,webidl,smaug,bzbarsky
Adds support for bind groups and compute pipelines
The end goal of this PR is to run the compute example.

Differential Revision: https://phabricator.services.mozilla.com/D60746

--HG--
extra : moz-landing-system : lando
2020-01-24 16:27:09 +00:00
Noemi Erli
835cec6cf9 Backed out changeset 136b3044f6a6 (bug 1609175) for causing build bustages in WebGPUChild.cpp CLOSED TREE 2020-01-24 17:20:31 +02:00
Dzmitry Malyshau
73eff15f2c Bug 1609175 - WebGPU bind groups and compute pipelines r=jgilbert,webidl,smaug,bzbarsky
Adds support for bind groups and compute pipelines
The end goal of this PR is to run the compute example.

Differential Revision: https://phabricator.services.mozilla.com/D60746

--HG--
extra : moz-landing-system : lando
2020-01-24 05:05:34 +00:00