Skip to content

Commit

Permalink
[naga xtask] Use naga-cli's --bulk-validate option.
Browse files Browse the repository at this point in the history
Use `naga --bulk-validate` for `cargo xtask validate wgsl`, reducing
runtime from 12s to 0.8s.
  • Loading branch information
jimblandy committed Dec 12, 2023
1 parent d98d6dd commit 7d16e4b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions naga/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,16 @@ fn run(args: Args) -> anyhow::Result<()> {
})
}
ValidateSubcommand::Wgsl => {
visit_files(snapshots_base_out, "wgsl/*.wgsl", |path| {
ack_visiting(path);
EasyCommand::new("cargo", |cmd| cmd.args(["run", "-p", "naga-cli", "--"]).arg(path)).success()
})
let mut paths = vec![];
let mut error_status = visit_files(snapshots_base_out, "wgsl/*.wgsl", |path| {
paths.push(path.to_owned());
Ok(())
});
EasyCommand::new("cargo", |cmd| {
cmd.args(["run", "-p", "naga-cli", "--", "--bulk-validate"]).args(paths)
}).success()
.log_if_err_found(&mut error_status);
error_status
}
ValidateSubcommand::Hlsl(cmd) => {
let visit_hlsl = |consume_config_item: &mut dyn FnMut(
Expand Down

0 comments on commit 7d16e4b

Please sign in to comment.