Backtrace
42 |
43 |
44 | ```
45 |
46 | ```
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/enhancement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Enhancement
3 | about: Propose a minor improvement or feature to the project.
4 | title: "(My enhancement)"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 |
20 |
--------------------------------------------------------------------------------
/.github/install-spirv-tools/Cargo.toml:
--------------------------------------------------------------------------------
1 | # We make this tool its own workspace as it doesn't share dependencies with the
2 | # rest of the workspace, and it shouldn't be built normally, only as a helper
3 | # for CI so it would just slow down local development for no reason
4 | [workspace]
5 |
6 | [package]
7 | name = "install-spirv-tools"
8 | edition = "2021"
9 | version = "0.1.0"
10 | publish = false
11 |
12 | [dependencies]
13 | tar = "0.4"
14 | zstd = "0.13"
15 |
--------------------------------------------------------------------------------
/.github/workflows/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rust-GPU/rust-gpu/77070b70b4af3afd7d12d980f6c997e9b77e6f9c/.github/workflows/ISSUE_TEMPLATE/bug_report.md
--------------------------------------------------------------------------------
/.github/workflows/deploy_docs.yml:
--------------------------------------------------------------------------------
1 | name: Deploy docs
2 | on:
3 | push:
4 | branches:
5 | - main
6 | jobs:
7 | build:
8 | runs-on: macos-latest
9 | steps:
10 | - uses: actions/checkout@v2
11 | - run: brew install mdbook spirv-tools
12 | - run: mkdir docs-build/
13 | - run: $(cd docs && mdbook build -d ../docs-build/book)
14 | - run: .github/workflows/docs.sh
15 | - run: mv target/doc docs-build/api
16 | - uses: JamesIves/github-pages-deploy-action@3.7.1
17 | with:
18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 | BRANCH: gh-pages # The branch the action should deploy to.
20 | FOLDER: docs-build # The folder the action should deploy.
21 | CLEAN: true # Automatically remove deleted files from the deploy branch
22 |
--------------------------------------------------------------------------------
/.github/workflows/docs.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | if [[ -z "${CI}" ]]; then
5 | FEAT="use-compiled-tools"
6 | else
7 | FEAT="use-installed-tools"
8 | fi
9 |
10 | function doc() {
11 | echo ::group::"$1"
12 | cargo doc \
13 | --manifest-path "$1/Cargo.toml" \
14 | --no-default-features \
15 | --features "$FEAT"
16 | echo ::endgroup::
17 | }
18 |
19 | # Core crates only!
20 | cargo doc --manifest-path "crates/spirv-std/Cargo.toml" --all-features
21 | doc crates/rustc_codegen_spirv
22 | doc crates/spirv-builder
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | .vscode/
3 | .vim/
4 | tests/Cargo.lock
5 | .github/install-spirv-tools/Cargo.lock
6 | rustc-ice-*.txt
7 | .idea
8 |
--------------------------------------------------------------------------------
/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | Permission is hereby granted, free of charge, to any
2 | person obtaining a copy of this software and associated
3 | documentation files (the "Software"), to deal in the
4 | Software without restriction, including without
5 | limitation the rights to use, copy, modify, merge,
6 | publish, distribute, sublicense, and/or sell copies of
7 | the Software, and to permit persons to whom the Software
8 | is furnished to do so, subject to the following
9 | conditions:
10 |
11 | The above copyright notice and this permission notice
12 | shall be included in all copies or substantial portions
13 | of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 | DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/clippy.toml:
--------------------------------------------------------------------------------
1 | avoid-breaking-exported-api = false
2 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rustc_codegen_spirv-target-specs"
3 | description = "target spec json files of rust-gpu for the rustc compiler"
4 | version.workspace = true
5 | authors.workspace = true
6 | edition.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 |
10 | [features]
11 | include_str = []
12 | dir_path = []
13 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/README.md:
--------------------------------------------------------------------------------
1 | # `rustc_codegen_spirv-target-specs`
2 |
3 | The target spec json files of rust-gpu to hand to the rustc compiler, declaring various metadata about our codegen backend.
4 |
5 | ## Features
6 | * `include_str`: include target specs as string constants, for bundling with `cargo-gpu`
7 | * `dir_path`: export a path to the target specs dir, for `spirv-builder` and `compiletest` in this repo
8 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![doc = include_str!("../README.md")]
2 |
3 | /// directory with all the `target-specs` jsons for our codegen backend
4 | #[cfg(feature = "dir_path")]
5 | pub const TARGET_SPEC_DIR_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/target-specs");
6 |
7 | #[cfg(feature = "include_str")]
8 | mod include_str;
9 | #[cfg(feature = "include_str")]
10 | pub use include_str::TARGET_SPECS;
11 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "opengl4.0",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-opengl4.0",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "opengl4.1",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-opengl4.1",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "opengl4.2",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-opengl4.2",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "opengl4.3",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-opengl4.3",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "opengl4.5",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-opengl4.5",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.0",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.0",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.1",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.1",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.2",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.2",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.3",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.3",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.4",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.4",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "spv1.5",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-spv1.5",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "vulkan1.0",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-vulkan1.0",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "vulkan1.1",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-vulkan1.1",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "vulkan1.1spv1.4",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-vulkan1.1spv1.4",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows-weak-linkage": false,
3 | "arch": "spirv",
4 | "crt-objects-fallback": "false",
5 | "crt-static-allows-dylibs": true,
6 | "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64",
7 | "dll-prefix": "",
8 | "dll-suffix": ".spv.json",
9 | "dynamic-linking": true,
10 | "emit-debug-gdb-scripts": false,
11 | "env": "vulkan1.2",
12 | "linker-flavor": "unix",
13 | "linker-is-gnu": false,
14 | "llvm-target": "spirv-unknown-vulkan1.2",
15 | "main-needs-argc-argv": false,
16 | "metadata": {
17 | "description": null,
18 | "host_tools": null,
19 | "std": null,
20 | "tier": null
21 | },
22 | "os": "unknown",
23 | "panic-strategy": "abort",
24 | "simd-types-indirect": false,
25 | "target-pointer-width": "32"
26 | }
27 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-types/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rustc_codegen_spirv-types"
3 | description = "SPIR-V backend types shared between rustc_codegen_spirv and spirv-builder"
4 | version.workspace = true
5 | authors.workspace = true
6 | edition.workspace = true
7 | license.workspace = true
8 | repository.workspace = true
9 |
10 | [dependencies]
11 | spirv = { version = "0.3.0", features = ["serialize", "deserialize"] }
12 | rspirv = "0.12"
13 | serde = { version = "1.0", features = ["derive"] }
14 | serde_json = "1.0"
15 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-types/README.md:
--------------------------------------------------------------------------------
1 | # `rustc_codegen_spirv-types`
2 |
3 | SPIR-V backend types shared between `rustc_codegen_spirv` and `spirv-builder`. Please refer to [`spirv-builder`](https://docs.rs/spirv-builder/) for more information.
4 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv-types/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![doc = include_str!("../README.md")]
2 |
3 | pub use rspirv::spirv::Capability;
4 |
5 | mod compile_result;
6 | pub use compile_result::*;
7 |
8 | // HACK(eddyb) allows downstream crates to access the correct version directly.
9 | pub use serde;
10 | pub use serde_json;
11 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv/README.md:
--------------------------------------------------------------------------------
1 | # `rustc_codegen_spirv`
2 |
3 | Compiler backend for the `SPIR-V` target architecture. This crate is not intended to be used directly. Please refer to [`spirv-builder`](https://docs.rs/spirv-builder/) for more information.
4 |
5 | ## Documentation
6 |
7 | Because of its nature, this crate can only be built using a very specific nightly version of the Rust toolchain. As such, the `docs.rs` build of the API documentation will likely fail. Please refer to the [documentation in the `rust-gpu` github repo](https://rust-gpu.github.io/rust-gpu/api/rustc_codegen_spirv/index.html) for properly built docs.
8 |
--------------------------------------------------------------------------------
/crates/rustc_codegen_spirv/src/target_feature.rs:
--------------------------------------------------------------------------------
1 | use rustc_span::symbol::Symbol;
2 |
3 | #[derive(Clone, Debug, Eq, PartialEq)]
4 | pub enum TargetFeature {
5 | Extension(Symbol),
6 | Capability(rspirv::spirv::Capability),
7 | }
8 |
9 | impl std::str::FromStr for TargetFeature {
10 | type Err = String;
11 |
12 | fn from_str(input: &str) -> Result