Commit Graph
997 Commits
Author SHA1 Message Date
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
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
Dzmitry Malyshau f3cab651bb [spv-out] support Switch statements 2021-02-12 10:17:27 -05:00
Dzmitry Malyshau 9b358efea1 [wgsl] support 'elseif' construct 2021-02-11 20:50:27 -05:00
Dzmitry Malyshau 86bb611905 [wgsl] support select() 2021-02-11 15:32:28 -05:00
Dzmitry Malyshau b3d80de9e1 [spv-out] fix the clippy warning about Result type 2021-02-11 11:24:06 -05:00
Dzmitry Malyshau 38f3c4eb19 [spv-in] support dynamic vector insert/extract 2021-02-11 10:58:52 -05:00
Dzmitry Malyshau 49eb93cf7d [spv-in] support boolean constants 2021-02-11 10:58:52 -05:00
Dzmitry Malyshau 2507794bc6 [spv-in] add more capabilities we support 2021-02-11 10:58:52 -05:00
Pelle Johnsen c04c971907 [glsl-in] Fix StorageClass for texture and sampler 2021-02-11 10:33:21 -05:00
Dzmitry Malyshau 20227e7c87 [msl] pass-through global resources in arguments 2021-02-10 23:22:14 -05:00
Dzmitry Malyshau dad02eb0a8 [msl-out] support all binary ops 2021-02-10 23:22:14 -05:00
Dzmitry Malyshau 3aa11838c7 Refactor the global usage code into a separate module, fix inheriting from the callees 2021-02-10 11:02:56 -05:00
Dzmitry Malyshau 4f19903f46 [wgsl] fix variable initializers wrt control flow 2021-02-09 00:47:41 -05:00
Dzmitry Malyshau 5b94ecd9b2 Add a snapshot for parsing spirv input 2021-02-08 15:59:47 -05:00
Dzmitry Malyshau cf0a86afd4 [spv-in] move all the image-related logic into a sub-module 2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 6b9d3eafc8 [spv-in] Rewrite the comparison image/sample handling.
Keep track of the comparison property per global variable instead of  type.
Only track images that can actually be comparison-sampled.
Instead of mutating the type, just add a new type in the end
if we detect it to be necessary, cloning the old name.
2021-02-08 15:59:47 -05:00
Dzmitry Malyshau 10867879d4 [spv-in] support projection sampling and sampling from arrays 2021-02-08 11:31:45 -05:00
Dzmitry Malyshau 680fda9e1b [spv-out] fix initial ID 0 and 1 assignments 2021-02-08 00:20:37 -05:00
Dzmitry Malyshau 76094aa553 [mtl] fix nested loop service variable 2021-02-08 00:13:12 -05:00
Dzmitry Malyshau 6f50ca6bee Push constant support 2021-02-07 11:54:56 -05:00
Dzmitry Malyshau 960aabec20 [spv-in] Implement OpCompositeInsert 2021-02-07 11:49:52 -05:00
Dzmitry Malyshau 75427cf95c [spv-in] handle matrix decorations 2021-02-07 11:44:47 -05:00
João Capucho 993521965d Add support for unary ops to glsl 2021-02-06 22:23:09 -05:00
João Capucho 708751a805 Add support for relational functions to glsl-in 2021-02-06 16:57:30 -05:00
João Capucho da8f9ecbb9 Add support for more math functions in glsl-in 2021-02-06 16:57:30 -05:00
João Capucho e0005211a3 Fix the way equality is handled in glsl 2021-02-06 16:04:24 -05:00
Dzmitry Malyshau 251f800825 Remove the typifier hack for void functions 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau d0c84a5ffa [spv-in] support for void function calls 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau 11a3ed9837 WGSL support for void function calls 2021-02-06 10:42:54 -05:00
Dzmitry Malyshau d949d58f7b Statement for void function call 2021-02-06 10:42:54 -05:00