Commit graph

73 commits

Author SHA1 Message Date
Brad Werth
eb20f50272 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
Peter Van der Beken
62bdf442eb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Natalia Csoregi
8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
763356e4fb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +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
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
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
Kelsey Gilbert
8da04acf83 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
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
Kelsey Gilbert
8ce110a8e9 Bug 1837557 - Productionize webgpu pushErrorScope/popErrorScope. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D180456
2023-06-14 05:51:00 +00:00
Kelsey Gilbert
68589fab17 Bug 1817541 - Update load and store op handling to match webgpu spec changes. r=gfx-reviewers,webidl,jimb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D174802
2023-04-15 07:28:26 +00:00
Jim Blandy
0b85dc8089 Bug 1824871: Rename endPass -> end on GPURenderPassEncoder, GPUComputePassEncoder. r=webidl,webgpu-reviewers,teoxoy,smaug
These were renamed in [gpuweb#2560](https://github.com/gpuweb/gpuweb/pull/2560).

Differential Revision: https://phabricator.services.mozilla.com/D173785
2023-04-12 17:52:07 +00:00
Jim Blandy
aed45347b7 Bug 1813127: Have GPURenderPassEncoder.setBlendConstant accept sequence<double> colors. r=nical,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D168265
2023-02-01 18:16:20 +00:00
Cosmin Sabou
cf44a6155b Backed out changeset ffba597a6455 (bug 1813127) for causing build bustages on RenderPassEncoder.cpp. CLOSED TREE 2023-01-31 20:31:45 +02:00
Jim Blandy
4832fa9ed3 Bug 1813127: Have GPURenderPassEncoder.setBlendConstant accept sequence<double> colors. r=nical,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D168265
2023-01-31 16:14:13 +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
Jim Blandy
484ca146df Bug 1776816: Update wgpu to b370b990 (2022-6-28). r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D150447
2022-06-28 20:53:15 +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
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
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
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
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
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
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
Sylvestre Ledru
b4f9be25d4 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D105158
2021-02-15 08:49:20 +00:00
Alexander Meißner
8a39c1058f Bug 1691712 - WebGPU bindings for RenderPassEncoder rasterization state r=kvark,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D104591
2021-02-10 16:25:39 +00:00
Bogdan Tara
0eb980825a Backed out changeset 2badb161c9ca (bug 1691712) for wpt leakcheck failures CLOSED TREE 2021-02-11 00:02:25 +02:00
Alexander Meißner
0d9937175f Bug 1691712 - WebGPU bindings for RenderPassEncoder rasterization state r=kvark,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D104591
2021-02-10 16:25:39 +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