diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9cfc2d874d..c27d0a67a2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,7 +292,7 @@ jobs: cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-hal --all-features cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu --all-features - # Building for no_std platforms where every feature is enabled except "std". + # Building for no_std platforms. - name: Check `no_std` if: matrix.kind == 'no_std' shell: bash @@ -301,9 +301,11 @@ jobs: # check with no features cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-types --no-default-features + cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga --no-default-features - # Check with all features except "std". + # Check with all compatible features cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-types --no-default-features --features strict_asserts,fragile-send-sync-non-atomic-wasm,serde,counters + cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga --no-default-features --features dot-out,compact # Building for native platforms with standard tests. - name: Check native diff --git a/CHANGELOG.md b/CHANGELOG.md index 95c000c9b45..12b49a611ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,10 @@ Bottom level categories: ### New Features +#### Naga + +- Added `no_std` support with default features disabled. By @Bushrat011899 in [#7585](https://github.com/gfx-rs/wgpu/pull/7585). + #### General - Add support for rendering to slices of 3D texture views and single layered 2D-Array texture views (this requires `VK_KHR_maintenance1` which should be widely available on newer drivers). By @teoxoy in [#7596](https://github.com/gfx-rs/wgpu/pull/7596) diff --git a/Cargo.lock b/Cargo.lock index 94e90416612..9bfd8741917 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2513,6 +2513,7 @@ dependencies = [ "hlsl-snapshots", "indexmap", "itertools 0.14.0", + "libm", "log", "num-traits", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 6b91c2106af..5f75645bc21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,6 +135,7 @@ libc = { version = "0.2.168", default-features = false } # See https://github.com/rust-fuzz/libfuzzer/issues/126 libfuzzer-sys = ">0.4.0,<=0.4.7" libloading = "0.8" +libm = { version = "0.2.6", default-features = false } libtest-mimic = "0.8" log = "0.4.21" nanoserde = "0.2" diff --git a/naga/Cargo.toml b/naga/Cargo.toml index e9a28900034..9c5c0353721 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -91,6 +91,7 @@ hashbrown.workspace = true half = { workspace = true, features = ["num-traits"] } rustc-hash.workspace = true indexmap.workspace = true +libm = { workspace = true, default-features = false } log.workspace = true num-traits.workspace = true once_cell = { workspace = true, features = ["alloc", "race"] } diff --git a/naga/src/back/mod.rs b/naga/src/back/mod.rs index 175c5481b33..d7b14475bff 100644 --- a/naga/src/back/mod.rs +++ b/naga/src/back/mod.rs @@ -46,6 +46,13 @@ pub type NeedBakeExpressions = crate::FastHashSet); impl core::fmt::Display for Baked { diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index 27d6addc826..dca082ec82b 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -1172,8 +1172,8 @@ impl<'a> ConstantEvaluator<'a> { } crate::MathFunction::Round => { component_wise_float(self, span, [arg], |e| match e { - Float::Abstract([e]) => Ok(Float::Abstract([e.round_ties_even()])), - Float::F32([e]) => Ok(Float::F32([e.round_ties_even()])), + Float::Abstract([e]) => Ok(Float::Abstract([libm::rint(e)])), + Float::F32([e]) => Ok(Float::F32([libm::rintf(e)])), Float::F16([e]) => { // TODO: `round_ties_even` is not available on `half::f16` yet. //