Commit Graph

522 Commits

Author SHA1 Message Date
Joshua Groves
ce84b1d1c0 [wgsl] Add parser error snapshot 2021-02-22 01:17:15 -05:00
Matúš Talčík
fa7d4d8b51 spv-in: fix if condition when merge node == false node
format
2021-02-20 10:41:54 -05:00
Dzmitry Malyshau
2a5c478b21 Fix type resolves of matrix by vectors 2021-02-20 00:02:28 -05:00
Dzmitry Malyshau
f03a99d6a3 Implement Debug for arena and handle 2021-02-19 23:20:11 -05:00
Dzmitry Malyshau
26e6c2bdac Use source attribute of errors 2021-02-19 22:10:25 -05:00
Dzmitry Malyshau
99c1add358 [msl] fake bindings 2021-02-19 19:20:21 -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
Systemcluster
9f113bdd95 [wgsl] limit allowed for statement initializer statements 2021-02-18 10:55:16 -05:00
Systemcluster
e49910bb0a [wgsl] allow empty for statement headers 2021-02-18 10:55:16 -05:00
Dzmitry Malyshau
5f21cf360f Refactor snapshot testing to include some IR 2021-02-18 10:19:25 -05:00
Dzmitry Malyshau
4c5a1ba054 Global usage tests in the analyzer 2021-02-17 16:22:19 -05:00
Dzmitry Malyshau
8a0382a89d Move global use flags into FunctionInfo 2021-02-17 15:37:37 -05:00
Pelle Johnsen
9f0cdfe9e5 [glsl-in] Multi entry, don't use find on hashmap 2021-02-17 10:05:40 -05:00
Pelle Johnsen
408002815f [glsl-in] Multi entry points - address comments 2021-02-17 10:05:40 -05:00
Pelle Johnsen
1861fca4ba [glsl-in] Support multiple entrypoints 2021-02-17 10:05:40 -05:00
Systemcluster
dea3e0e1e1 Add MIT license 2021-02-17 09:34:17 -05:00
Systemcluster
59479f137d [wgsl] support nested type parameters 2021-02-16 16:57:34 -05:00
Systemcluster
321420c019 Set default SPIR-V version in convert example 2021-02-16 10:25:02 -05:00
Dzmitry Malyshau
847d127ec8 Optimize Interface with a bitmask to avoid re-visiting expressions 2021-02-16 09:08:05 -05:00
Dzmitry Malyshau
e37268e60c [msl] fix support for private globals 2021-02-16 09:08:05 -05:00
Dzmitry Malyshau
35ba4dac66 Fix the ClipDistance validation - expect an array 2021-02-16 09:08:05 -05:00
Systemcluster
539db1a317 [wgsl] support for statement 2021-02-15 23:51:19 -05:00
Dzmitry Malyshau
e6251a23fe [wgsl] fix boolean types and bang parsing 2021-02-15 22:59:04 -05:00
Dzmitry Malyshau
91a1f581e0 Fix insta dependency to 1.5.2 2021-02-15 11:13:11 -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
Dzmitry Malyshau
ad423124c0 Support constants in the naming processor 2021-02-14 20:43:50 -05:00
Dzmitry Malyshau
61d711b58f Remove the Header from IR 2021-02-14 20:23:31 -05:00
Systemcluster
7a124550d4 [glsl-in] support inverse function 2021-02-14 12:34:26 -05:00
Systemcluster
b642c5b89b [spv-in] support string instruction 2021-02-14 11:57:26 -05:00
Systemcluster
dcd269782a [wgsl] restrict type casts to matching container types 2021-02-14 11:56:49 -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
8e96085caf [spv-in] support image load/store ops 2021-02-14 11:55:35 -05:00
Dzmitry Malyshau
de5bd77279 ImageStore statement in IR 2021-02-14 11:55:35 -05:00
Systemcluster
5de69f7276 Specify line endings in ron snapshot tests 2021-02-14 11:29:25 -05:00
Dzmitry Malyshau
08001981ba Add comments to Analysis methods and ControlFlags 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau
c1fc5d6424 [msl] re-use expression results based on the analysis 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau
eae40383d0 Add uniform control flow analysis to the validator 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau
bde43cbec6 First uniform control flow tests 2021-02-14 01:19:15 -05:00
Dzmitry Malyshau
747040ee8a Analyzer processor - first draft 2021-02-14 01:19:15 -05:00
Anthony Cowley
d0ef4e9dbe [spv-out] support select expressions 2021-02-13 22:56:43 -05:00
Dzmitry Malyshau
8183f4ff6f [spv-out] annotate function and constant names 2021-02-13 19:37:54 -05:00
Dzmitry Malyshau
94bd97c0fb [wgsl] early depth test attribute 2021-02-13 12:49:23 -05:00
Dzmitry Malyshau
de39e7f4d1 [spv-in] patch function calls before deriving the global use 2021-02-13 12:33:15 -05:00
Dzmitry Malyshau
89f62bc584 [spv-out] make instruction constructions to be methods 2021-02-13 12:33:04 -05:00
Joshua Groves
9667a18980 [wgsl] Avoid consuming token twice in some cases 2021-02-13 00:13:23 -05:00
Joshua Groves
9c2a837a53 [wgsl] track number of bytes consumed per token 2021-02-13 00:13:23 -05:00
Anthony Cowley
141d2e7661 [wgsl] ignore offset decorations on struct fields
naga does not require offset decorations on struct fields in WGSL
source, and automatically adds them to spv output. The `tint` compiler
does not automatically add them, and requires that they be present in
the WGSL source.

A potential confusion is that an spv binary missing required
`OpMemberDecorate` instructions that set the field's offset will fail
validation when run through `spirv-val`. But since naga automatically
produces these offsets, the same spv binary passed through naga will
be successfully validated.

This change is to ignore these decorations in naga's WGSL front end so
that the same WGSL source can be used with naga and tint to produce
valid spv.
2021-02-12 18:27:02 -05:00