Skip to content

Commit

Permalink
Merge pull request #3 from LucentFlux/dependabot/cargo/naga-to-tokens…
Browse files Browse the repository at this point in the history
…tream-0.3

Update naga-to-tokenstream requirement from 0.1 to 0.3
  • Loading branch information
Joeoc2001 authored Oct 19, 2023
2 parents 98aa2de + c0b3905 commit 5478abd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ categories = ["game-development", "graphics"]
include = ["/Cargo.toml", "/LICENSE", "/README.md", "/src/**"]

[dependencies]
syn = { version = "1.0", features = ["full"] }
syn = { version = "2.0", features = ["full"] }
naga = { version = "0.13", features = ["wgsl-in", "wgsl-out"] }
naga-to-tokenstream = "0.1"
naga-to-tokenstream = "0.3"
proc-macro2 = "1.0"
quote = "1.0"

Expand Down
14 changes: 14 additions & 0 deletions examples/struct_export.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mod shader {
wgsl_inline::wgsl! {
struct MyStruct {
foo: f32,
bar: u32
}
}
}

fn main() {
let my_struct = shader::types::MyStruct { foo: 1.0, bar: 12 };

println!("my struct: {:?}", my_struct);
}
7 changes: 6 additions & 1 deletion src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ impl ShaderResult {
}
}

let mut module_items = naga_to_tokenstream::ModuleToTokens::to_items(&self.module);
let mut module_items = naga_to_tokenstream::ModuleToTokens::to_items(
&self.module,
naga_to_tokenstream::ModuleToTokensConfig {
structs_filter: None,
},
);
items.append(&mut module_items);

items
Expand Down

0 comments on commit 5478abd

Please sign in to comment.