* Removed half of the clones
Fixed struct field names with invalid ident
* Fix struct member origin not being respected
* is_valid_ident handles empty names
897: Improve diagnostics of incompatible attachments r=kvark a=scoopr
**Description**
Attempt to improve the diagnostics of incompatible attachments
Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
* The conditional at the start of resize() already tests for and exits on the zero width and height condition.
The conditional removed here was then getting run on every other call to resize(), which doesn't seem logical, doesn't correspond to the comment, and seemed to be causing at least one issue with rendered viewport going black during resize.
Fixes#532
(probably) Fixes#519
* Defensive coding to prevent various issues when window size goes to zero, e.g. NaN being passed in cgmath::perspective() aspect ratio parameter.
Fixes#531
895: Improve validation in B2B copies and RenderCommands r=kvark a=kunalmohan
**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_
**Description**
_Describe what problem this is solving, and how it's solved._
Validation for the following have been added-
- Validate all parameters in B2B copy even if `copy_size == 0`.
- Check for copy operations issued within same buffer.
- `RenderPass.setViewport()`
- `RenderPass.setScissorRect()`
**Testing**
_Explain how this change is tested._
Tested with CTS in Servo. More tests pass now. Will test on wgpu-rs now.
<!--
Non-trivial functional changes would need to be tested through:
- [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
- [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.
Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
893: Improve texture creation validation r=cwfitzgerald a=kvark
**Connections**
Fixes https://github.com/gfx-rs/wgpu-rs/issues/528#issuecomment-678853886
**Description**
Improves the mipmap levels check.
Note that it also removes the `TooManyLayers` error, and instead produces max `u16` value. This is to be followed up with a check for *real* limits, which has to happen regardless, and trying to catch it on the number conversion step seems wasteful.
**Testing**
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
format
major refactor
Change spirv to spirv_headers
Remove files
First translation to naga + format
Fix Int Constant error
Don't add unnecessary blocks.
Some cleanups
format
remove constructs
docs
fix debug leftovers
format, clippy
satisfy clippy
891: Add AddressMode::ClampToBorder behind a feature r=kvark a=jshrake
**Connections**
Closes#890
Linked to https://github.com/gfx-rs/wgpu-rs/pull/526
**Description**
- Adds support for border sampler addressing behind a new feature Features::ADDRESS_MODE_CLAMP_TO_BORDER.
- Adds a new enum SamplerBorderColor so that users can optionally specify a supported border color on the SamplerDescriptor.
**Testing**
Tested against the Metal (MacOS 10.15) and Vulkan (Ubuntu 18.04) backends.
Ran the wgpu-rs/cube example and switched the address modes to AddressMode::ClampToBorder, without enabling the feature, and confirmed I received an error message. Ran the same example with the new feature specified in the optional_features return and confirmed that the example ran and looks reasonable.
Co-authored-by: Justin Shrake <justinshrake@gmail.com>
* Initial glsl es 300 support
* Set float default precision
* Generate interface blocks and check storage class in es
* Added more checks on es and fixed uniform blocks with same name type
* Added image checks
* Added the test to the makefile
* applied comments
523: Change buffer binding to not take a slice r=cwfitzgerald,grovesNL a=kvark
This has been a constant source of confusion w.r.t dynamic offsets.
What it looks like it's doing: user provides a slice of buffer visible to the shader. Just like they provide slices to vertex and index buffer bindings.
What it's actually doing: it takes the offset and size separately, modifying the offset later on based on the dynamic offset.
We don't need this confusion. Semantics is different from `BufferSlice` and so we should have a different API here.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
889: Fix swapchain preferred format r=kvark a=kvark
**Connections**
**Description**
The old API was wrong because the idea is to query the format *before* creating a swapchain, not after it:)
**Testing**
nah, should just work
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
* Add function calling support to wgsl frontend
* Fix external namespace with multiple namespaces
* changes after code review
* Don't re-tokenize std_namespace every time
* Add interpolation support to naga core and wgsl
* Add glsl-new fragment shader support to examples/convert.rs
* Add interpolation support to glsl_new
* Add interpolation support to spirv frontend
* Add interpolation support to spirv backend
* Add interpolation support to glsl backend
* Add interpolation support to old glsl backend
* Fix interpolation field syntax in glsl backend
* Formatting fix
* thanks clippy
* Add wgsl struct interpolation decoration
* Change wgsl interpolation syntax
* Modify interpolation enum
* Changes responding to review
* Remove interpolation struct member qualifier
* code changes after review