mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
cli: Populate dot backend options in Parameters early.
This is a step towards having the output loop depend only on `params`, rather than both `params` and `args`.
This commit is contained in:
committed by
Teodor Tanasoaia
parent
54df410b94
commit
2a47a15f03
@@ -161,6 +161,7 @@ struct Parameters<'a> {
|
||||
entry_point: Option<String>,
|
||||
keep_coordinate_space: bool,
|
||||
spv_block_ctx_dump_prefix: Option<String>,
|
||||
dot: naga::back::dot::Options,
|
||||
spv: naga::back::spv::Options<'a>,
|
||||
msl: naga::back::msl::Options,
|
||||
glsl: naga::back::glsl::Options,
|
||||
@@ -273,6 +274,8 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
params.keep_coordinate_space = args.keep_coordinate_space;
|
||||
|
||||
params.dot.cfg_only = args.dot_cfg_only;
|
||||
|
||||
let (module, input_text) = match Path::new(&input_path)
|
||||
.extension()
|
||||
.ok_or(CliError("Input filename has no extension"))?
|
||||
@@ -519,13 +522,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
"dot" => {
|
||||
use naga::back::dot;
|
||||
|
||||
let output = dot::write(
|
||||
&module,
|
||||
info.as_ref(),
|
||||
naga::back::dot::Options {
|
||||
cfg_only: args.dot_cfg_only,
|
||||
},
|
||||
)?;
|
||||
let output = dot::write(&module, info.as_ref(), params.dot.clone())?;
|
||||
fs::write(output_path, output)?;
|
||||
}
|
||||
"hlsl" => {
|
||||
|
||||
@@ -18,7 +18,7 @@ use std::{
|
||||
};
|
||||
|
||||
/// Configuration options for the dot backend
|
||||
#[derive(Default)]
|
||||
#[derive(Clone, Default)]
|
||||
pub struct Options {
|
||||
/// Only emit function bodies
|
||||
pub cfg_only: bool,
|
||||
|
||||
Reference in New Issue
Block a user