Gordon-F
c37ae5e2a0
[glsl-out] Use fmt::Writer instead of io::Writer
2021-04-20 09:09:35 -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
Dzmitry Malyshau
daf4c82376
Allow stepping on floats in the validator ( #724 )
2021-04-16 16:16:15 -04:00
Jim Blandy
2eb3e81e19
[wgsl-in] Add basic test for interpolate attribute.
2021-04-15 17:19:20 -04:00
Jim Blandy
7fda34c4fd
[glsl-out] Add version checks for qualifiers.
...
Use `back::glsl::features::FeaturesManager` to detect which qualifiers the given
module actually uses, and check them against the requested GLSL version.
The `linear` and `sample` qualifiers for fragment shader inputs are not
supported in all versions of GLSL that Naga can generate.
2021-04-15 17:19:20 -04:00
Dzmitry Malyshau
96f9cb4ce1
[wgsl] Add support for simplified vector construction, add a snapshot test
2021-04-14 19:26:20 -04:00
Dzmitry Malyshau
d3b39d9e58
Splat expression in the IR
2021-04-14 19:26: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
Gordon-F
80a8243953
Fix Uint/Sint type conversion
2021-03-30 18:13:57 -04:00
Gordon-F
ee43776c08
[glsl-out] Add samplers to reflection info
2021-03-23 22:14:22 -04:00
Dzmitry Malyshau
6086f13bf0
Move the growable typifier into frontend helpers
2021-03-22 15:17:00 -04:00
Dzmitry Malyshau
d4bc463d50
Stop using the old Typifier in the backends
2021-03-22 15:17:00 -04:00
Dzmitry Malyshau
c992e638fe
Move all the validation into a separate meta-module
2021-03-20 22:25:49 -04:00
Dzmitry Malyshau
d58f9bdfde
Merge sample mask in/out builtins
2021-03-18 21:57:48 -04:00
Dzmitry Malyshau
9390aa472d
[glsl-out] make varying names to match
2021-03-17 10:37:10 -04:00
Gordon-F
6736bcefa6
[glsl-out] Explicitly set location bindings
2021-03-17 09:40:06 -04:00
Dzmitry Malyshau
32a11752af
Rename FragCoord builtin into Position
2021-03-13 23:26:19 -05:00
Dzmitry Malyshau
ebcd815250
Update IR to have entry points with inputs/outputs
2021-03-13 23:26:19 -05:00
Dzmitry Malyshau
58a4e330dc
[glsl-out] fix cached expressions
2021-03-13 11:52:23 -05:00
Dzmitry Malyshau
9e5cc4c9e4
Prevent matching on a reference once and for all
2021-03-12 11:35:09 -05:00
Gordon-F
74d1fdbf2a
[glsl-out] Return reflection info to users
2021-03-10 17:10:58 -05:00
Igor Shaposhnik
25fe522423
[glsl-out] Properly write array type
2021-03-10 15:17:07 -05:00
Igor Shaposhnik
f586d3e240
[glsl-out] Workaround lod array shadow as textureGrad
2021-03-09 15:08:08 -05:00
Dzmitry Malyshau
13d7a353e0
Switch entry points from map to a vec
2021-03-07 12:11:49 -05:00
Dzmitry Malyshau
dd823a4b84
Enforce pointer semantics at the type level.
2021-03-06 11:01:14 -05:00
Igor Shaposhnik
7bc7288828
[glsl-out] Properly write structure type in statement
2021-03-05 23:10:16 -05:00
Igor Shaposhnik
d1c47d1705
[glsl-out] Set precision for image type
2021-03-05 23:10:16 -05:00
Igor Shaposhnik
50e5904add
[glsl-out] Fix statement indentation
2021-03-04 10:03:39 -05:00
Dzmitry Malyshau
89e37d6e90
Explicitly emit expressions by Statement::Emit
2021-03-02 21:50:06 -05:00
Igor Shaposhnik
230ec601ed
[glsl-out] Fix array writing
2021-03-02 21:48:23 -05:00
Igor Shaposhnik
6e37f336bd
[glsl-out] Set workgroup_size for compute shaders
2021-03-02 14:26:01 -05:00
Igor Shaposhnik
04b1f44396
[glsl-out] Fix atan2 math function
2021-03-01 10:42:09 -05:00
Dzmitry Malyshau
afbcf05006
Move the convert from an example to a binary target
2021-02-25 10:05:21 -05:00
Dzmitry Malyshau
0cefc1c46c
Remove mutation from the Call expression
2021-02-22 23:37:26 -05:00
Dzmitry Malyshau
26e6c2bdac
Use source attribute of errors
2021-02-19 22:10:25 -05:00
Dzmitry Malyshau
0e3f745fb2
[msl] derive thiserror
2021-02-19 16:56:45 -05:00
Dzmitry Malyshau
db0a8875d9
TypifyError with the expression handle
2021-02-19 16:56:45 -05:00
João Capucho
19e7f456c4
Remove the call graph processor
...
Uses the GlobalUse in glsl-out to check for function availability
2021-02-18 11:43:18 -05:00
Dzmitry Malyshau
8a0382a89d
Move global use flags into FunctionInfo
2021-02-17 15:37:37 -05:00
Dzmitry Malyshau
6d0c608626
[glsl-out] use existing Analysis instead of implementing Visitor
2021-02-15 11:13:11 -05:00
Joshua Groves
f42dc0c377
Fix some typos
2021-02-14 22:50:12 -05:00
Systemcluster
7a124550d4
[glsl-in] support inverse function
2021-02-14 12:34:26 -05:00
Dzmitry Malyshau
18853ab149
Add warnings for trivial casts and clean them up in the code
2021-02-14 11:55:35 -05:00
Dzmitry Malyshau
de5bd77279
ImageStore statement in IR
2021-02-14 11:55:35 -05:00
Dzmitry Malyshau
c1fc5d6424
[msl] re-use expression results based on the analysis
2021-02-14 01:19:15 -05:00
João Capucho
e0005211a3
Fix the way equality is handled in glsl
2021-02-06 16:04:24 -05:00
Dzmitry Malyshau
d949d58f7b
Statement for void function call
2021-02-06 10:42:54 -05:00
João Capucho
ae72fb0933
Add support for component wise comparison to glsl
2021-02-06 00:41:00 -05:00