* [wgpu-core] add support for optional BG & BGL entries
* [wgpu] allow gaps in bind group layouts
And allow unbinding in the web backend.
* adapt tests
* add changelog entry
* [wgpu] remove generic from `PipelineLayoutDescriptor`
* Make `depth_compare` and `depth_write_enabled` optional
These fields are optional in the WebGPU API. Having them optional in the
wgpu API as well keeps validation logic centralized in wgpu-core.
Fixes#8830
* Remove `DepthStencilStateIdl`
* Initial commit
* 3/5 done I think
* Updated naga bin to use new caps
* Made clippy shut up
* Tried to fix dota2 validation error
* HLSL list made, also formatted Cargo.toml
* Made stuff work with snapshots
* Added changelog and GLSL list
* Updated message
* Initial commit adding miscellaneous changes from msl-write and hlsl-write
* Same as previous commit
* Fixed divergence issue
* Removed some unnecessary barriers
* Zero init workgroup memory
* Added limits validation
* Added changelog
* Handled overflow, removed todo
* Lets see if this fixes llvmpipe
* Also this commit fixes llvmpipe maybe
* Unfortunate but not too unexpected at this point
* Updated feature to say to use ShaderRuntimeChecks::unchecked()
* Updated snapshots and took some changes from the hlsl writer
* Snapshots
* 2 quick tweaks
* Updated framework with suggestions by Connor in #8752
* Moved the task runtime limits into naga::back
* Fixed soem stuff
* Fixed checks: >= into >
* Cant believe I forgot this
* Removed code using u64 to check stuff
* Removed thing with limiting it to 2<<21
* Some more work
* Fixed compiles
* Added new field to spv options
* Updated some stuff to pass around the task runtime limits in more ways
* New PR started
* Did another quick fix
* Another quick fix
* Added changelog entry
* Added some explanation docs
* Fixed a warning
* Fixed shader
* Fixed some things & added docs
* Reverted dxc thing
* Fixed thing
* Refactored to TaskDispatchLimits
* Fixed compile error
Previously we required that the enable extension be declared and that
the capability be present if the functionality was used, but allowed the
extension to be declared if the functionality was not used.
New cases for some Clippy lints pop up as part of this upgrade that
cannot be done before, listed below. Yuck!
- `clippy::manual_is_multiple_of`
- `clippy::missing_const_for_fn`
- `clippy::useless_nonzero_new_unchecked`
Two-row matrices in uniform buffers in Vulkan/SPIR-V's default
"extended" (std140) layout do not adhere to WGSL/Naga IR's layout
rules - each column is aligned to a minimum of 16 bytes rather than
just the vector size.
To work around this, we emit additional std140 compatible type
declarations for each type used in a uniform buffer that requires
one. Any two-row matrix struct member is decomposed into the
containing struct as separate vectors for each column. Two-row
matrices used directly as uniform buffers are wrapped in a struct with
a vector member for each column, and arrays (of arrays, etc) of
two-row matrices are declared as arrays (of arrays) of structs
containing a vector member for each column.
When loading such a value from a uniform buffer, we convert from the
std140 compatible type to the regular type immediately after loading.
Accesses of a uniform two-row matrix's columns using constant indices
are rewritten to access the containing struct's vector members
directly. Accesses using dynamic indices are implemented by loading
and converting the matrix, extracting each column then `switch`ing on
the index to select the correct column.
We can now remove the expected failure annotation for the Vulkan
backend on the uniform_input struct_layout test, as it now passes.
This means that usage of a `StagingBelt` only requires passing along
the current `CommandEncoder` instead of both the encoder and the device.
It also makes the API reflect the fact that a `StagingBelt` cannot be
reused with a fresh device.
As far as I know, the only reason this was not done previously was that
`Device` was not clonable, and so doing this would have required an
`Arc<Device>` or other specific mechanism.
The plumbing to get it out of `wgpu_core` is awkward but I didn’t see
a clearly better option. I think it would make sense to have something
like `Global::get_label<T>(id: Id<T>) -> String` but that looks like a
lot more work.
* Add documentation that every `allocate()` or `write_buffer()`
operation must have a size that is a multiple of 4.
* Add assertions for those properties (this gives more helpful panics
than leaving it to validation).
* Add a randomized test to exercise usage of StagingBelt.
I was concerned that `StagingBelt` might have an alignment math bug;
having written this test, I am much less concerned. There was previously
no test for `StagingBelt` at all, if you don’t count examples/skybox.
* Removed unnecessary dependency in `wgpu` on `hashbrown`.
* Removed unused dependencies in `naga-test`.
* Moved some dependencies in `wgpu-test` to `[dev-dependencies]`
(see comment for why this is worth doing).
Candidates were discovered by `cargo clippy -- -Wunused-crate-dependencies`.
This command reports whether each dependency is unused in each *crate*,
so it has false positives when a dependency is used by only some crates
in a package, but it is still useful as a short-list.