Commit Graph
25 Commits
Author SHA1 Message Date
João Capucho 60d0bf850b Add support for multi view extensions 2021-09-19 17:38:27 -04:00
Dzmitry Malyshau 79d899fe4c Support num_workgroups builtin 2021-08-17 22:22:22 -04:00
Dzmitry Malyshau 8c371e8063 Atomic expressions, support in backends except HLSL and the validator. 2021-08-10 21:48:02 -04:00
pyrotechnickandDzmitry Malyshau 2f516c0932 [wgsl] Storage buffer/texture access (#1142)
* Resurrect texture_storage_* tests
* Test parsing of `var<storage,write>`
* Default storage textures to READ
* Restore default features
* Fix glsl/hlsl/msl/spv front and back ends
* Add missing test outputs
* All-around fixes for the storage access

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-28 01:47:18 -04:00
initial-algebra 602368d9f0 Support builtin(primitive_index) (#1097)
* Hack in support for PrimitiveID on Vulkan

* Rename to PrimitiveIndex and add preliminary support for GLSL, HLSL and MSL

* Implement as an extra WGSL built-in

* Update extra.wgsl outputs

* Run rustfmt; fix WGSL writer

* Add rustfmt changes I forgot

* Update extra.wgsl test output for WGSL fix

* Bump macOS version to 10.15 in validate-msl to support primitive_index
2021-07-16 22:18:20 -04:00
Igor Shaposhnik 54af830855 Fix nightly clippy suggestions 2021-06-09 10:17:20 -04:00
Jim Blandy 99fbb34bd6 Require dynamically sized arrays to appear in 'storage' memory.
WGSL requires that runtime-sized arrays appear only as the last member of a
structure in in the `storage` storage class. It seems to me that Naga should
enforce this restriction on its own IR as well.
2021-05-25 00:02:08 -04:00
Dzmitry Malyshau 652b65cfa9 Validate built-ins to not repeat 2021-05-21 23:22:05 -04:00
Jim Blandy 50de6ae9ac Improve error messages for missing I/O bindings.
The `apply_common_default_interpolation` helper function would panic if bindings
were missing, but missing bindings should be something that front ends can count
on validation to detect, so the helper should just return silently.

The validator returned `InvalidType` errors for missing bindings, apparently
because variables without bindings must be structs that do have bindings. But
this is unhelpful when you've just forgotten to label an argument. So this patch
adds a new, more specific, `VaryingError` variant.
2021-05-21 23:04:27 -04:00
Dzmitry Malyshau b191c982ec Remove alignment from struct IR 2021-05-17 09:32:52 -04:00
Dzmitry Malyshau 350ceb383d WGSL support for f64, snapshot test for it 2021-05-08 21:20:23 -04:00
Gordon-F 73b20ffa70 Add CullDistance BuiltIn 2021-05-08 09:51:14 -04:00
Dzmitry Malyshau 5d1746b0b4 Swizzle expression (#734) 2021-04-20 22:03:54 -04:00
Jim Blandy 4f442ff8cc Require binding interpolation to be resolved by the front end.
When validating IR, verify that all `Binding`s for vertex shader outputs and
fragment shader inputs, whether directly in the argument or result, or applied
to a struct member, has specified an interpolation and sampling, not `None`.
This ensures that front ends explicitly state their policies, rather than
coasting through on back ends' default behavior.

In practice, all our front ends have very similar defaults, so provide a utility
function on `Module` to apply these rules. Use this utility function in the
SPIR-V and WGSL front ends; GLSL seems to already fill in interpolation as
required.
2021-04-19 09:42:00 -04:00
Jim Blandy 0910af2718 [wgsl-in] Implement WGSL interpolate syntax from gpuweb PR #1605.
Fixes: #670
2021-04-19 09:42:00 -04:00
Jim Blandy 99a9e1e78e Change Binding::Location to a struct-style enum variant.
This commit makes no other changes. This is in preparation for adding a third
field, at which point tuple variants start to get obscure.
2021-04-19 09:42:00 -04:00
Jim Blandy 576723960e Permit interpolation qualifiers on both vertex outputs and fragment inputs. 2021-04-15 17:19:20 -04:00
Dzmitry Malyshau 604e10e19b Rewrite IR to have member offsets, full structure span and alignment 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau 7326ba6ddb New struct layout IR 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau 7d042337e2 Align the block decoration with SPIR-V, require storage buffers 2021-03-25 12:34:25 -04:00
Dzmitry Malyshau 06d777b609 Make layout validation optional, disable the struct size check 2021-03-24 21:03:00 -04:00
Dzmitry Malyshau 7a246f6a14 Validate image queries and valid shader stages for derivatives 2021-03-24 12:32:32 -04:00
Dzmitry Malyshau 1d3f2bbdb1 Merge FunctionAnalysisError into FunctionError 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau 1ddea0fdbb Validate layouts 2021-03-21 22:27:32 -04:00
Dzmitry Malyshau c992e638fe Move all the validation into a separate meta-module 2021-03-20 22:25:49 -04:00