From a389a7993f1afc6f1f902503bce2abdca7a7633c Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Fri, 14 Jul 2023 15:07:33 +0300 Subject: [PATCH] Remove mentions of `0.4` pre-releases and try making `spirv-builder/README.md` more readable. --- crates/rustc_codegen_spirv/build.rs | 4 ++-- crates/spirv-builder/README.md | 31 ++++++++++++++++------------- crates/spirv-std/README.md | 4 ---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 0ddd6b78ec..c3de9b5924 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -8,7 +8,7 @@ use std::process::{Command, ExitCode}; /// Current `rust-toolchain.toml` file /// Unfortunately, directly including the actual workspace `rust-toolchain.toml` doesn't work together with /// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/ -//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain"); +//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml"); const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain] channel = "nightly-2023-05-27" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] @@ -65,7 +65,7 @@ fn check_toolchain_version() -> Result<(), Box> { return Err(Box::::from(format!( r#"error: wrong toolchain detected (found commit hash `{current_hash}`, expected `{required_hash}`). -Make sure your `rust-toolchain` file contains the following: +Make sure your `rust-toolchain.toml` file contains the following: ------------- {stripped_toolchain} -------------"# diff --git a/crates/spirv-builder/README.md b/crates/spirv-builder/README.md index 62a52e6f03..7914757079 100644 --- a/crates/spirv-builder/README.md +++ b/crates/spirv-builder/README.md @@ -29,23 +29,26 @@ const SHADER: &[u8] = include_bytes!(env!("my_shaders.spv")); ## Building with `spirv-builder` -Because of its nature, `rustc_codegen_spirv`, and therefore `spirv-builder` by extension, require the use of a very specific nightly toolchain of Rust. +As `spirv-builder` relies on `rustc_codegen_spirv` being built for it (by Cargo, as a direct dependency), and due to the special nature of the latter (as a `rustc` codegen backend "plugin"), both end up sharing the requirement for a very specific nightly toolchain version of Rust. -**The current toolchain is: `nightly-2023-05-27`.** +**The current Rust toolchain version is: `nightly-2023-05-27`.** -Toolchains for previous versions of `spirv-builder`: +Rust toolchain version history across [rust-gpu releases](https://github.com/EmbarkStudios/rust-gpu/releases) (since `0.4`): -|Version|Toolchain| -|-:|-| -|`0.8.0`|`nightly-2023-04-15`| -|`0.7.0`|`nightly-2023-03-04`| -|`0.6.*`|`nightly-2023-01-21`| -|`0.5.0`|`nightly-2022-12-18`| -|`0.4.0`|`nightly-2022-10-29`| -|`0.4.0-alpha.16` - `0.4.0-alpha.17`|`nightly-2022-10-01`| -|`0.4.0-alpha.15`|`nightly-2022-08-29`| -|`0.4.0-alpha.13` - `0.4.0-alpha.14`|`nightly-2022-04-11`| +|`spirv-builder`
version|Rust toolchain
version| +|:-:|:-:| +|`0.8`|`nightly-2023-04-15`| +|`0.7`|`nightly-2023-03-04`| +|`0.6`|`nightly-2023-01-21`| +|`0.5`|`nightly-2022-12-18`| +|`0.4`|`nightly-2022-10-29`| -The nightly toolchain has to match *exactly*. Starting with `0.4.0-alpha.15`, the commit hash of your local toolchain is checked and you'll get a build error when building `rustc_codegen_spirv` with the wrong toolchain. If you want to experiment with different versions, this check can be omitted by defining the environment variable `RUSTGPU_SKIP_TOOLCHAIN_CHECK`since `0.4.0-alpha.16`. Keep in mind that, as `rustc_codegen_spirv` is heavily dependent on `rustc`'s internal API, diverging too much from the required toolchain will quickly result in compile errors. +*As patch versions must be semver-compatible, they will always require the +same toolchain (for example, `0.6.0` and `0.6.1` both use `nightly-2023-01-21`).* + +Only that *exact* Rust nightly toolchain version is **supported**. Since `0.4`, the commit hash of your current Rust toolchain is checked and you'll get a build error when building `rustc_codegen_spirv` with the wrong toolchain. +Notably, the error will also show what the `rust-toolchain.toml` file *should* contain (to get the expected toolchain), which you can rely on when updating to a new release. + +If you want to experiment with _different, **unsupported**_, Rust toolchain versions, this check can be omitted by defining the environment variable `RUSTGPU_SKIP_TOOLCHAIN_CHECK`. Keep in mind that, as `rustc_codegen_spirv` is *heavily* dependent on `rustc`'s internal APIs, diverging too much from the supported toolchain version will quickly result in compile errors (or worse, e.g. spurious errors and/or incorrect behavior, when compiling shaders with it). [rustgpu]: https://github.com/EmbarkStudios/rust-gpu/ diff --git a/crates/spirv-std/README.md b/crates/spirv-std/README.md index 48dfb221dd..7cba186be4 100644 --- a/crates/spirv-std/README.md +++ b/crates/spirv-std/README.md @@ -4,10 +4,6 @@ Core functions, traits, and more that make up a “standard library” for SPIR- This crate gives a `rust-gpu` shader access to the required `#![spirv(..)]` attribute, as well as povide all kinds of APIs that allows a shader to access GPU resources such as textures and buffers. Optionally, through the use of the `"glam"` feature, it includes some boilerplate trait implementations to make `glam` vector types compatible with these APIs. -## 🚨 BREAKING 🚨 - -As of `0.4.0-alpha.16`, your shaders will require a different preamble. See [this migration guide][migration] for more information. - ## Example ![Sky shader](https://github.com/EmbarkStudios/rust-gpu/raw/b12a2f3f6a54bc841d05a9224bc577909d519228/docs/assets/sky.jpg)