-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1752188: Move GPUBufferDescriptor validation to server. r=jgilbert
Depends on [`wgpu#2673`]. WebGPU requires `GPUBufferDescriptor` validation failure to: 1) generate an error on the Device timeline, and 2) mark the new buffer as invalid. Satisfy 1) by moving most validation to the compositor process. Requirement 2) is harder. `wgpu_core::Global::device_create_buffer` already takes care of some validation for us, and marks the provided buffer id invalid when there's a problem. However, there are certain errors the spec requires us to detect which `device_create_buffer` cannot even see, because they are caught by standard Rust validation steps in the process of creating the `wgpu_types::BufferDescriptor` that one would *pass to* that function. For example, if there are bogus bits set in the `usage` property, we can't even construct a Rust `BufferUsages` value from that to include in the `BufferDescriptor` that we must pass to `device_create_buffer`. This means that we need to do some validation ourselves, in the process of constructing that `BufferDescriptor`, and use the `Global::create_buffer_error` method added in [`wgpu#2673`] to mark the new buffer as invalid. [`wgpu#2673`]: gfx-rs/wgpu#2673 Differential Revision: https://phabricator.services.mozilla.com/D146768
- Loading branch information
Showing
9 changed files
with
52 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters