mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
snapshot tests: Always write IR when requested, even if validation fails.
This commit is contained in:
committed by
Dzmitry Malyshau
parent
36114d95b6
commit
4abf22c4d1
@@ -101,9 +101,6 @@ fn check_targets(module: &naga::Module, name: &str, targets: Targets) {
|
||||
} else {
|
||||
naga::valid::Capabilities::empty()
|
||||
};
|
||||
let info = naga::valid::Validator::new(naga::valid::ValidationFlags::all(), capabilities)
|
||||
.validate(module)
|
||||
.unwrap();
|
||||
|
||||
let dest = PathBuf::from(root).join(BASE_DIR_OUT);
|
||||
|
||||
@@ -114,6 +111,14 @@ fn check_targets(module: &naga::Module, name: &str, targets: Targets) {
|
||||
let string = ron::ser::to_string_pretty(module, config).unwrap();
|
||||
fs::write(dest.join(format!("ir/{}.ron", name)), string).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
let info = naga::valid::Validator::new(naga::valid::ValidationFlags::all(), capabilities)
|
||||
.validate(module)
|
||||
.unwrap();
|
||||
|
||||
#[cfg(feature = "serialize")]
|
||||
{
|
||||
if targets.contains(Targets::ANALYSIS) {
|
||||
let config = ron::ser::PrettyConfig::default().with_new_line("\n".to_string());
|
||||
let string = ron::ser::to_string_pretty(&info, config).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user