Dzmitry Malyshau
34b830da17
[spv-in] work around sign differences in OpIAdd and OpISubtract
2021-04-24 01:00:33 -04:00
Dzmitry Malyshau
64856a808e
[spv-in] refactor image coordinate extraction
2021-04-24 00:12:31 -04:00
Dzmitry Malyshau
b15a23c61f
[spv-in] fix integer constants parsing ( #756 )
2021-04-23 01:05:10 -04:00
Dzmitry Malyshau
f0cf6a6772
[spv-in] support OpModuleProcessed ( #753 )
2021-04-22 14:43:14 -04:00
Dzmitry Malyshau
bc344579e8
[spv-in] fix signed/unsigned casting for builtins ( #746 )
2021-04-21 11:04:53 -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
Dzmitry Malyshau
62c2cf7332
Validate composite constants ( #729 )
2021-04-18 23:19:09 -04:00
Dzmitry Malyshau
c8d26a1f47
Splat support for WGSL and SPV in/out, updated snapshots
2021-04-14 19:26:20 -04:00
Dzmitry Malyshau
2923cfb3aa
[spv-in] claim Vulkan Memory Model support
2021-04-13 01:31:57 -04:00
Matúš Talčík
44a6c02cda
spv-in: special-case a loop with true/false node == merge node
...
beautify
beautify #2
2021-04-09 17:17:02 -04:00
Dzmitry Malyshau
67e3e0a697
[spv-in] work around row-major matrices
2021-04-09 11:22:13 -04:00
Dzmitry Malyshau
0cc22c8c65
[spv-in] move the matrix decoration handling to structure parsing
2021-04-09 11:22:13 -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
LaughingMan
d0d9e09cdb
[spv-in] Copy less bytes in parse_function
...
The initial intention was to make the code a little more elegant and match on
the Vec itself instead of its length, however there's also a - probably
minuscule - performance advantage:
`Vec::remove` internally copies the removed element onto the stack. In this case
that's a `StructMember` weighting 48 bytes. The `Binding` we are actually
interested in is only 8 bytes tough.
Cloning just the `Binding` saves us from copying 40 bytes for nothing.
2021-04-08 13:10:56 -04:00
Dzmitry Malyshau
ead052b773
[spv-in] add a flag to adjust the coordinate space
2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
ab54f683be
[spv-in] flip Y axis
2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
427d8dc1eb
[spv-in] pre-emit constant expressions
2021-03-31 23:17:19 -04:00
Dzmitry Malyshau
057fa336a8
[spv-in] derivative ops
2021-03-29 11:07:33 -04:00
Dzmitry Malyshau
f06583ca7d
[spv-in] change const indexes to signed int
2021-03-29 11:07:33 -04:00
Dzmitry Malyshau
e47ff2dc26
[spv-in] support output interface block
2021-03-27 10:52:00 -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
4fb4133298
[spv-in] fix image array index type to be signed
2021-03-25 09:21:58 -04:00
Dzmitry Malyshau
26f629ccb4
[spv-in] fix image operand iteration, add support for constant offsets
2021-03-25 09:21:58 -04:00
Dzmitry Malyshau
c8bac4b618
[spv-in] convert the shift to unsigned
2021-03-25 09:21:58 -04:00
Dzmitry Malyshau
d58f9bdfde
Merge sample mask in/out builtins
2021-03-18 21:57:48 -04:00
Dzmitry Malyshau
f18728ed92
Enable more SPIR-V capabilities in the frontend
2021-03-17 16:33:21 -04:00
Dzmitry Malyshau
a17ae022c6
Make analysis errors carry the function handle
2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
e3818bb236
[spv-in] fix treating OpPhi variables as pointers
2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
9846a85174
[spv-in] patch calls from the entry points
2021-03-16 22:08:06 -04:00
Dzmitry Malyshau
08eaad89db
Implement default layout in the IR and WGSL
2021-03-15 22:27:35 -04:00
Matúš Talčík
889e487b62
spv-in: fix classification of back edges
...
fix clippy
another fix
2021-03-15 11:09:53 -04:00
Dzmitry Malyshau
7d47a1b585
[spv-in] re-order the functions for the IR
2021-03-15 09:35:13 -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
9e5cc4c9e4
Prevent matching on a reference once and for all
2021-03-12 11:35:09 -05:00
Dzmitry Malyshau
e7c1415ca4
[spv-in] really consider variables as pointers
2021-03-09 10:10:10 -05:00
Dzmitry Malyshau
7c26320cce
[spv-in] defer function call patching to the end of the module
2021-03-09 10:10:10 -05:00
Dzmitry Malyshau
13d7a353e0
Switch entry points from map to a vec
2021-03-07 12:11:49 -05:00
Dzmitry Malyshau
e92b35725c
[spv-in] work around integer built-ins for compute
2021-03-06 23:11:14 -05:00
Dzmitry Malyshau
2045a4a7be
Use BOOL_WIDTH everywhere
2021-03-06 11:01:14 -05:00
Dzmitry Malyshau
89e37d6e90
Explicitly emit expressions by Statement::Emit
2021-03-02 21:50:06 -05:00
Dzmitry Malyshau
69bf7f5f17
Miscellaneous fixes
2021-03-01 09:35:29 -05:00
Matúš Talčík
34c549d49d
spv-in flow: fix loop
2021-03-01 09:27:44 -05:00
Matúš Talčík
53f7f9de92
spv-in: fix if branches in CFG
...
format
2021-02-26 09:18:10 -05:00
Dzmitry Malyshau
7c2f4eac2e
[spv] fix unsigned selector and bitcast
2021-02-26 09:17:32 -05:00
Dzmitry Malyshau
cb45cd9011
[spv-in] dump the flow graph before it's serialized
2021-02-25 10:05:21 -05:00