diff --git a/CHANGELOG.md b/CHANGELOG.md index 97feb4454a..dc37d7c34e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added ⭐ +- [PR#1031](https://github.com/EmbarkStudios/rust-gpu/pull/1031) added `Components` generic parameter to `Image` type, allowing images to return lower dimensional vectors and even scalars from the sampling API + ### Changed 🛠 -- [PR#1031](https://github.com/EmbarkStudios/rust-gpu/pull/1031) Added `Components` generic parameter to `Image` type, allowing images to return lower dimensional vectors and even scalars from the sampling API. +- [PR#1035](https://github.com/EmbarkStudios/rust-gpu/pull/1035) reduced the number of CGUs ("codegen units") used by `spirv-builder` to just `1` - [PR#1011](https://github.com/EmbarkStudios/rust-gpu/pull/1011) made `NonWritable` all read-only storage buffers (i.e. those typed `&T`, where `T` doesn't have interior mutability) - [PR#1029](https://github.com/EmbarkStudios/rust-gpu/pull/1029) fixed SampledImage::sample() fns being unnecessarily marked as unsafe diff --git a/crates/spirv-builder/src/lib.rs b/crates/spirv-builder/src/lib.rs index 38561261d1..1da5627e5a 100644 --- a/crates/spirv-builder/src/lib.rs +++ b/crates/spirv-builder/src/lib.rs @@ -578,6 +578,16 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result { join_checking_for_separators(rustflags, "\x1f"), ); + let profile_in_env_var = profile.replace('-', "_").to_ascii_uppercase(); + + // NOTE(eddyb) there's no parallelism to take advantage of multiple CGUs, + // and inter-CGU duplication can be wasteful, so this forces 1 CGU for now. + let num_cgus = 1; + cargo.env( + format!("CARGO_PROFILE_{profile_in_env_var}_CODEGEN_UNITS"), + num_cgus.to_string(), + ); + let build = cargo .stderr(Stdio::inherit()) .current_dir(&builder.path_to_crate)