Signed-off-by: Georg Lehmann dadschoorse@gmail.com --- dlls/winevulkan/make_vulkan | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 9ef863837d1..87ac7d93823 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1086,7 +1086,7 @@ class VkHandle(object):
class VkMember(object): def __init__(self, const=False, struct_fwd_decl=False,_type=None, pointer=None, name=None, array_len=None, - dyn_array_len=None, optional=False, values=None): + dyn_array_len=None, optional=False, values=None, bit_width=None): self.const = const self.struct_fwd_decl = struct_fwd_decl self.name = name @@ -1097,6 +1097,7 @@ class VkMember(object): self.dyn_array_len = dyn_array_len self.optional = optional self.values = values + self.bit_width = bit_width
def __eq__(self, other): """ Compare member based on name against a string. @@ -1123,6 +1124,7 @@ class VkMember(object): member_type = None pointer = None array_len = None + bit_width = None
values = member.get("values")
@@ -1166,8 +1168,14 @@ class VkMember(object): # Remove brackets around length array_len = name_elem.tail.strip("[]")
+ # Some members are bit field values: + # <member><type>uint32_t</type> <name>mask</name>:8</member> + if name_elem.tail and name_elem.tail[0] == ':': + LOGGER.debug("Found bit field") + bit_width = int(name_elem.tail[1:]) + return VkMember(const=const, struct_fwd_decl=struct_fwd_decl, _type=member_type, pointer=pointer, name=name_elem.text, - array_len=array_len, dyn_array_len=dyn_array_len, optional=optional, values=values) + array_len=array_len, dyn_array_len=dyn_array_len, optional=optional, values=values, bit_width=bit_width)
def copy(self, input, output, direction, conv): """ Helper method for use by conversion logic to generate a C-code statement to copy this member. @@ -1267,6 +1275,9 @@ class VkMember(object): if self.is_static_array(): text += "[{0}]".format(self.array_len)
+ if self.is_bit_field(): + text += ":{}".format(self.bit_width) + return text
def get_conversions(self): @@ -1337,6 +1348,9 @@ class VkMember(object): def is_union(self): return self.type_info["category"] == "union"
+ def is_bit_field(self): + return self.bit_width is not None + def needs_alignment(self): """ Check if this member needs alignment for 64-bit data. Various structures need alignment on 64-bit variables due