Validation insures that `ImageLoad` expressions always have an `index`
operand when the image's type requires it, so there is no need for
`MipLevelCoordinate::Zero`. This means that
`Option<Handle<Expression>>` serves adequately for this case.
This one grew out of hand quick. Initially it was just replacing the bit
loops with a function driving the declarations to make the code sharing
better and support different scalar kinds.
Now it includes a lot of fixes:
- `textureSize` now also returns the array layers as the last component
on the return (only for arrayed textures)
- `textureSize` now supports multisampled textures
- the `texture` family of functions now consumes a `vec3` coordinate
vector for all 1D shadow textures
- Shadow textures can use the bias version of `texture` functions
(temporarily disabled since naga doesn't support it)
- 3D textures can be used in `textureProj`
- `sampler2DArrayShadow` can't be used in `textureLod` or in `texture` with bias
- Cube textures cannot be used with offsets
Updates the tests to cover all functions
The _buffer_sizes argument should be inserted regardless of whether or not `
`options.fake_missing_bindings` is set, so lift the computation of
`supports_array_length` out of that conditional.
The previous implementation had many issues, most importantly it didn't
allow to implement (at least in a sane way) some future features like
default qualifiers and format qualifiers.
This implementations centralizes the qualifiers into a struct with a
hashmap for layout qualifiers, error reporting is also centralized which
means that `add_global_var` and `add_local_var` no longer need to
duplicate effort and the ugly loop + match combo is gone.
Finally some minor fixes are also done as part of this rework, like
a default location being provided for input/outputs variables and layout
qualifiers being allowed to be repeated (overwriting the previous one)
like the spec defines.
Under certatin circumstances the parser would panic because of culling
using an index out of bound, for example take the following code:
```glsl
{
x = 1; // Index 0 on nested block
discard; // Index 1 on nested block
} // Index 0 on block
```
The parser seeing this would attempt to cull the block using the start
index of 1 which would be out of bound and panic. Now instead the nested
block properly does it's internal culling and the outer block culls
everything after the nested block only.
* Allow vecN<i32> and vecN<u32> in `dot()`, first changes
* Added a test case
* Fix the test
* Changes to baking of expressions, incl args of integer dot product
* Implemented requested changes for glsl backend
* Added support for integer dot product on MSL backend
* Removed outdated code for hlsl and wgls writers
* Implement in spv backend
* Commit modified outputs from running the tests
* cargo fmt
* Applied requested changes for both MSL and GLSL back
* Changes to spv back
* Committed all test output changes
* Cargo fmt
* Added a comment w.r.t. VK_KHR_shader_integer_dot_product
* Implemented requested svp change
* Minor change to test case
This is because I wanted to highlight the fact that the correct
id is used in the last sum of the integer dot product expression
* Changed function signature
since it could not fail, changed it to simply return `void`
* Rewrite front/back doc summaries
- Use line comments instead of block comments
- Standardize language for each front/backend
- Add reference link for each format
- Minor punctuation changes
* Add documentation for keywords module
* Clarify contents of keywords module in summary
* Refer to modules by their type name
* Add basic summary for valid module
* Adjust EarlyDepthTest and ConservativeDepth docs
* Remove "in" from list
* Adjust wording
* Standardize format of docstrings
* Adjust module links to be consistent with other links
* Add summary for reserved keywords list
* Remove extraneous doc spaces with `cargo fmt`
* Correct spelling of whether and rewrite some lines
* Fill out GLSL backend docs
* Remove unnecessary link targets
* Fill out DOT backend docs
* Change module line comments to block comments
* Remove unnecessary spaces
* Fix mistake during rebasing
* WGSL storage address space should always correspond to MSL device address space.
See MSL spec section 4.2.
* Update baselines
* Add error for storage address space if MSL version < 2.
* Update default MSL version to 2.0.
Rename `TypeLayoutError` to `LayoutErrorInner`, for consistency. It makes no
sense to have 'Type' in the name of one of the error types but not the other.
The 'Inner' convention is used by the module types.
Cite the layout rules in the WGSL spec, not a GitHub issue.