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
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
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
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
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
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
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
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
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
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
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
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
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
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