% for enum in enums:
+ % if enum.guard:
+#ifdef ${enum.guard}
+ % endif
const char *
vk_${enum.name[2:]}_to_str(${enum.name} input)
{
unreachable("Undefined enum value.");
}
}
+
+ % if enum.guard:
+#endif
+ % endif
%endfor
void vk_load_instance_commands(VkInstance instance,
% endfor
% for enum in enums:
+ % if enum.guard:
+#ifdef ${enum.guard}
+ % endif
const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
+ % if enum.guard:
+#endif
+ % endif
% endfor
struct vk_instance_dispatch_table {
# Maps numbers to names
self.values = values or dict()
self.name_to_value = dict()
+ self.guard = None
def add_value(self, name, value=None,
extnum=None, offset=None,
offset=int(elem.attrib['offset']),
error=error)
+ def set_guard(self, g):
+ self.guard = g
+
class VkCommand(object):
"""Simple struct-like class representing a single Vulkan command"""
if enum is not None:
enum.add_value_from_xml(value, extension)
+ if define:
+ for value in ext_elem.findall('./require/type[@name]'):
+ enum = enum_factory.get(value.attrib['name'])
+ if enum is not None:
+ enum.set_guard(define)
+
for t in ext_elem.findall('./require/command'):
command = cmd_factory.get(t.attrib['name'])
if command is not None: