# This complicates TRACEs in the thunks, so just use uint64_t.
if name == "VK_DEFINE_NON_DISPATCHABLE_HANDLE":
value = "#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;"
+ elif name == "VK_NULL_HANDLE": # Also VK_NULL_HANDLE type needs to match.
+ value = "#define VK_NULL_HANDLE UINT64_C(0)"
else:
value = define.text
return VkDefine(name, value)
if self.needs_conversion():
if self.is_dynamic_array():
if direction == Direction.OUTPUT:
- LOGGER.warn("TODO: implement copying of returnedonly dynamic array for {0}.{1}".format(self.type, self.name))
+ LOGGER.warning("TODO: implement copying of returnedonly dynamic array for {0}.{1}".format(self.type, self.name))
else:
# Array length is either a variable name (string) or an int.
count = self.dyn_array_len if isinstance(self.dyn_array_len, int) else "{0}{1}".format(input, self.dyn_array_len)
return "convert_{0}_static_array_host_to_win({2}{1}, {3}{1}, {4});\n".format(self.type, self.name, input, output, count)
else:
# Nothing needed this yet.
- LOGGER.warn("TODO: implement copying of static array for {0}.{1}".format(self.type, self.name))
+ LOGGER.warning("TODO: implement copying of static array for {0}.{1}".format(self.type, self.name))
else:
if direction == Direction.OUTPUT:
return "convert_{0}_host_to_win(&{2}{1}, &{3}{1});\n".format(self.type, self.name, input, output)
# Since we have parsed all types before hand, this should not happen.
type_info = types.get(type_elem.text, None)
if type_info is None:
- LOGGER.err("type info not found for: {0}".format(type_elem.text))
+ LOGGER.error("type info not found for: {0}".format(type_elem.text))
return VkParam(type_info, const=const, pointer=pointer, name=name, array_len=array_len, dyn_array_len=dyn_array_len)
if self.is_static_array() or self.is_pointer():
self.format_str = "%p"
else:
- if self.type_info["category"] in ["bitmask", "enum"]:
+ if self.type == "VkPipelineStageFlags2" or self.type == "VkPipelineStageFlags2KHR":
+ self.format_str = "0x%s"
+ self.format_conv = "wine_dbgstr_longlong({0})"
+ elif self.type_info["category"] in ["bitmask", "enum"]:
self.format_str = "%#x"
elif self.is_handle():
# We use uint64_t for non-dispatchable handles as opposed to pointers
# Don't care about Linux specific types.
self.format_str = ""
else:
- LOGGER.warn("Unhandled type: {0}".format(self.type_info))
+ LOGGER.warning("Unhandled type: {0}".format(self.type_info))
def copy(self, direction):
if direction == Direction.INPUT:
def _generate_copyright(self, f, spec_file=False):
f.write("# " if spec_file else "/* ")
- f.write("Automatically generated from Vulkan vk.xml; DO NOT EDIT!\n")
+ f.write("Automatically generated from ")
+ f.write(self.registry._filename)
+ f.write("; DO NOT EDIT!\n")
lines = ["", "This file is generated from Vulkan vk.xml file covered",
"by the following copyright and permission notice:"]
lines.extend([l.rstrip(" ") for l in self.registry.copyright.splitlines()])
self.funcpointers = None
self.handles = None
self.structs = None
+ self._filename = reg_filename
# We aggregate all types in here for cross-referencing.
self.funcs = {}
path = os.path.dirname(path)
os.chdir(path)
-def download_vk_xml(filename):
- url = "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/v{0}/xml/vk.xml".format(VK_XML_VERSION)
- if not os.path.isfile(filename):
- urllib.request.urlretrieve(url, filename)
-
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbose", action="count", default=0, help="increase output verbosity")
vk_xml = args.xml
else:
vk_xml = "vk-{0}.xml".format(VK_XML_VERSION)
- download_vk_xml(vk_xml)
registry = VkRegistry(vk_xml)
generator = VkGenerator(registry)