Commit Graph

206 Commits

Author SHA1 Message Date
XAMPPRocky
2a19fc1cb7
Add introduction to API docs (#189) 2020-10-30 14:20:12 +00:00
Johan Andersson
98eb8d369c
Convert to use glam for math types (#149)
* [spirv-std] Remove math types

* Temp implementation of copysign

https://github.com/EmbarkStudios/rust-gpu/issues/148

* Convert shader to use glam

* Rustfmt

* Fix wgpu-example-shader to use glam

* [spirv-std] Disable clippy::use_self

* Upgrade to latest glam branch

* Use latest glam fork

* Remove incorrect assert_uninit

After discussions with @khyperia

* Update lockfile

* Update to latest glam fork with fixes

* Use real copysign intrinsic

* Disable clippy on example-shader for now

Tracked in https://github.com/EmbarkStudios/rust-gpu/issues/186
2020-10-30 14:58:38 +01:00
khyperia
450eb7d586 Improve DUMP_MIR debug flag 2020-10-30 14:31:52 +01:00
Viktor Zoutman
4f2daf3601
Fixed loops inside of a conditional branch (#185) 2020-10-30 10:19:10 +00:00
Jake Shadle
307d0da66b
Add spirv-tools and spirv-tools-sys crates to wrap usage of spirv-tools (#179)
* Add spirv-headers and spirv-tools as submodules

* Add simple generator and the generated code needed for compilation

* Add first pass on spirv-tools-sys

* Add first pass on spirv-tools

* Replace invocation of spirv-opt with spirv-tools crate

* Use C++11

* Placate clippy

* Add validation, replacing spirv-val with the spirv-tools crate

* Fix MSVC warning

* Use patched spirv-tools

* Fixup metadata

* Add same compiler flags as "official" build scripts

* Update spirv-tools and generated files

* Fixup

* Add assembler and example

* Use assembler in tests

* Oops, fix macos TARGET_OS

* write -> write_all

* Start splitting spirv-tools into a compiled vs tool feature set

* Checkpointing

* Checkpoint

* Boop

* Get tests to work both with installed and compiled tools

* Cleanup CI config

* Splits steps to clearly show how long each part of a longer (eg test)
step actually takes
* Label all steps

* Explicitly disable submodule checkout

* Rustfmt

* Rename features for consistency and fix clippy warnings

* Split "core" crates from examples

* Add run_clippy bash script

* Add test script

* Remove x flag

* Newline

* Actually print out errors from running val/opt

* Revert drive-by import merging

* Change intro to take the changes this PR has into account

* Actually run tests on Windows

* Fetch only the host target to reduce fetch times

* Add more info when a spirv tool returns a non-zero exit code

* Rustfmt

* Switch tool assembler to use files to see if it fixes windows

* Use files for input and output for now until I can figure out Windows being dumb

* Fix API docs generation

* Compile and use C++ code to check Windows issue

* Return to use installed tools
2020-10-29 23:03:07 +01:00
Jake Shadle
5aa7453b19 Revert "Replace usage of spirv-* binaries with spirv-tools rust crate (#117)"
This reverts commit 0bfe303a64.
2020-10-29 22:34:26 +01:00
Jake Shadle
0bfe303a64
Replace usage of spirv-* binaries with spirv-tools rust crate (#117)
* Add spirv-headers and spirv-tools as submodules

* Add simple generator and the generated code needed for compilation

* Add first pass on spirv-tools-sys

* Add first pass on spirv-tools

* Replace invocation of spirv-opt with spirv-tools crate

* Use C++11

* Add validation, replacing spirv-val with the spirv-tools crate

* Use patched spirv-tools

* Fixup metadata

* Add same compiler flags as "official" build scripts

* Update spirv-tools and generated files

* Add assembler and example

* Use assembler in tests

* Start splitting spirv-tools into a compiled vs tool feature set

* Get tests to work both with installed and compiled tools

* Cleanup CI config

* Splits steps to clearly show how long each part of a longer (eg test)
step actually takes
* Label all steps

* Explicitly disable submodule checkout

* Rename features for consistency and fix clippy warnings

* Split "core" crates from examples

* Add run_clippy bash script

* Add test script

* Change intro to take the changes this PR has into account

* Fetch only the host target to reduce fetch times

* Add more info when a spirv tool returns a non-zero exit code

* Use files for input and output for now until I can figure out Windows being dumb
2020-10-29 21:54:25 +01:00
Viktor Zoutman
ffc6d30dcd
Rough structurization of loops. (#176)
* Rough loops implementation

* Update rustc_codegen_spirv/src/linker/structurizer.rs

Co-authored-by: Ashley <ashley.ruglys@gmail.com>

Co-authored-by: Ashley <ashley.ruglys@gmail.com>
2020-10-29 13:10:49 +00:00
Ashley Hauck
03e69fc1ea
Refactor linker and delete some unused code (#171)
Use more efficient solutions than DefAnalyzer, and shuffle linker step
order to remove need for ScalarType/AggregateType.
2020-10-29 12:03:16 +00:00
Ashley Hauck
1b5aac084c
Support GLSL450 and Simple memory models (#168)
* Support GLSL450 and Simple memory models

* Update spirv-builder/src/lib.rs

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>

* Only emit SPV_KHR_vulkan_memory_model when needed

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
2020-10-28 13:49:44 +00:00
Ashley Hauck
23819c7a2c
Add support for spir-v 1.0 (#165) 2020-10-28 09:08:01 +00:00
Ashley Hauck
5b538ee5ee
Implement copysign for shaders (#158)
* Implement copysign for shaders

* Fix typo

* PR feedback
2020-10-27 13:16:40 +00:00
Ashley Hauck
06fdb85d61
Add dis_fn testing function (#155)
* Add dis_fn testing function

* Update spirv-builder/src/test/mod.rs

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
2020-10-27 10:35:53 +00:00
Ashley Hauck
d148dafc7d
Improve error message for pointer casts (#153) 2020-10-27 10:21:24 +00:00
Johan Andersson
1043aba140 Link copysign intrinsic implementation issue
https://github.com/EmbarkStudios/rust-gpu/issues/148
2020-10-27 02:11:14 +01:00
Ashley Hauck
75de003e0b
Move rspirv override to be directly in the crate (#150)
This fixes git references to rust-gpu, which don't pick up the workspace
override and cause obscure build failures.
2020-10-27 00:42:45 +01:00
Ashley Hauck
b32c04b3fd
Refactor attributes and add descriptor_set/binding (#145)
* Move entry declarations to their own file

Also clean up attribute parsing (and make it allow multiple arguments in
the process)

* Add descriptor_set and binding attributes

* clippy fix

* Fix test

* Reserve descriptor_set 0 for future use

* Add book page on attributes
2020-10-26 15:23:21 +00:00
khyperia
9e67f83cd6 rustup update 2020-10-26 08:38:07 +01:00
Johan Andersson
643c1ba950
Force use latest tar crate to avoid insecure warning on deps.rs (#132)
Current https://deps.rs/repo/github/EmbarkStudios/rust-gpu is showing that this repo has an insecure dependencies with the tar crate.

I believe this is because a previous tar v0.4.16 and earlier had a security advisory on it ([link](https://rustsec.org/advisories/RUSTSEC-2018-0002.html)) and that the deps.rs  service does not yet support Cargo.lock where we had specified that we use a latest version. Tracked in https://github.com/deps-rs/deps.rs/issues/26

So simply force require latest tar crate version (that we were already using) in Cargo.toml here with the hope that https://deps.rs won't flag the repo as having insecure dependencies
2020-10-24 16:57:06 +02:00
Josh Groves
fa6fc2461c
Fix typo in SPIR-V (#131) 2020-10-24 14:05:36 +00:00
Johan Andersson
9f1100082c
Enable clippy on spirv-std (#124) 2020-10-23 21:01:16 +00:00
Ashley Hauck
8681464af7
Add framework for compiler tests (#118) 2020-10-23 18:22:36 +02:00
Ashley Hauck
53b22b9fc3
Fix translation from AtomicOrdering to MemorySemantics (#111)
* Fix translation from AtomicOrdering to MemorySemantics

* Add comment about AtomicOrdering::Consume
2020-10-23 15:43:07 +02:00
Ashley Hauck
9dc6c61c4c
Fail unimplemented intrinsics instead of incorrect behavior (#114) 2020-10-23 13:18:31 +02:00
Viktor Zoutman
a121e50794
Fixed nested if statements (#88)
* Fixed nested if statements

* feedback

* Removed a line
2020-10-22 13:29:33 +02:00
Viktor Zoutman
3eea3dfa99
Added structurizer for conditional branch (#76)
* Added structurizer for conditional branch

* Cleaned up the code

* fmt

* unused imports

* feedback

* removed old code

* Now emitting a compiler error on loops

* fmt
2020-10-21 13:38:08 +02:00
khyperia
de12f120f2 Report error when entry point is zombied 2020-10-21 09:31:59 +02:00
khyperia
382b135c1e Fix typos in the implementation of memcpy 2020-10-21 08:39:15 +02:00
khyperia
83efcfd2ea Fix formatting 2020-10-20 17:36:30 +02:00
khyperia
c26639ce5e Fix size and alignment of vectors 2020-10-20 16:56:38 +02:00
khyperia
917c62ef34 Implement static_addr_of via similar system to register_fn_ptr 2020-10-20 16:30:49 +02:00
khyperia
0d18609281 Implement memcpy for single-element items 2020-10-20 15:44:15 +02:00
khyperia
a13930fccb Add #[spirv(builtin = ...)] 2020-10-19 18:42:54 +02:00
khyperia
2d55b4bff4 Don't deduplicate OpVariables (whoops) 2020-10-19 16:13:14 +02:00
Ashley Hauck
9e90652622
Don't initialize vars to undef (#68) 2020-10-19 16:11:45 +02:00
khyperia
64e0f664e0 Fix bug with mem2reg store valid variable detection 2020-10-19 14:48:01 +02:00
khyperia
919b320d32 Fix None unwrap panic in mem2reg 2020-10-19 12:16:20 +02:00
khyperia
3f91e0707f Make link take Session and clean up zombies 2020-10-19 11:22:40 +02:00
khyperia
96bb94f9fe Merge rspirv-linker into rustc_codegen_spirv 2020-10-19 10:20:29 +02:00
khyperia
332990b34c rustup update 2020-10-19 09:57:25 +02:00
khyperia
504c40fce2 Clippy so many things 2020-10-18 20:43:15 +02:00
khyperia
fb6823de85 rustup update 2020-10-17 23:20:48 +02:00
Ashley Hauck
fb2ed4d26c
Convert panics to compiler errors (#66)
This is a first pass, some fatals could probably be turned into errors.
2020-10-16 12:59:04 +02:00
khyperia
f8c669f536 rustup update 2020-10-16 08:25:04 +02:00
Jasper Bekkers
77e2914c21
Fix min and max intrinsics 2020-10-15 17:58:15 +02:00
khyperia
6df8774dc9 rustup update 2020-10-15 13:12:22 +02:00
XAMPPRocky
16c35c6d0e
Add custom panic hook (#58) 2020-10-14 18:31:17 +02:00
khyperia
4d0eb81d86 rustup update 2020-10-14 09:19:25 +02:00
khyperia
d9b64497fc Make mem2reg support OpAccessChain 2020-10-13 18:00:04 +02:00
Jasper Bekkers
b7aa6f310d
Renamed structs from NV to KHR (#50)
* Renamed structs from NV to KHR
2020-10-12 17:16:59 +02:00