Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update naga-to-tokenstream requirement from 0.1 to 0.3 #3

Merged
merged 7 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading