Remove unnecessary explicit `mfbt::RefPtr` construction from
initializer lists in `dom/webgpu` code. Use `std::move` where
appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D281895
This adds validation for both having _no_ type specified, and having
more than one specified. This should actually satisfy the spec. calling
for it ([ref](https://www.w3.org/TR/webgpu/#dom-gpudevice-createbindgrouplayout)):
> Device timeline initialization steps:
>
> 1. If any of the following conditions are unsatisfied generate a validation error, invalidate layout and return.
>
> …
>
> - For each GPUBindGroupLayoutEntry entry in descriptor.entries:
>
> - Exactly one of entry.buffer, entry.sampler, entry.texture, entry.storageTexture, and entry.externalTexture is provided.
>
> …
Differential Revision: https://phabricator.services.mozilla.com/D275013
- Update wgpu crates to trunk commit 3f02781b. This is wgpu 28.0.0.
- Update CTS expectations. Many tests promoted from backlog!
- Adjust `wgpu_bindings::client::BindGroupEntry` to allow zero to be
passed as a buffer binding size. With wgpu#8734, wgpu_core
validation will catch this and report it properly,
- Pass `None` for the `telemetry` argument to `wgpu_core::global::Global::new`;
bug 1980057 will fill this in with a real telemetry struct.
- Adapt to new `DontCare` variant in `wgc::command::LoadOp`. Forbid
use of `DontCare` in the GPU process. In generated C++ bindings for
wgpu-types, substitute our own definition of `WGPULoadOpDontCare`,
since we don't use this and cbindgen can't create correct C++ for
zero-sized types.
- Include `subgroup_min_size` and `subgroup_max_size` in
`AdapterInformation` struct.
- Adapt to upstream terminology change: "push constants" are now
"immediate data". Delete unused function
`wgpu_render_bundle_set_push_constants`.
- Don't bother to lock the value of `wgpu_hal::metal::Device::raw_device`. As of
wgpu#8168, this function simply returns a `&metal::Device` directly.
- Delete our `VkImageHolder` type, and use `wgpu_hal::vulkan`'s
very nice `TextureMemory` enum instead.
- Include a delta audit for the wgpu crates from version 27.0.0 to 28.0.0, since
these entries are more valuable to people importing our `audits.toml` file
than entries for specific git commits.
- Update metal to 0.33.0.
- Update vendored ron to 0.12.0. Delta audit is already present in
`supply-chain/audits.toml`. Update webrender to use this as well.
- Vendor new ron dependency typeid 1.0.3. This is a very small crate.
Trust entry is already present in `supply-chain/audits.toml`.
- Delete dependencies `gpu-alloc` and `gpu-alloc-types` from `third_party/rust`.
These are no longer needed, since all `wgpu-hal` backends now use the
`gpu-allocator` crate.
- Update WebRender's local `Cargo.lock` to match the top-level's
`once_cell`, `ron`, and `typeid` entries.
Differential Revision: https://phabricator.services.mozilla.com/D275914
- Update wgpu crates to trunk commit 3f02781b. This is wgpu 28.0.0.
- Update CTS expectations. Many tests promoted from backlog!
- Adjust `wgpu_bindings::client::BindGroupEntry` to allow zero to be
passed as a buffer binding size. With wgpu#8734, wgpu_core
validation will catch this and report it properly,
- Pass `None` for the `telemetry` argument to `wgpu_core::global::Global::new`;
bug 1980057 will fill this in with a real telemetry struct.
- Adapt to new `DontCare` variant in `wgc::command::LoadOp`. Forbid
use of `DontCare` in the GPU process. In generated C++ bindings for
wgpu-types, substitute our own definition of `WGPULoadOpDontCare`,
since we don't use this and cbindgen can't create correct C++ for
zero-sized types.
- Include `subgroup_min_size` and `subgroup_max_size` in
`AdapterInformation` struct.
- Adapt to upstream terminology change: "push constants" are now
"immediate data". Delete unused function
`wgpu_render_bundle_set_push_constants`.
- Don't bother to lock the value of `wgpu_hal::metal::Device::raw_device`. As of
wgpu#8168, this function simply returns a `&metal::Device` directly.
- Delete our `VkImageHolder` type, and use `wgpu_hal::vulkan`'s
very nice `TextureMemory` enum instead.
- Include a delta audit for the wgpu crates from version 27.0.0 to 28.0.0, since
these entries are more valuable to people importing our `audits.toml` file
than entries for specific git commits.
- Update metal to 0.33.0.
- Update vendored ron to 0.12.0. Delta audit is already present in
`supply-chain/audits.toml`. Update webrender to use this as well.
- Vendor new ron dependency typeid 1.0.3. This is a very small crate.
Trust entry is already present in `supply-chain/audits.toml`.
- Delete dependencies `gpu-alloc` and `gpu-alloc-types` from `third_party/rust`.
These are no longer needed, since all `wgpu-hal` backends now use the
`gpu-allocator` crate.
Differential Revision: https://phabricator.services.mozilla.com/D275914
Filed bug 1995066 for regressions in WebGPU CTS on Windows in
webgpu:api,operation,command_buffer,image_copy:offsets_and_sizes
Differential Revision: https://phabricator.services.mozilla.com/D269106
Adds pref dom.webgpu.external-texture.enabled, which is false by
default, to control whether external texture support is enabled.
Additionally, adds a gfx blocklist entry which can override the pref to
disable on platforms with known issues. Block on non-Windows for now.
When support is disabled, either via the pref or blocklist, ensure the
Device.importExternalTexture() function is hidden. Add an additional
check to the C++ implementation as a precaution.
When support is enabled, enable the required wgpu feature.
Differential Revision: https://phabricator.services.mozilla.com/D260991
Adds pref dom.webgpu.external-texture.enabled, which is false by
default, to control whether external texture support is enabled.
Additionally, adds a gfx blocklist entry which can override the pref to
disable on platforms with known issues. Block on non-Windows for now.
When support is disabled, either via the pref or blocklist, ensure the
Device.importExternalTexture() function is hidden. Add an additional
check to the C++ implementation as a precaution.
When support is enabled, enable the required wgpu feature.
Differential Revision: https://phabricator.services.mozilla.com/D260991
Adds pref dom.webgpu.external-texture.enabled, which is false by
default, to control whether external texture support is enabled.
Additionally, adds a gfx blocklist entry which can override the pref to
disable on platforms with known issues. Block on non-Windows for now.
When support is disabled, either via the pref or blocklist, ensure the
Device.importExternalTexture() function is hidden. Add an additional
check to the C++ implementation as a precaution.
When support is enabled, enable the required wgpu feature.
Differential Revision: https://phabricator.services.mozilla.com/D260991
The WebGPU spec allows us to return a previously imported external
texture from `importExternalTexture()` when provided with the same
descriptor (ignoring the label), as long as the current image contents
of the source is the same. For applications that import a large number
of external textures from the same source, this can be a significant
performance improvement.
This implementation maintains a cache of imported external texture
sources, keyed by the "serial" of the layers::Image they were imported
from. Additionally, each source maintains a cache of external textures
that have been created from it. This is keyed by the contents of their
descriptor, ignoring the label (as per the spec) and the "source" (as
the cache is owned by the source) leaving just the color space.
Using these two separate levels of cache means that we not only create
a single single external texture for multiple imports with the same
descriptor, but when importing from the same source with an otherwise
different descriptor we are still able to share the underlying plane
textures.
Differential Revision: https://phabricator.services.mozilla.com/D260827
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
Update webidl definition to allow a GPUBindingResource to be a
GPUExternalTexture, and add necessary plumbing to pass the correct
value through to wgpu.
Note that for now we have not requested Features::EXTERNAL_TEXTURE when
creating the wgpu device, meaning that any attempts to actually create
a bind group containing an external texture will result in an error.
Differential Revision: https://phabricator.services.mozilla.com/D260294
First we create an ExternalTextureSource using the infrastructure added
in the previous patch, and from that we create an ExternalTexture.
In order to create the external texture the client side passes an
`ExternalTextureDescriptor` to the host side, which encodes the
source as a optional ID. On the host side additional information is
queried from the ExternalTextureSourceHost, which is combined with the
`ExternalTextureDescriptor` provided by the client in order to call
wgpu's create_external_texture().
If there was an error importing the source on the client side the
source ID will be `None`. If there was an error importing the source
on the host side, it will return an empty slice of texture views as its
planes. In either case this indicates we should propagate the error
state to the external texture.
Subsequent patches will allow for creating multiple external textures
from the same source, and returning previously imported external
textures rather than always creating a new one.
Note that for now we have not requested Features::EXTERNAL_TEXTURE when
creating the wgpu device, meaning that any attempts to actually create
an external texture will result in an error.
Differential Revision: https://phabricator.services.mozilla.com/D259820
First we create an ExternalTextureSource using the infrastructure added
in the previous patch, and from that we create an ExternalTexture.
In order to create the external texture the client side passes an
`ExternalTextureDescriptor` to the host side, which encodes the
source as a optional ID. On the host side additional information is
queried from the ExternalTextureSourceHost, which is combined with the
`ExternalTextureDescriptor` provided by the client in order to call
wgpu's create_external_texture().
If there was an error importing the source on the client side the
source ID will be `None`. If there was an error importing the source
on the host side, it will return an empty slice of texture views as its
planes. In either case this indicates we should propagate the error
state to the external texture.
Subsequent patches will allow for creating multiple external textures
from the same source, and returning previously imported external
textures rather than always creating a new one.
Note that for now we have not requested Features::EXTERNAL_TEXTURE when
creating the wgpu device, meaning that any attempts to actually create
an external texture will result in an error.
Differential Revision: https://phabricator.services.mozilla.com/D259820
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.