Skip to content

Commit

Permalink
generator: Print vk-parse errors when they're encountered (#930)
Browse files Browse the repository at this point in the history
Some upstream `vk.xml` changes are causing failures on missing registry
children later on in our generator code.  These are complicated to
debug, unless we print the errors that `vk-parse` already reports.  In
this debug case it was clarifying that some new and unknown elements
upstream are the reason for high-level registry elements to not be
parsable.
  • Loading branch information
MarijnS95 authored Aug 20, 2024
1 parent 0b3a134 commit a00c45e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,11 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
let vk_xml = vk_headers_dir.join("registry/vk.xml");
use std::fs::File;
use std::io::Write;
let (spec2, _errors) = vk_parse::parse_file(&vk_xml).expect("Invalid xml file");
let (spec2, errors) = vk_parse::parse_file(&vk_xml).expect("Invalid xml file");
assert!(
errors.is_empty(),
"vk_parse encountered one or more errors while parsing: {errors:?}"
);
let extensions: Vec<&vk_parse::Extension> = spec2
.0
.iter()
Expand Down

0 comments on commit a00c45e

Please sign in to comment.