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
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
This reverts commit 22fb6f2691.
Revert "Bug 1975714 - Update backlog expectations. r=webgpu-reviewers,nical"
This reverts commit 72b4644a09.
Revert "Bug 1975714 - Use `MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `reportCompilationMessagesToConsole`. r=webgpu-reviewers,ErichDonGubler"
This reverts commit 4394625f93.
Revert "Bug 1975714 - Assert that the IDs in server messages are the same as the ones the `WebGPUChild` actor expects. r=webgpu-reviewers,nical"
This reverts commit 5ce8cf9b12.
Revert "Bug 1978369 - Stop leaking queues. r=webgpu-reviewers,nical"
This reverts commit 32ab875eab.
Revert "Bug 1975714 - Move remaining ID creation/destruction into resource creation/destruction functions. r=webgpu-reviewers,nical"
This reverts commit 122e1a6529.
Revert "Bug 1975714 - Replace uses of `make_slice` with `FfiSlice`. r=webgpu-reviewers,ErichDonGubler"
This reverts commit 62add844bf.
Revert "Bug 1975714 - Use `FfiSlice` in remaining places. r=webgpu-reviewers,ErichDonGubler"
This reverts commit 3812af72dd.
Revert "Bug 1975714 - Use an opaque pointer for `WebGPUParent`. r=webgpu-reviewers,ErichDonGubler"
This reverts commit bf83ea6553.
Revert "Bug 1975714 - Remove unneeded `#[allow(dead_code)]`. r=webgpu-reviewers,ErichDonGubler"
This reverts commit a84b40d4b8.
Revert "Bug 1977861 - Stop leaking BGLs returned by GPUPipelineBase.getBindGroupLayout(). r=webgpu-reviewers,ErichDonGubler"
This reverts commit b5ec027bf9.
Revert "Bug 1975714 - Turn function pointers into extern fns. r=webgpu-reviewers,nical"
This reverts commit d3681b7012.
Revert "Bug 1975714 - Make sure to resolve/reject all pending promises in `ClearActorState`. r=webgpu-reviewers,nical"
This reverts commit 2f607174ce.
Revert "Bug 1975714 - Do not immediately resolve the lost promise on `device.destroy()`. r=webgpu-reviewers,nical"
This reverts commit 1c10e1f698.
Revert "Bug 1960399 - Reject async pipeline creation with `GPUPipelineError`. r=webgpu-reviewers,nical"
This reverts commit ee47165e63.
Revert "Bug 1975714 - Correct comments. r=webgpu-reviewers,nical"
This reverts commit 9e0aabda0e.
This migration was non-trivial!
On the WebGPU side, a change in how load and store operations in render
attachments were represented meant that we needed to re-work FFI for
`RenderPassDepthStencilAttachment` and `RenderPassColorAttachment`, with
most of the effort going towards the former. These types, along with
`Option`, needed FFI-friendly replacements for `Option` and the related
types in `wgpu-core`.
There was also some housekeeping done to avoid duplicate dependencies:
* Create `thiserror` shim that downgrades v2 → v1. Otherwise, v2 would
be brought in by the new WGPU. We can't go in the opposite direction
yet, because `bitsclient` has code that breaks on upgrade. The next
patch in this series addresses this, and reverses the direction of the
shim.
* Also remove the now-unused shim adapting from `cfg_aliases` 0.1 to
0.2.
Co-Authored-By: Jim Blandy <[email protected]>
Differential Revision: https://phabricator.services.mozilla.com/D233192
This migration was non-trivial!
On the WebGPU side, a change in how load and store operations in render
attachments were represented meant that we needed to re-work FFI for
`RenderPassDepthStencilAttachment` and `RenderPassColorAttachment`, with
most of the effort going towards the former. These types, along with
`Option`, needed FFI-friendly replacements for `Option` and the related
types in `wgpu-core`.
There was also some housekeeping done to avoid duplicate dependencies:
* Create `thiserror` shim that downgrades v2 → v1. Otherwise, v2 would
be brought in by the new WGPU. We can't go in the opposite direction
yet, because `bitsclient` has code that breaks on upgrade. The next
patch in this series addresses this, and reverses the direction of the
shim.
* Also remove the now-unused shim adapting from `cfg_aliases` 0.1 to
0.2.
Differential Revision: https://phabricator.services.mozilla.com/D233192
Cleanup() should not call End(), because doing so exposes us to timing
dependencies on the cycle collection. Specifically, as noted in the
patches for Bug 1907457, cycle collection of encoders and their
resources could result in the resource getting destructed before the
encoder. Bug 1907457 "fixed" that by allowing cycles. This patch instead
fixes it by changing encoder Cleanup() to just tidy up resources and not
attempt to complete the work of the encoder by passing it to wgpu.
This also removes mUsedTextureViews from the RenderBundleEncoder, as it
is unused. RenderBundleEncoders have no reliance on TextureViews.
Differential Revision: https://phabricator.services.mozilla.com/D226200
The encoder classes already have strong references to the resources they
rely upon. That is enough to prevent those resources from being
released before the encoder. That's all we need! Including the resources
in cycle checking is just making it possible for the resource and the
encoder to be unlinked in the same cycle, in arbitrary order. That's
dangerous because it's the same outcome as if the encoder didn't have a
strong reference to the resource at all.
Differential Revision: https://phabricator.services.mozilla.com/D225914
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
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