Commit Graph
81 Commits
Author SHA1 Message Date
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Andy Leiserson b116309293 Bug 1963926 - WebGPU: Associate external memory with each command buffer r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D284325
2026-02-24 20:35:32 +00:00
Teodor Tanasoaia 03a627fbce Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-27 11:22:00 +00:00
agoloman db150f25f2 Revert (Bug 1981187, Bug 1981225) - for causing build bustages RenderBundle.cpp.
This reverts commit cb3f1a84bb.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 793a7e81db.
2025-08-26 14:12:22 +00:00
Teodor Tanasoaia 793a7e81db Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 13:23:27 +00:00
agoloman 167b30ae21 Revert (Bug 1981187, Bug 1981225)- for causing build bustages @RefPtr.h.
This reverts commit 5fb5283ac4.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 2d0cd2975f.
2025-08-26 11:18:12 +00:00
Teodor Tanasoaia 2d0cd2975f Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 10:07:28 +00:00
Jamie Nicol fb77729315 Bug 1979108 - Implement ExternalTexture expiration. r=webgpu-reviewers,media-playback-reviewers,teoxoy,alwu
ExternalTextures imported from HTMLVideoElements get "expired" in the
"automatic expiry task source", which is implemented by scheduling a
stable state task. ExternalTextures imported from VideoFrames get
expired when the VideoFrame is closed.

Keep track of each external texture used by any used bind group when
encoding compute and render passes. When submitting, if any passes
contain expired external textures then raise a validation error.

Currently we always create a new ExternalTexture when
importExternalTexture() is called. When support for reusing previously
imported textures is added, we must ensure they are correctly
"unexpired".

Differential Revision: https://phabricator.services.mozilla.com/D260295
2025-08-12 08:49:36 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Andy Leiserson b8dc666d50 Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D255033
2025-07-02 23:32:43 +00:00
Serban Stanca 5fa41eb1d3 Revert "Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical" for causing reftests failures.
This reverts commit f1ebe8385b.
2025-06-27 23:13:30 +00:00
Andy Leiserson f1ebe8385b Bug 1972921 - Track canvas textures used in bind groups r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D255033
2025-06-27 18:32:44 +00:00
Andy Leiserson 97cbee47b1 Bug 1848857 - Track command encoder state and raise some relevant errors r=webgpu-reviewers,ErichDonGubler,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D253591
2025-06-15 00:24:45 +00:00
pstanciu 76e1a396a1 Revert "Bug 1848857 - Track command encoder state and raise some relevant errors r=webgpu-reviewers,ErichDonGubler,teoxoy" for causing non-unified build bustages @ComputePassEncoder.cpp
This reverts commit 8ccb49a491.
2025-06-13 19:37:20 +00:00
Andy Leiserson 8ccb49a491 Bug 1848857 - Track command encoder state and raise some relevant errors r=webgpu-reviewers,ErichDonGubler,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D253591
2025-06-13 18:56:38 +00:00
Andy Leiserson 25dc093f14 Bug 1969027 - Update wgpu to upstream f34dfd9 (2025-05-28) r=webgpu-reviewers,supply-chain-reviewers,webidl,smaug,ErichDonGubler
Includes fix for bug 1959728, add `GPUQueue.copyBufferToBuffer`
overload with optional size and no offsets.

Differential Revision: https://phabricator.services.mozilla.com/D251629
2025-05-29 18:34:03 +00:00
teoxoyandErich Gubler 9111bf40ea Bug 1933492 - Update wgpu to revision 66d51b6059127b81c7385ec3f2d49c3e81f76f0e. r=webgpu-reviewers,supply-chain-reviewers,nical
Co-authored-by: Erich Gubler <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D230946
2024-12-05 11:39:10 +00:00
Goloman Adrian d2a39124c7 Backed out changeset 9b662ae8100d (bug 1933492) for causing build bustages. CLOSED TREE 2024-12-04 13:09:07 +02:00
teoxoyandErich Gubler 5698dd07fe Bug 1933492 - Update wgpu to revision 66d51b6059127b81c7385ec3f2d49c3e81f76f0e. r=webgpu-reviewers,supply-chain-reviewers,nical
Co-authored-by: Erich Gubler <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D230946
2024-12-04 10:16:19 +00:00
Erich Gubler d8054006cd Bug 1933328 - refactor(webgpu): handle 2024-08 image copy renames from upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio
Driven by [gpuweb#4838](https://github.com/gpuweb/gpuweb/pull/4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
2024-11-27 13:02:13 +00:00
Goloman Adrian 3516520f47 Backed out changeset 08a24ec85517 (bug 1933328) for causing build bustages @ WebGpu. CLOSED TREE 2024-11-27 07:53:52 +02:00
Erich Gubler ff1f5d5729 Bug 1933328 - refactor(webgpu): handle 2024-08 image copy renames from upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio
Driven by [gpuweb#4838](https://github.com/gpuweb/gpuweb/pull/4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
2024-11-27 05:14:14 +00:00
Erich Gubler 4a4147af65 Bug 1838729, part 2 - feat(webgpu): add timestamp queries r=webgpu-reviewers,webidl,nical,saschanaz
Expected outcomes from CTS have been adjusted in part 4: D227734

Differential Revision: https://phabricator.services.mozilla.com/D223788
2024-11-06 06:31:13 +00:00
Erich Gubler 16daa04f78 Bug 1838729, part 1 - feat(webgpu): add GPUQuerySet APIs r=webgpu-reviewers,webidl,nical,saschanaz
Expected outcomes from CTS have been adjusted in part 4: D227734

Differential Revision: https://phabricator.services.mozilla.com/D223787
2024-11-06 06:31:13 +00:00
Erich Gubler 389f35dcff 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 5719e0f8a7 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 10f2d9133a 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 8fe46ddc7b 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 04383665ae 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 00db3ed84a 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 29b0e724c2 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 4848bd032d 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 9d1e33142f 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 0330f8afca 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 0c04fa2979 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 31fddc8c70 Backed out changeset 774b13e9f1e7 (bug 1865830) for causing mass build bustages. CLOSED TREE 2023-12-05 01:27:27 +02:00
Nicolas Silva e893ae9058 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 477b5fb8b0 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 5ea22ebe90 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 3861222f6b 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 7ecd49983c 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 a551810dd5 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 fe1efa4750 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 a0e23ca8ad 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 ef5ad5c074 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 e38c48df42 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 7a603e365e 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 03ac646a6e 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 1ace379439 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 23adf21311 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