* Some stuff worked on
* Works on MSL
* Ready for test 2
* Fix for a thing lol
* Fixed 2 errors
* Fixed DXC
* Add changelog
* Updated CI to hopefully pass on macOS
* Various fixes
* Some final fixes
* CHanged CI
* Update naga/src/front/wgsl/parse/directive/enable_extension.rs
Co-authored-by: atlv <email@atlasdostal.com>
* Thing
---------
Co-authored-by: atlv <email@atlasdostal.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
When accessing a buffer for writing, do not expose (or internally
create) any `&'a mut [u8]` references to that memory, so as to avoid
exposing write-combining memory that might visibly misbehave in atomic
operations. Instead, expose the new pointer type `WriteOnly<'a, [u8]>`
which offers only write operations. This can be sliced and reborrowed,
allowing it to be used in most ways which `&mut [u8]` would be,
hopefully with near-zero overhead.
This pointer type might also allow users to opt in to uninitialized
memory for performance, while confining the consequences to GPU UB
rather than Rust UB. However, that is a future possibility and is not
implemented in this commit other than as a consideration in defining the
API of the `WriteOnly` type.
This change is not a complete solution to the problem of write-combining
memory because it is still possible to read after writing by calling
`get_mapped_range()` after `get_mapped_range_mut()`. However, that is
solvable separately, perhaps with a barrier or a validation change,
and is not particularly coupled with this part of the solution.
* [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.