-
Notifications
You must be signed in to change notification settings - Fork 247
Replace usage of spirv-* binaries with spirv-tools rust crate #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+6,490
−176
Merged
Changes from 34 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
78acbd5
Add spirv-headers and spirv-tools as submodules
Jake-Shadle ab53559
Add simple generator and the generated code needed for compilation
Jake-Shadle 32fe2a1
Add first pass on spirv-tools-sys
Jake-Shadle 095ec40
Add first pass on spirv-tools
Jake-Shadle cac9704
Replace invocation of spirv-opt with spirv-tools crate
Jake-Shadle 6739ca9
Use C++11
Jake-Shadle 95911d2
Placate clippy
Jake-Shadle 2997eaa
Add validation, replacing spirv-val with the spirv-tools crate
Jake-Shadle f5cd86d
Fix MSVC warning
Jake-Shadle cbe33b7
Use patched spirv-tools
Jake-Shadle 527388c
Fixup metadata
Jake-Shadle 8635e68
Add same compiler flags as "official" build scripts
Jake-Shadle 69a20e2
Update spirv-tools and generated files
Jake-Shadle 77eb69e
Fixup
Jake-Shadle e499051
Add assembler and example
Jake-Shadle c951704
Use assembler in tests
Jake-Shadle 26730ae
Oops, fix macos TARGET_OS
Jake-Shadle 5040025
write -> write_all
Jake-Shadle 67a526b
Start splitting spirv-tools into a compiled vs tool feature set
Jake-Shadle be90051
Checkpointing
Jake-Shadle e108852
Checkpoint
Jake-Shadle 1ba0c89
Boop
Jake-Shadle 91823a0
Get tests to work both with installed and compiled tools
Jake-Shadle 66d4785
Cleanup CI config
Jake-Shadle f477b4c
Explicitly disable submodule checkout
Jake-Shadle b21e34f
Rustfmt
Jake-Shadle 302f4c2
Rename features for consistency and fix clippy warnings
Jake-Shadle c8b3576
Split "core" crates from examples
Jake-Shadle d0715f5
Add run_clippy bash script
Jake-Shadle 500b52a
Add test script
Jake-Shadle 1a70688
Remove x flag
Jake-Shadle fcf5bd2
Newline
Jake-Shadle ca1ab0e
Actually print out errors from running val/opt
Jake-Shadle 94ccf07
Revert drive-by import merging
Jake-Shadle 938bb1d
Change intro to take the changes this PR has into account
Jake-Shadle b6eef4a
Actually run tests on Windows
Jake-Shadle be6c404
Fetch only the host target to reduce fetch times
Jake-Shadle 0b0903a
Add more info when a spirv tool returns a non-zero exit code
Jake-Shadle 68ae913
Rustfmt
Jake-Shadle 034ddad
Switch tool assembler to use files to see if it fixes windows
Jake-Shadle 52d1f7f
Use files for input and output for now until I can figure out Windows…
Jake-Shadle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| if [[ -z "${CI}" ]]; then | ||
| FEAT="use-compiled-tools" | ||
| else | ||
| FEAT="use-installed-tools" | ||
| fi | ||
|
|
||
| function clippy() { | ||
| echo ::group::"$1" | ||
| cargo clippy \ | ||
| --manifest-path "$1/Cargo.toml" \ | ||
| --no-default-features \ | ||
| --features "$FEAT" \ | ||
| --all-targets \ | ||
| -- -D warnings | ||
| echo ::endgroup:: | ||
| } | ||
|
|
||
| function clippy_no_features() { | ||
| echo ::group::"$1" | ||
| cargo clippy \ | ||
| --manifest-path "$1/Cargo.toml" \ | ||
| --all-targets \ | ||
| -- -D warnings | ||
| echo ::endgroup:: | ||
| } | ||
|
|
||
| # Core crates | ||
| clippy spirv-tools-sys | ||
| clippy spirv-tools | ||
| clippy rustc_codegen_spirv | ||
| clippy spirv-builder | ||
|
|
||
| # Examples | ||
| clippy examples/example-runner | ||
| clippy examples/wgpu-example-runner | ||
|
|
||
| clippy_no_features examples/example-runner-cpu | ||
| clippy_no_features examples/example-shader | ||
| clippy_no_features examples/wgpu-example-shader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| if [[ -z "${CI}" ]]; then | ||
| FEAT="use-compiled-tools" | ||
| else | ||
| FEAT="use-installed-tools" | ||
| fi | ||
|
|
||
| os=$1 | ||
|
|
||
| function cargo_test() { | ||
| echo ::group::"$1 build" | ||
| cargo test \ | ||
| --manifest-path "$1/Cargo.toml" \ | ||
| --no-default-features \ | ||
| --features "$FEAT" \ | ||
| --no-run | ||
| echo ::endgroup:: | ||
|
|
||
| echo ::group::"$1 test" | ||
| cargo test \ | ||
| --manifest-path "$1/Cargo.toml" \ | ||
| --no-default-features \ | ||
| --features "$FEAT" | ||
| echo ::endgroup:: | ||
| } | ||
|
|
||
| function cargo_test_no_features() { | ||
| echo ::group::"$1 build" | ||
| cargo test --manifest-path "$1/Cargo.toml" --no-run | ||
| echo ::endgroup:: | ||
|
|
||
| echo ::group::"$1 test" | ||
| cargo test --manifest-path "$1/Cargo.toml" | ||
| echo ::endgroup:: | ||
| } | ||
|
|
||
| # Core crates | ||
| cargo_test spirv-tools-sys | ||
| cargo_test spirv-tools | ||
| cargo_test rustc_codegen_spirv | ||
| cargo_test spirv-builder | ||
|
|
||
| # Examples | ||
| # See: https://github.com/EmbarkStudios/rust-gpu/issues/84 | ||
| if [[ -z "${CI}" && "$os" != "macOS" ]]; then | ||
| cargo_test examples/example-runner | ||
| fi | ||
|
|
||
| cargo_test examples/wgpu-example-runner | ||
|
|
||
| cargo_test_no_features examples/example-runner-cpu | ||
| cargo_test_no_features examples/example-shader | ||
| cargo_test_no_features examples/wgpu-example-shader | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [submodule "spirv-tools-sys/spirv-headers"] | ||
| path = spirv-tools-sys/spirv-headers | ||
| url = https://github.com/KhronosGroup/SPIRV-Headers.git | ||
| [submodule "spirv-tools-sys/spirv-tools"] | ||
| path = spirv-tools-sys/spirv-tools | ||
| url = https://github.com/EmbarkStudios/SPIRV-Tools.git | ||
| branch = patch-to-string |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,3 @@ spirv-std = { path = "../../spirv-std" } | |
|
|
||
| # for parallelism, not really needed though | ||
| rayon = "1.5" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,12 @@ authors = ["Embark <[email protected]>"] | |
| edition = "2018" | ||
| license = "MIT OR Apache-2.0" | ||
|
|
||
| # See rustc_codegen_spirv/Cargo.toml for details on these features | ||
| [features] | ||
| default = ["use-compiled-tools"] | ||
| use-installed-tools = ["spirv-builder/use-installed-tools"] | ||
| use-compiled-tools = ["spirv-builder/use-compiled-tools"] | ||
|
|
||
| [dependencies] | ||
| ash = "0.31" | ||
| ash-window = "0.5" | ||
|
|
@@ -16,4 +22,4 @@ winit = "0.23.0" | |
| ash-molten = { git = "https://github.com/EmbarkStudios/ash-molten", branch = "moltenvk-1.1.0" } | ||
|
|
||
| [build-dependencies] | ||
| spirv-builder = { path = "../../spirv-builder" } | ||
| spirv-builder = { path = "../../spirv-builder", default-features = false } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,13 +5,19 @@ authors = ["Embark <[email protected]>"] | |
| edition = "2018" | ||
| license = "MIT OR Apache-2.0" | ||
|
|
||
| # See rustc_codegen_spirv/Cargo.toml for details on these features | ||
| [features] | ||
| default = ["use-compiled-tools"] | ||
| use-installed-tools = ["spirv-builder/use-installed-tools"] | ||
| use-compiled-tools = ["spirv-builder/use-compiled-tools"] | ||
|
|
||
| [dependencies] | ||
| wgpu = "0.6.0" | ||
| futures = { version = "0.3", default-features = false, features = ["std", "executor"] } | ||
| winit = { version = "0.22.1", features = ["web-sys"] } | ||
|
|
||
| [build-dependencies] | ||
| spirv-builder = { path = "../../spirv-builder" } | ||
| spirv-builder = { path = "../../spirv-builder", default-features = false } | ||
|
|
||
| [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
| wgpu-subscriber = "0.1.0" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.