From dfe88638f3dc105de1f4ee6cbc9da95bde65e787 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 30 Jan 2025 12:20:46 +0100 Subject: [PATCH] convert: Parse bitfield size in struct members Vulkan has always had a bunch of ``s which are bit fields with a defined size after a colon, C/C++ syntax. The conversion to `vkxml` never handled these, resulting in the parser to treat this final numeric token as the field name. In some ways that's desired, as `vkxml` does not have a field to represent bitfield sizes and the crate cannot be updated (we should really stop using it in `ash`...). Having a "broken" numeric in the field name like this at least communicates that this data cannot be trusted/used, and on the `ash` side we've always manually redefined structs with bitfields. --- vk-parse/src/convert.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vk-parse/src/convert.rs b/vk-parse/src/convert.rs index ed9fcd6..fe68e6a 100644 --- a/vk-parse/src/convert.rs +++ b/vk-parse/src/convert.rs @@ -852,6 +852,11 @@ fn parse_c_field<'a, I: Iterator>( "]" => { break; } + ":" => { + iter.next().unwrap(); + let _bitfield_size: usize = iter.peek().unwrap().parse().unwrap(); + dbg!(_bitfield_size); + } t => { if r.array.is_some() { let mut is_number = true;