1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU
**Connections**
Fixes#1520 .
**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.
**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.
Co-authored-by: Alex S <alex0player@gmail.com>
- rename ShaderInput variants
- rename feature flag
- hard error on Metal backend trying to compile SPIR-V
- fix test failing because of feature flag bits changing
* Add command buffer fill buffer method
* Added test for buffer fill
* Added image clear + test
* image/buffer clear methods are now pure clear to zero
* fix cargo clippy & int type issues
* clear buffer alignment is now given by COPY_BUFFER_ALIGNMENT
* joined buffer/image clear player tests
* ImageSubresourceRange is now used in TextureViewDescriptor
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment`
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment`
- Rename `attachment` fields on both attachments to `view`
* chore: validate offset + size in get_mapped_range
This commit introduces out of bounds & offset validation for
buffer_get_mapped_range, like described in the WebGPU spec. See
https://gpuweb.github.io/gpuweb/#dom-gpubuffer-getmappedrange.
Closes#818
* review comments
* fmt
* fix test
* fix tests
* update error message
* review comment
* use wgt::BufferAddress
* clippy
The purpose of the PR is to support Naga modules everywhere.
As a requirement, it updates the gfx-rs version used.
Most of the logic is dedicated towards building a shader interface,
where previously we just used naga's IR. Now we have our own mini-IR.
* Replace &[T] in descriptor structs with Cow<[T]>
* Changed label fields to use Cow<'a, str>
* Deduplicate types across the tracing API
Introduce the ToStatic trait
* Deduplicate trace::RenderBundleDescriptor
* Remove ugly ToOwned bounds
* Simplifiy Action variants
* Make Clone bounds on type defs less verbose
* Fix a error in play.rs
* Remove ToStatic, and Make Action<'a> borrow descriptors instead