Skip to content

Commit

Permalink
support msl-out with no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
brody4hire committed Jan 20, 2025
1 parent 3a62d43 commit db87671
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
# Check wgpu-types with all features except "std".
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
# Check naga with all features possible for no-std.
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga --no-default-features --features dot-out,glsl-out
cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga --no-default-features --features dot-out,glsl-out,msl-out
# Building for native platforms with standard tests.
- name: check native
Expand Down
4 changes: 4 additions & 0 deletions naga/src/back/msl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ holding the result.
*/

#[cfg(not(feature = "std"))]
use crate::aliases::*;

use crate::{arena::Handle, proc::index, valid::ModuleInfo};

use std::fmt::{Error as FmtError, Write};

mod keywords;
Expand Down
4 changes: 4 additions & 0 deletions naga/src/back/msl/sampler.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#[cfg(not(feature = "std"))]
use crate::aliases::*;

#[cfg(feature = "deserialize")]
use serde::Deserialize;
#[cfg(feature = "serialize")]
use serde::Serialize;

use std::{num::NonZeroU32, ops::Range};

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
Expand Down
10 changes: 10 additions & 0 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
use super::{sampler as sm, Error, LocationMode, Options, PipelineOptions, TranslationInfo};

#[cfg(not(feature = "std"))]
use crate::aliases::*;

// XXX TBD ??? ??? - IGNORING unused_imports warning HERE - XXX TBD COMBINE WITH ALIASES ???
#[allow(unused_imports)]
#[cfg(not(feature = "std"))]
use num_traits::real::*;

use crate::{
arena::{Handle, HandleSet},
back::{self, Baked},
proc::index,
proc::{self, NameKey, TypeResolution},
valid, FastHashMap, FastHashSet,
};

#[cfg(test)]
use std::ptr;
use std::{
Expand Down

0 comments on commit db87671

Please sign in to comment.