mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Expect *.txt instead of - for the debug output of the converter
This commit is contained in:
@@ -37,7 +37,7 @@ DOT (GraphViz) | :ok: | dot-out | Not a shading language |
|
||||
Naga includes a default binary target, which allows to test the conversion of different code paths.
|
||||
```bash
|
||||
cargo run --features wgsl-in -- my_shader.wgsl # validate only
|
||||
cargo run --features spv-in -- my_shader.spv - # dump the IR module to debug output
|
||||
cargo run --features spv-in -- my_shader.spv my_shader.txt # dump the IR module into a file
|
||||
cargo run --features spv-in,msl-out -- my_shader.spv my_shader.metal --flow-dir flow-dir # convert the SPV to Metal, also dump the SPIR-V flow graph to `flow-dir`
|
||||
cargo run --features wgsl-in,glsl-out -- my_shader.wgsl my_shader.vert --profile es310 # convert the WGSL to GLSL vertex stage under ES 3.20 profile
|
||||
```
|
||||
|
||||
17
bin/naga.rs
17
bin/naga.rs
@@ -199,14 +199,6 @@ fn main() {
|
||||
}
|
||||
}
|
||||
};
|
||||
if output_path == "-" {
|
||||
println!("{:#?}", module);
|
||||
if let Some(info) = info {
|
||||
println!();
|
||||
println!("{:#?}", info);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
match Path::new(output_path)
|
||||
.extension()
|
||||
@@ -214,6 +206,15 @@ fn main() {
|
||||
.to_str()
|
||||
.unwrap()
|
||||
{
|
||||
"txt" => {
|
||||
use std::io::Write;
|
||||
let mut file = fs::File::create(output_path).unwrap();
|
||||
writeln!(file, "{:#?}", module).unwrap();
|
||||
if let Some(info) = info {
|
||||
writeln!(file).unwrap();
|
||||
writeln!(file, "{:#?}", info).unwrap();
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "msl-out")]
|
||||
"metal" => {
|
||||
use naga::back::msl;
|
||||
|
||||
Reference in New Issue
Block a user