mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Bincode support for naga-cli
This commit is contained in:
@@ -14,8 +14,9 @@ name = "naga"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
naga = { path = "../", features = ["validate", "span", "wgsl-in", "wgsl-out", "glsl-in", "glsl-out", "spv-in", "spv-out", "msl-out", "hlsl-out", "dot-out", "glsl-validate"] }
|
||||
naga = { path = "../", features = ["validate", "span", "wgsl-in", "wgsl-out", "glsl-in", "glsl-out", "spv-in", "spv-out", "msl-out", "hlsl-out", "dot-out", "glsl-validate", "serialize", "deserialize"] }
|
||||
bincode = "1"
|
||||
log = "0.4"
|
||||
codespan-reporting = "0.11"
|
||||
env_logger = "0.8"
|
||||
env_logger = "0.9"
|
||||
argh = "0.1.5"
|
||||
|
||||
@@ -265,6 +265,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.to_str()
|
||||
.ok_or(CliError("Input filename not valid unicode"))?
|
||||
{
|
||||
"bin" => (bincode::deserialize(&input)?, None),
|
||||
"spv" => {
|
||||
let options = naga::front::spv::Options {
|
||||
adjust_coordinate_space: !params.keep_coordinate_space,
|
||||
@@ -360,6 +361,10 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
writeln!(file, "{:#?}", info)?;
|
||||
}
|
||||
}
|
||||
"bin" => {
|
||||
let file = fs::File::create(output_path)?;
|
||||
bincode::serialize_into(file, &module)?;
|
||||
}
|
||||
"metal" => {
|
||||
use naga::back::msl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user