naga-rust-back 0.1.0

Backend for the Naga shader translator which generates Rust code.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub(crate) struct Gensym(pub naga::Handle<naga::Expression>);

impl core::fmt::Display for Gensym {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        self.0.write_prefixed(f, "_e")
    }
}

pub(crate) trait LevelNext {
    fn next(self) -> Self;
}
impl LevelNext for naga::back::Level {
    fn next(self) -> Self {
        Self(self.0.saturating_add(1))
    }
}