Commit Graph

380 Commits

Author SHA1 Message Date
Dzmitry Malyshau
211bec44a1 Improve texture sampling IR, update WGSL parsing of it 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau
087b5555a6 Add tests for GLSL parsing 2020-12-13 00:41:23 -05:00
Dzmitry Malyshau
0efd6e75d7 [wgsl] update texture definitions and storage access
Add more tests, enhance the snapshot testing.
2020-12-12 12:46:24 -05:00
Dzmitry Malyshau
dafca34877 Add block boolean to the structure types in IR
Also update WGSL syntax for structures.
Move the boids code into snapshots.
2020-12-12 12:46:24 -05:00
Joshua Groves
d18b73c3a7 Remove duplicate wgsl from test-data 2020-12-10 19:07:08 -05:00
Timo de Kort
6a6e3c28f9 Update simple.wgsl to latest syntax 2020-12-10 23:38:59 +01:00
Dzmitry Malyshau
b7744a1ec5 [wgsl] function lookup, improve error reporting 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau
82c5cff605 [wgsl] refactor type declarations and function calls to avoid backups 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau
eeb479ae94 [wgsl] support const locals 2020-12-10 10:20:56 -05:00
Dzmitry Malyshau
edf5d857b1 Add workgroup id and size builtins 2020-12-10 09:38:56 -03:30
Joshua Groves
d71ebe2881 Add snapshots for function.wgsl 2020-12-10 00:24:07 -05:00
Joshua Groves
51cdb0403a Add snapshots for simple.wgsl 2020-12-10 00:24:07 -05:00
Joshua Groves
9a625a570e Add insta prototype 2020-12-10 00:24:07 -05:00
Dzmitry Malyshau
b35e901249 Add all standard library functions to the IR 2020-12-09 15:43:36 -05:00
Dzmitry Malyshau
66d994566c [spv] force treating the built-in scalar types as unsigned 2020-12-08 22:55:21 -05:00
Dzmitry Malyshau
6c1f4ac590 [wgsl] populate standard functions 2020-12-08 09:28:24 -05:00
Dzmitry Malyshau
5786aac9c4 [glsl] enable conversion testing for quad and boids 2020-12-08 09:25:59 -05:00
Dzmitry Malyshau
148fac0601 [spv] enable quad conversion test, refactor binary operations 2020-12-08 09:25:59 -05:00
Dzmitry Malyshau
548bafaf40 [spv] refactor local variables 2020-12-08 09:25:59 -05:00
Dzmitry Malyshau
31be5402bd [spv] refactor the capability checks 2020-12-08 09:25:59 -05:00
Dzmitry Malyshau
4f958bf658 [msl] refactor function call parsing 2020-12-06 23:30:52 -05:00
Dzmitry Malyshau
e0c2178b3f [spv] write down workgroup size 2020-12-06 23:24:06 -05:00
Dzmitry Malyshau
b597bc5af6 [wgsl] add min/max support 2020-12-06 11:54:19 -05:00
Dzmitry Malyshau
ef4e8cacf9 [spv] refactor binary operators, add module and addition 2020-12-06 17:43:15 +01:00
Dzmitry Malyshau
5b14e26659 [wgsl] add a test module with units for if/loop/switch statements 2020-12-05 11:29:36 -05:00
Dzmitry Malyshau
f7ca7f2aff Refactor Switch statement, implement on WGSL 2020-12-05 00:22:39 -05:00
Dzmitry Malyshau
5fe9429a63 Terminator processor, used in WGSL and GLSL frontends 2020-12-04 17:23:13 -05:00
Dzmitry Malyshau
f18443a79d Validate builtin types 2020-12-04 16:13:14 -05:00
Dzmitry Malyshau
92de5851d0 [wgsl] update builtin names, have implicit function return type 2020-12-04 16:09:57 -05:00
Dzmitry Malyshau
0d81b1f78c [msl] add TranslationInfo struct 2020-12-04 10:40:13 -05:00
Dzmitry Malyshau
d190c6441f Add spv::write_vec helper. 2020-12-04 10:40:13 -05:00
Capucho
181d8721cc [glsl-out] Refractoring
Used thiserror for the error enum
Moved the contents of the error module to the main module
Made the error an actual enum and not just a string
Splitted the write function on the feature manager into a function for
checking for feature availability
2020-11-26 17:04:26 -05:00
Capucho
3fbc801b80 [glsl-out] Wrote more documentation 2020-11-26 17:04:26 -05:00
Capucho
9d5b66934b [glsl-out] Refractoring
Splitted the backend into two more modules (features, errors)
Added a shorthand type for the backend Result
Reorganized function ordering
Moved from using a struct to write image dimension to a function
Started documenting the backend
2020-11-26 17:04:26 -05:00
Dzmitry Malyshau
96c8073865 [spv-out] always return expression type 2020-11-23 22:27:17 -05:00
Capucho
bc0d876422 [glsl-out] Backend cleanup
Moved the global writing part to it's own function
Merged the texture and the global loop
Applied some suggestions from kvark
Added a topological sorting of the call graph before writing
Removed the struct block loop and now every struct is written
Organized the main backend file a bit
2020-11-22 14:45:12 -05:00
Capucho
dd5021234d [glsl-out] Reworked the backend
The backend now works in a similar way to the msl backend
Should require less loops, allocations and backtracking
Overall just better to work with it

Added a build script which reads a file with the glsl keywords and
generates a slice to be used in the Namer

Added a way to build a call graph
2020-11-22 14:45:12 -05:00
Dzmitry Malyshau
23b1e4dd76 [spv-out] fix generation of OpConvert 2020-11-20 12:30:02 -05:00
Dzmitry Malyshau
1b8b3845be [mtl] Add 'kernel' and 'using' keywords 2020-11-20 10:57:59 -05:00
Pelle Johnsen
0f98357223 [glsl-in] Skip gl_PerVertex 2020-11-20 09:54:01 +01:00
Dzmitry Malyshau
7c7702c9d8 [mtl] move writer into a separate module 2020-11-19 23:19:26 -05:00
Dzmitry Malyshau
fa36ef194c [mtl] move keywords into a separate file 2020-11-19 23:19:26 -05:00
Dzmitry Malyshau
0f7b6e3e76 [mtl] dont include the std namespace 2020-11-19 23:19:26 -05:00
Dzmitry Malyshau
36bc6b8596 [mtl] populate reserved words more 2020-11-19 23:19:26 -05:00
Dzmitry Malyshau
d0f3450564 [msl make backend a folder module 2020-11-19 23:19:26 -05:00
Dzmitry Malyshau
c19bcbe89c Allow manual strip for clippy, temporarily 2020-11-19 23:19:10 -05:00
Dzmitry Malyshau
4ed91330cf Derive PartialEq for validation errors 2020-11-19 23:19:10 -05:00
Timo de Kort
929e07ff0c [spv-out] Add support for vector with vector multiplication 2020-11-18 17:37:52 +01:00
Timo de Kort
27ec95a238
[spv-out] Load variables when using CompositeConstruct (#284) 2020-11-16 16:52:51 -05:00
Timo de Kort
820dc51e2f
[spv-out] Fix annotations not getting added to output (#281) 2020-11-16 16:49:35 -05:00