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
* glsl-in: Remove unneeded mutability from reference
* glsl-in: Fix composite constructors
In the recent rework of the constructors it seems that the logic for
composite types (arrays and structs) was accidentally removed by me.
* Add FindLsb / FindMsb
* Fixes and tests for FindLsb/FindMsb
* Add findLsb / findMsb as WGSL builtins
* Fix tests
* Fix incompatible type issue with MSL output
* Requested changes
* Test fewer cases of findLsb/findMsb
The IR doesn't allow having structs has bindings for entry point
input/output, so the glsl frontend must flatten them.
Glsl defines that the locations are sequential from the block base location.
The GLSL empty-global-name.frag test doesn't suffice because the GLSL front end
doesn't produce the same IR as the SPIR-V included in the bug report. As far as
I know, only a genuine SPIR-V input test can produce a global whose name is
`Some("")`.
Include the SPIR-V assembly source.
Automatically spills to a local variable function call arguments to
parameters expecting a pointer where the argument storage class isn't
function since the storage classes wouldn't match.
Add support for float, vector and matrices targets.
Fix prefix and postfix being inverted (one was returning the value
of the other).
Remove an unneeded local indirection for prefix handling.
Add tests.
Regression from ce676cf130.
We need to output (*d).mx rather than *d.mx, at least according to Tint.
wgsl-in seems to handle *d.mx just fine, which is likely a separate bug.
The new api allows for reuse while keeping some allocations and to
please the borrow checker in future work, it also splits the parser into
logical modules to make it easier to work on.