Commit fb8ab5e9 authored by Derek Lesho's avatar Derek Lesho Committed by Alexandre Julliard

winevulkan: Add support for unwrapping handles in thunks.

parent 45a48b5a
......@@ -204,14 +204,14 @@ FUNCTION_OVERRIDES = {
# VK_KHR_get_surface_capabilities2
"vkGetPhysicalDeviceSurfaceCapabilities2KHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PRIVATE},
"vkGetPhysicalDeviceSurfaceFormats2KHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PRIVATE},
"vkGetPhysicalDeviceSurfaceFormats2KHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
# VK_KHR_win32_surface
"vkCreateWin32SurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.NONE},
"vkGetPhysicalDeviceWin32PresentationSupportKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
# VK_KHR_swapchain
"vkCreateSwapchainKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PRIVATE},
"vkCreateSwapchainKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
"vkDestroySwapchainKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
"vkGetSwapchainImagesKHR": {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
"vkQueuePresentKHR": {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
......@@ -645,6 +645,18 @@ class VkFunction(object):
return False
def needs_unwrapping(self):
""" Check if the function needs any input/output type unwrapping.
Functions need input/output unwrapping if struct parameters have
wrapped handles.
"""
for p in self.params:
if p.needs_unwrapping():
return True
return False
def needs_dispatch(self):
return self.dispatch
......@@ -739,7 +751,7 @@ class VkFunction(object):
return body
def body_conversion(self):
def body_conversion(self, conv):
body = ""
# Declare a variable to hold the result for non-void functions.
......@@ -748,27 +760,28 @@ class VkFunction(object):
# Declare any tmp parameters for conversion.
for p in self.params:
if not p.needs_conversion():
continue
if p.is_dynamic_array():
body += " {0}_host *{1}_host;\n".format(p.type, p.name)
else:
body += " {0}_host {1}_host;\n".format(p.type, p.name)
if p.needs_conversion() and conv:
if p.is_dynamic_array():
body += " {0}_host *{1}_host;\n".format(p.type, p.name)
else:
body += " {0}_host {1}_host;\n".format(p.type, p.name)
elif p.needs_unwrapping():
if p.is_dynamic_array():
body += " {0} *{1}_host;\n".format(p.type, p.name)
else:
body += " {0} {1}_host;\n".format(p.type, p.name)
if not self.needs_private_thunk():
body += " {0}\n".format(self.trace())
# Call any win_to_host conversion calls.
for p in self.params:
if not p.needs_input_conversion():
continue
body += p.copy(Direction.INPUT)
if p.needs_input_conversion() and (p.needs_unwrapping() or conv):
body += p.copy(Direction.INPUT)
# Build list of parameters containing converted and non-converted parameters.
# The param itself knows if conversion is needed and applies it when we set conv=True.
params = ", ".join([p.variable(conv=True) for p in self.params])
params = ", ".join([p.variable(conv=conv) for p in self.params])
# Call the native Vulkan function.
if self.type == "void":
......@@ -787,10 +800,8 @@ class VkFunction(object):
# Perform any required cleanups. Most of these are for array functions.
for p in self.params:
if not p.needs_free():
continue
body += p.free()
if p.needs_free() and (p.needs_unwrapping() or conv):
body += p.free()
# Finally return the result.
if self.type != "void":
......@@ -840,10 +851,15 @@ class VkFunction(object):
if self.needs_conversion():
thunk += "#if defined(USE_STRUCT_CONVERSION)\n"
thunk += self.body_conversion()
thunk += self.body_conversion(conv=True)
thunk += "#else\n"
thunk += self.body()
if self.needs_unwrapping():
thunk += self.body_conversion(conv=False)
else:
thunk += self.body()
thunk += "#endif\n"
elif self.needs_unwrapping():
thunk += self.body_conversion(conv=False)
else:
thunk += self.body()
......@@ -1063,6 +1079,12 @@ class VkHandle(object):
def is_wrapped(self):
return self.native_handle("test") is not None
def needs_conversion(self):
return False
def needs_unwrapping(self):
return self.is_wrapped()
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):
......@@ -1148,10 +1170,11 @@ class VkMember(object):
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)
def copy(self, input, output, direction):
""" Helper method for use by conversion logic to generate a C-code statement to copy this member. """
def copy(self, input, output, direction, conv):
""" Helper method for use by conversion logic to generate a C-code statement to copy this member.
- `conv` indicates whether the statement is in a struct alignment conversion path. """
if self.needs_conversion():
if (conv and self.needs_conversion()) or self.needs_unwrapping():
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))
......@@ -1167,6 +1190,12 @@ class VkMember(object):
else:
# Nothing needed this yet.
LOGGER.warn("TODO: implement copying of static array for {0}.{1}".format(self.type, self.name))
elif self.is_handle() and self.needs_unwrapping():
if direction == Direction.OUTPUT:
LOGGER.err("OUTPUT parameter {0}.{1} cannot be unwrapped".format(self.type, self.name))
else:
handle = self.type_info["data"]
return "{0}{1} = {2};\n".format(output, self.name, handle.driver_handle("{0}{1}".format(input, 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)
......@@ -1178,6 +1207,36 @@ class VkMember(object):
else:
return "{0}{1} = {2}{1};\n".format(output, self.name, input)
def free(self, location, conv):
""" Helper method for use by conversion logic to generate a C-code statement to free this member. """
if not self.needs_unwrapping() and not conv:
return ""
# Add a cast to ignore const on conversion structs we allocated ourselves.
# sample expected output: (VkSparseMemoryBind_host *)
if self.is_const():
cast = "(" + self.type
if self.needs_conversion() and conv:
cast += "_host"
cast += " *)"
else:
cast = ""
if self.is_dynamic_array():
count = self.dyn_array_len if isinstance(self.dyn_array_len, int) else "{0}{1}".format(location, self.dyn_array_len)
if self.is_struct() and self.type_info["data"].returnedonly:
# For returnedonly, counts is stored in a pointer.
return "free_{0}_array({1}{2}{3}, *{4});\n".format(self.type, cast, location, self.name, count)
else:
return "free_{0}_array({1}{2}{3}, {4});\n".format(self.type, cast, location, self.name, count)
else:
# We are operating on a single structure. Some structs (very rare) contain dynamic members,
# which would need freeing.
if self.needs_free():
return "free_{0}({1}&{2}{3});\n".format(self.type, cast, location, self.name)
return ""
def definition(self, align=False, conv=False):
""" Generate prototype for given function.
......@@ -1216,31 +1275,34 @@ class VkMember(object):
# Check if we need conversion either for this member itself or for any child members
# in case member represents a struct.
if not self.needs_conversion():
if not self.needs_conversion() and not self.needs_unwrapping():
return None
conversions = []
# Collect any conversion for any member structs.
struct = self.type_info["data"]
for m in struct:
m.needs_struct_extensions_conversion()
if m.needs_conversion():
conversions.extend(m.get_conversions())
if self.is_struct():
struct = self.type_info["data"]
for m in struct:
m.needs_struct_extensions_conversion()
if m.needs_conversion() or m.needs_unwrapping():
conversions.extend(m.get_conversions())
struct.needs_struct_extensions_conversion()
struct.needs_struct_extensions_conversion()
direction = Direction.OUTPUT if struct.returnedonly else Direction.INPUT
elif self.is_handle():
direction = Direction.INPUT
struct = self.type_info["data"]
direction = Direction.OUTPUT if struct.returnedonly else Direction.INPUT
operand = self.type_info["data"]
if self.is_dynamic_array():
conversions.append(ConversionFunction(False, True, direction, struct))
conversions.append(ConversionFunction(False, True, direction, operand))
elif self.is_static_array():
conversions.append(ConversionFunction(True, False, direction, struct))
conversions.append(ConversionFunction(True, False, direction, operand))
else:
conversions.append(ConversionFunction(False, False, direction, struct))
conversions.append(ConversionFunction(False, False, direction, operand))
if self.needs_free():
conversions.append(FreeFunction(self.is_dynamic_array(), struct))
conversions.append(FreeFunction(self.is_dynamic_array(), operand))
return conversions
......@@ -1307,8 +1369,21 @@ class VkMember(object):
struct = self.type_info["data"]
return struct.needs_conversion()
def needs_unwrapping(self):
""" Structures with wrapped handles need unwrapping. """
if self.is_struct():
struct = self.type_info["data"]
return struct.needs_unwrapping()
if self.is_handle():
handle = self.type_info["data"]
return handle.is_wrapped()
return False
def needs_free(self):
if not self.needs_conversion():
if not self.needs_conversion() and not self.needs_unwrapping():
return False
if self.is_dynamic_array():
......@@ -1392,21 +1467,23 @@ class VkParam(object):
self.free_func = None
self.input_conv = None
self.output_conv = None
if not self.needs_conversion():
if not self.needs_conversion() and not self.needs_unwrapping():
return
operand = self.struct if self.is_struct() else self.handle
# Input functions require win to host conversion.
if self._direction in [Direction.INPUT, Direction.INPUT_OUTPUT]:
self.input_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.INPUT, self.struct)
self.input_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.INPUT, operand)
# Output functions require host to win conversion.
if self._direction in [Direction.INPUT_OUTPUT, Direction.OUTPUT]:
self.output_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.OUTPUT, self.struct)
self.output_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.OUTPUT, operand)
# Dynamic arrays, but also some normal structs (e.g. VkCommandBufferBeginInfo) need memory
# allocation and thus some cleanup.
if self.is_dynamic_array() or self.struct.needs_free():
self.free_func = FreeFunction(self.is_dynamic_array(), self.struct)
self.free_func = FreeFunction(self.is_dynamic_array(), operand)
def _set_direction(self):
""" Internal helper function to set parameter direction (input/output/input_output). """
......@@ -1544,7 +1621,7 @@ class VkParam(object):
def free(self):
if self.is_dynamic_array():
if self.struct.returnedonly:
if self.is_struct() and self.struct.returnedonly:
# For returnedonly, counts is stored in a pointer.
return " free_{0}_array({1}_host, *{2});\n".format(self.type, self.name, self.dyn_array_len)
else:
......@@ -1552,7 +1629,7 @@ class VkParam(object):
else:
# We are operating on a single structure. Some structs (very rare) contain dynamic members,
# which would need freeing.
if self.struct.needs_free():
if self.is_struct() and self.struct.needs_free():
return " free_{0}(&{1}_host);\n".format(self.type, self.name)
return ""
......@@ -1563,14 +1640,14 @@ class VkParam(object):
required.
"""
if not self.is_struct():
if self.is_struct():
self.struct.needs_struct_extensions_conversion()
for m in self.struct:
m.needs_struct_extensions_conversion()
elif not self.is_handle():
return None
self.struct.needs_struct_extensions_conversion()
for m in self.struct:
m.needs_struct_extensions_conversion()
if not self.needs_conversion():
if not self.needs_conversion() and not self.needs_unwrapping():
return None
conversions = []
......@@ -1578,14 +1655,15 @@ class VkParam(object):
# Collect any member conversions first, so we can guarantee
# those functions will be defined prior to usage by the
# 'parent' param requiring conversion.
for m in self.struct:
if not m.is_struct():
continue
if self.is_struct():
for m in self.struct:
if not m.is_struct():
continue
if not m.needs_conversion():
continue
if not m.needs_conversion() and not m.needs_unwrapping():
continue
conversions.extend(m.get_conversions())
conversions.extend(m.get_conversions())
# Conversion requirements for the 'parent' parameter.
if self.input_conv is not None:
......@@ -1641,6 +1719,18 @@ class VkParam(object):
return False
def needs_unwrapping(self):
""" Returns if parameter needs unwrapping of handle. """
# Wrapped handle parameters are handled seperately, only look for wrapped handles in structs
if self.is_struct():
return self.struct.needs_unwrapping()
if self.is_handle() and self.is_dynamic_array():
return self.handle.needs_unwrapping()
return False
def needs_free(self):
return self.free_func is not None
......@@ -1691,7 +1781,7 @@ class VkParam(object):
LOGGER.debug("TODO: setting NULL VkAllocationCallbacks for {0}".format(self.name))
return "NULL"
if conv and self.needs_conversion():
if self.needs_unwrapping() or (conv and self.needs_conversion()):
if self.is_dynamic_array():
return "{0}_host".format(self.name)
else:
......@@ -1880,6 +1970,14 @@ class VkStruct(Sequence):
return True
return False
def needs_unwrapping(self):
""" Returns if struct members need unwrapping of handle. """
for m in self.members:
if m.needs_unwrapping():
return True
return False
def needs_free(self):
""" Check if any struct member needs some memory freeing."""
......@@ -1897,7 +1995,10 @@ class VkStruct(Sequence):
for e in self.struct_extensions:
if e.required and e.needs_conversion():
LOGGER.error("Unhandled pNext chain conversion for {0}".format(e.name))
LOGGER.error("Unhandled pNext chain alignment conversion for {0}".format(e.name))
ret = True
if e.required and e.needs_unwrapping():
LOGGER.error("Unhandled pNext chain unwrapping conversion for {0}".format(e.name))
ret = True
return ret
......@@ -1913,12 +2014,12 @@ class VkStruct(Sequence):
class ConversionFunction(object):
def __init__(self, array, dyn_array, direction, struct):
def __init__(self, array, dyn_array, direction, operand):
self.array = array
self.direction = direction
self.dyn_array = dyn_array
self.struct = struct
self.type = struct.name
self.operand = operand
self.type = operand.name
self._set_name()
......@@ -1926,21 +2027,44 @@ class ConversionFunction(object):
return self.name == other.name
def _generate_array_conversion_func(self):
""" Helper function for generating a conversion function for array structs. """
""" Helper function for generating a conversion function for array operands. """
body = ""
if self.operand.needs_conversion():
body += "#if defined(USE_STRUCT_CONVERSION)\n"
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "uint32_t count"]
return_type = self.type
else:
params = ["const {0} *in".format(self.type), "uint32_t count"]
return_type = "{0}_host".format(self.type)
# Generate function prototype.
body += "static inline {0} *{1}(".format(return_type, self.name)
body += ", ".join(p for p in params)
body += ")\n{\n"
body += " {0} *out;\n".format(return_type)
if self.operand.needs_unwrapping():
if self.operand.needs_conversion():
body += "#else\n"
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "uint32_t count"]
return_type = self.type
else:
params = ["const {0} *in".format(self.type), "uint32_t count"]
return_type = "{0}_host".format(self.type)
return_type = "{0}".format(self.type)
# Generate function prototype.
body = "static inline {0} *{1}(".format(return_type, self.name)
body += ", ".join(p for p in params)
body += ")\n{\n"
# Generate function prototype.
body += "static inline {0} *{1}(".format(return_type, self.name)
body += ", ".join(p for p in params)
body += ")\n{\n"
body += " {0} *out;\n".format(return_type)
if self.operand.needs_conversion():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += " {0} *out;\n".format(return_type)
body += " unsigned int i;\n\n"
body += " if (!in) return NULL;\n\n"
......@@ -1949,33 +2073,82 @@ class ConversionFunction(object):
body += " for (i = 0; i < count; i++)\n"
body += " {\n"
for m in self.struct:
# TODO: support copying of pNext extension structures!
# Luckily though no extension struct at this point needs conversion.
body += " " + m.copy("in[i].", "out[i].", self.direction)
if isinstance(self.operand, VkStruct):
for m in self.operand:
# TODO: support copying of pNext extension structures!
# Luckily though no extension struct at this point needs conversion.
convert = m.copy("in[i].", "out[i].", self.direction, conv=True)
if self.operand.needs_conversion() and not self.operand.needs_unwrapping():
body += " " + convert
else:
unwrap = m.copy("in[i].", "out[i].", self.direction, conv=False)
if unwrap == convert:
body += " " + unwrap
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
elif isinstance(self.operand, VkHandle) and self.direction == Direction.INPUT:
body += " out[i] = " + self.operand.driver_handle("in[i]") + ";\n"
else:
LOGGER.warn("Unhandled conversion operand type")
body += " out[i] = in[i];\n"
body += " }\n\n"
body += " return out;\n"
body += "}\n\n"
body += "}\n"
if not self.operand.needs_unwrapping():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "\n"
return body
def _generate_conversion_func(self):
""" Helper function for generating a conversion function for non-array structs. """
""" Helper function for generating a conversion function for non-array operands. """
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "{0} *out".format(self.type)]
else:
params = ["const {0} *in".format(self.type), "{0}_host *out".format(self.type)]
# It doesn't make sense to generate conversion functions for non-struct variables
# which aren't in arrays, as this should be handled by the copy() function
if not isinstance(self.operand, VkStruct):
return ""
body = "static inline void {0}(".format(self.name)
body = ""
# Generate parameter list
body += ", ".join(p for p in params)
body += ")\n{\n"
if self.operand.needs_conversion():
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += "static inline void {0}(".format(self.name)
body += " if (!in) return;\n\n"
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "{0} *out".format(self.type)]
else:
params = ["const {0} *in".format(self.type), "{0}_host *out".format(self.type)]
# Generate parameter list
body += ", ".join(p for p in params)
body += ")\n"
if self.operand.needs_unwrapping():
if self.operand.needs_conversion():
body += "#else\n"
body += "static inline void {0}(".format(self.name)
if self.direction == Direction.INPUT and "pNext" in self.struct and self.struct.returnedonly:
params = ["const {0} *in".format(self.type), "{0} *out".format(self.type)]
# Generate parameter list
body += ", ".join(p for p in params)
body += ")\n"
if self.operand.needs_conversion():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "{\n if (!in) return;\n\n"
if self.direction == Direction.INPUT and "pNext" in self.operand and self.operand.returnedonly:
# We are dealing with an input_output parameter. For these we only need to copy
# pNext and sType as the other fields are filled in by the host. We do potentially
# have to iterate over pNext and perform conversions based on switch(sType)!
......@@ -1984,36 +2157,96 @@ class ConversionFunction(object):
body += " out->pNext = in->pNext;\n"
body += " out->sType = in->sType;\n"
else:
for m in self.struct:
for m in self.operand:
# TODO: support copying of pNext extension structures!
body += " " + m.copy("in->", "out->", self.direction)
convert = m.copy("in->", "out->", self.direction, conv=True)
if self.operand.needs_conversion() and not self.operand.needs_unwrapping():
body += " " + convert
else:
unwrap = m.copy("in->", "out->", self.direction, conv=False)
if unwrap == convert:
body += " " + unwrap
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "}\n"
if not self.operand.needs_unwrapping():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "\n"
body += "}\n\n"
return body
def _generate_static_array_conversion_func(self):
""" Helper function for generating a conversion function for array structs. """
""" Helper function for generating a conversion function for array operands. """
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "{0} *out".format(self.type), "uint32_t count"]
else:
params = ["const {0} *in".format(self.type), "{0} *out_host".format(self.type), "uint32_t count"]
body = ""
if self.operand.needs_conversion():
body += "#if defined(USE_STRUCT_CONVERSION)\n"
if self.direction == Direction.OUTPUT:
params = ["const {0}_host *in".format(self.type), "{0} *out".format(self.type), "uint32_t count"]
else:
params = ["const {0} *in".format(self.type), "{0} *out_host".format(self.type), "uint32_t count"]
# Generate function prototype.
body = "static inline void {0}(".format(self.name)
body += ", ".join(p for p in params)
body += ")\n{\n"
# Generate function prototype.
body += "static inline void {0}(".format(self.name)
body += ", ".join(p for p in params)
body += ")\n"
if self.operand.needs_unwrapping():
if self.operand.needs_conversion():
body += "#else\n"
params = ["const {0} *in".format(self.type), "{0} *out".format(self.type), "uint32_t count"]
# Generate function prototype.
body += "static inline void {0}(".format(self.name)
body += ", ".join(p for p in params)
body += ")\n"
body += "{\n"
body += " unsigned int i;\n\n"
body += " if (!in) return;\n\n"
body += " for (i = 0; i < count; i++)\n"
body += " {\n"
for m in self.struct:
# TODO: support copying of pNext extension structures!
body += " " + m.copy("in[i].", "out[i].", self.direction)
if isinstance(self.operand, VkStruct):
for m in self.operand:
# TODO: support copying of pNext extension structures!
convert = m.copy("in[i].", "out[i].", self.direction, conv=True)
if self.operand.needs_conversion() and not self.operand.needs_unwrapping():
body += " " + convert
else:
unwrap = m.copy("in[i].", "out[i].", self.direction, conv=False)
if unwrap == convert:
body += " " + unwrap
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
elif isinstance(self.operand, VkHandle) and self.direction == Direction.INPUT:
body += " out[i] = " + self.operand.driver_handle("in[i]") + ";\n"
else:
LOGGER.warn("Unhandled conversion operand type")
body += " out[i] = in[i];\n"
body += " }\n"
body += "}\n\n"
body += "}\n"
if not self.operand.needs_unwrapping():
body += "#endif /* USE_STRUCT_CONVERSION) */\n"
body += "\n"
return body
def _set_name(self):
......@@ -2044,10 +2277,10 @@ class ConversionFunction(object):
class FreeFunction(object):
def __init__(self, dyn_array, struct):
def __init__(self, dyn_array, operand):
self.dyn_array = dyn_array
self.struct = struct
self.type = struct.name
self.operand = operand
self.type = operand.name
if dyn_array:
self.name = "free_{0}_array".format(self.type)
......@@ -2060,52 +2293,120 @@ class FreeFunction(object):
def _generate_array_free_func(self):
""" Helper function for cleaning up temporary buffers required for array conversions. """
# Generate function prototype.
body = "static inline void {0}({1}_host *in, uint32_t count)\n{{\n".format(self.name, self.type)
body = ""
if self.operand.needs_conversion():
body += "#if defined(USE_STRUCT_CONVERSION)\n"
# Generate function prototype.
body += "static inline void {0}({1}_host *in, uint32_t count)\n".format(self.name, self.type)
if self.operand.needs_unwrapping():
if self.operand.needs_conversion():
body += "#else\n"
# Generate function prototype.
body += "static inline void {0}({1} *in, uint32_t count)\n".format(self.name, self.type)
if self.operand.needs_conversion():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "{\n"
# E.g. VkGraphicsPipelineCreateInfo_host needs freeing for pStages.
if self.struct.needs_free():
if isinstance(self.operand, VkStruct) and self.operand.needs_free():
body += " unsigned int i;\n\n"
body += " if (!in) return;\n\n"
body += " for (i = 0; i < count; i++)\n"
body += " {\n"
for m in self.struct:
if m.needs_conversion() and m.is_dynamic_array():
if m.is_const():
# Add a cast to ignore const on conversion structs we allocated ourselves.
body += " free_{0}_array(({0}_host *)in[i].{1}, in[i].{2});\n".format(m.type, m.name, m.dyn_array_len)
for m in self.operand:
if m.needs_free():
convert = m.free("in[i].", conv=True)
if self.operand.needs_conversion() and not self.operand.needs_unwrapping():
body += " " + convert
else:
body += " free_{0}_array(in[i].{1}, in[i].{2});\n".format(m.type, m.name, m.dyn_array_len)
elif m.needs_conversion():
LOGGER.error("Unhandled conversion for {0}".format(m.name))
unwrap = m.free("in[i].", conv=False)
if convert == unwrap:
body += " " + unwrap
elif unwrap == "":
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#endif /* USE_STRUCT_CONVERSION */\n"
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += " }\n"
else:
body += " if (!in) return;\n\n"
body += " free(in);\n"
body += "}\n\n"
body += "}\n"
if not self.operand.needs_unwrapping():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "\n"
return body
def _generate_free_func(self):
# E.g. VkCommandBufferBeginInfo.pInheritanceInfo needs freeing.
if not self.struct.needs_free():
if not self.operand.needs_free():
return ""
# Generate function prototype.
body = "static inline void {0}({1}_host *in)\n{{\n".format(self.name, self.type)
if not isinstance(self.operand, VkStruct):
return ""
for m in self.struct:
if m.needs_conversion() and m.is_dynamic_array():
count = m.dyn_array_len if isinstance(m.dyn_array_len, int) else "in->{0}".format(m.dyn_array_len)
if m.is_const():
# Add a cast to ignore const on conversion structs we allocated ourselves.
body += " free_{0}_array(({0}_host *)in->{1}, {2});\n".format(m.type, m.name, count)
body = ""
if self.operand.needs_conversion():
body += "#if defined(USE_STRUCT_CONVERSION)\n"
# Generate function prototype.
body += "static inline void {0}({1}_host *in)\n".format(self.name, self.type)
if self.operand.needs_unwrapping():
if self.operand.needs_conversion():
body += "#else\n"
# Generate function prototype.
body += "static inline void {0}({1} *in)\n".format(self.name, self.type)
if self.operand.needs_conversion():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "{\n"
for m in self.operand:
if m.needs_free():
convert = m.free("in->", conv=True)
if self.operand.needs_conversion() and not self.operand.needs_unwrapping():
body += " " + convert
else:
body += " free_{0}_array(in->{1}, {2});\n".format(m.type, m.name, count)
unwrap = m.free("in->", conv=False)
if convert == unwrap:
body += " " + unwrap
elif unwrap == "":
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#endif /* USE_STRUCT_CONVERSION */\n"
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "}\n"
if not self.operand.needs_unwrapping():
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "\n"
body += "}\n\n"
return body
def definition(self):
......@@ -2168,7 +2469,16 @@ class StructChainConversionFunction(object):
if m.name == "pNext":
body += " out->pNext = NULL;\n"
else:
body += " " + m.copy("in->", "out->", self.direction)
convert = m.copy("in->", "out->", self.direction, conv=True)
unwrap = m.copy("in->", "out->", self.direction, conv=False)
if unwrap == convert:
body += " " + unwrap
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += "\n out_header->pNext = (VkBaseOutStructure *)out;\n"
body += " out_header = out_header->pNext;\n"
......@@ -2212,7 +2522,47 @@ class FreeStructChainFunction(object):
body += " while (header)\n"
body += " {\n"
body += " void *prev = header;\n"
body += " void *prev = header;\n\n"
body += " switch (header->sType)\n"
body += " {\n"
for e in self.struct.struct_extensions:
if not e.required:
continue
if not any(m.needs_free() for m in e):
continue
stype = next(x for x in e.members if x.name == "sType")
body += " case {0}:\n".format(stype.values)
body += " {\n"
body += " {0} *structure = ({0} *) header;\n".format(e.name)
for m in e:
if m.needs_free():
convert = m.free("structure->", conv=True)
unwrap = m.free("structure->", conv=False)
if convert == unwrap:
body += " " + unwrap
elif unwrap == "":
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#endif /* USE_STRUCT_CONVERSION */\n"
else:
body += "#if defined(USE_STRUCT_CONVERSION)\n"
body += " " + convert
body += "#else\n"
body += " " + unwrap
body += "#endif /* USE_STRUCT_CONVERSION */\n"
body += " break;\n"
body += " }\n"
body += " default:\n"
body += " break;\n"
body += " }\n"
body += " header = header->pNext;\n"
body += " free(prev);\n"
body += " }\n\n"
......@@ -2235,7 +2585,7 @@ class VkGenerator(object):
if not func.is_required():
continue
if not func.needs_conversion():
if not func.needs_conversion() and not func.needs_unwrapping():
continue
conversions = func.get_conversions()
......@@ -2246,15 +2596,26 @@ class VkGenerator(object):
if not any(c == conv for c in self.conversions):
self.conversions.append(conv)
if not isinstance(conv.operand, VkStruct):
continue
# Structs can be used in different ways by different conversions
# e.g. array vs non-array. Just make sure we pull in each struct once.
if not any(s.name == conv.struct.name for s in self.host_structs):
self.host_structs.append(conv.struct)
if not any(s.name == conv.operand.name for s in self.host_structs):
self.host_structs.append(conv.operand)
for struct in self.registry.structs:
if struct.name in STRUCT_CHAIN_CONVERSIONS:
self.struct_chain_conversions.append(StructChainConversionFunction(Direction.INPUT, struct))
self.struct_chain_conversions.append(FreeStructChainFunction(struct))
# Once we decide to support pNext chains conversion everywhere, move this under get_conversions
for e in struct.struct_extensions:
for m in e:
if m.needs_conversion() or m.needs_unwrapping():
conversions = m.get_conversions()
for conv in conversions:
if not any(c == conv for c in self.conversions):
self.conversions.append(conv)
def _generate_copyright(self, f, spec_file=False):
f.write("# " if spec_file else "/* ")
......@@ -2281,10 +2642,8 @@ class VkGenerator(object):
f.write("WINE_DEFAULT_DEBUG_CHANNEL(vulkan);\n\n")
# Generate any conversion helper functions.
f.write("#if defined(USE_STRUCT_CONVERSION)\n")
for conv in self.conversions:
f.write(conv.definition())
f.write("#endif /* USE_STRUCT_CONVERSION */\n\n")
for conv in self.struct_chain_conversions:
f.write(conv.definition())
......
......@@ -360,20 +360,12 @@ static void wine_vk_device_get_queues(struct VkDevice_T *device,
static void wine_vk_device_free_create_info(VkDeviceCreateInfo *create_info)
{
VkDeviceGroupDeviceCreateInfo *group_info;
if ((group_info = wine_vk_find_struct(create_info, DEVICE_GROUP_DEVICE_CREATE_INFO)))
{
free((void *)group_info->pPhysicalDevices);
}
free_VkDeviceCreateInfo_struct_chain(create_info);
}
static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src,
VkDeviceCreateInfo *dst)
{
VkDeviceGroupDeviceCreateInfo *group_info;
unsigned int i;
VkResult res;
......@@ -385,23 +377,6 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
return res;
}
/* FIXME: convert_VkDeviceCreateInfo_struct_chain() should unwrap handles for us. */
if ((group_info = wine_vk_find_struct(dst, DEVICE_GROUP_DEVICE_CREATE_INFO)))
{
VkPhysicalDevice *physical_devices;
if (!(physical_devices = calloc(group_info->physicalDeviceCount, sizeof(*physical_devices))))
{
free_VkDeviceCreateInfo_struct_chain(dst);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
for (i = 0; i < group_info->physicalDeviceCount; ++i)
{
physical_devices[i] = group_info->pPhysicalDevices[i]->phys_dev;
}
group_info->pPhysicalDevices = physical_devices;
}
/* Should be filtered out by loader as ICDs don't support layers. */
dst->enabledLayerCount = 0;
dst->ppEnabledLayerNames = NULL;
......@@ -1540,19 +1515,6 @@ void WINAPI wine_vkGetPrivateDataEXT(VkDevice device, VkObjectType object_type,
device->funcs.p_vkGetPrivateDataEXT(device->device, object_type, object_handle, private_data_slot, data);
}
VkResult WINAPI wine_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *create_info,
const VkAllocationCallbacks *allocator, VkSwapchainKHR *swapchain)
{
VkSwapchainCreateInfoKHR native_info;
TRACE("%p, %p, %p, %p\n", device, create_info, allocator, swapchain);
native_info = *create_info;
native_info.surface = wine_surface_from_handle(create_info->surface)->driver_surface;
return thunk_vkCreateSwapchainKHR(device, &native_info, allocator, swapchain);
}
VkResult WINAPI wine_vkCreateWin32SurfaceKHR(VkInstance instance,
const VkWin32SurfaceCreateInfoKHR *createInfo, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
{
......@@ -1601,19 +1563,6 @@ void WINAPI wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
free(object);
}
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, uint32_t *formats_count, VkSurfaceFormat2KHR *formats)
{
VkPhysicalDeviceSurfaceInfo2KHR native_info;
TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, formats_count, formats);
native_info = *surface_info;
native_info.surface = wine_surface_from_handle(surface_info->surface)->driver_surface;
return thunk_vkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &native_info, formats_count, formats);
}
static inline void adjust_max_image_count(VkPhysicalDevice phys_dev, VkSurfaceCapabilitiesKHR* capabilities)
{
/* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile
......@@ -1647,15 +1596,11 @@ VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice phys_dev,
const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, VkSurfaceCapabilities2KHR *capabilities)
{
VkPhysicalDeviceSurfaceInfo2KHR native_info;
VkResult res;
TRACE("%p, %p, %p\n", phys_dev, surface_info, capabilities);
native_info = *surface_info;
native_info.surface = wine_surface_from_handle(surface_info->surface)->driver_surface;
res = thunk_vkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev, &native_info, capabilities);
res = thunk_vkGetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev, surface_info, capabilities);
if (res == VK_SUCCESS)
adjust_max_image_count(phys_dev, &capabilities->surfaceCapabilities);
......
......@@ -33,7 +33,9 @@ static inline void convert_VkAcquireNextImageInfoKHR_win_to_host(const VkAcquire
out->fence = in->fence;
out->deviceMask = in->deviceMask;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAcquireProfilingLockInfoKHR_win_to_host(const VkAcquireProfilingLockInfoKHR *in, VkAcquireProfilingLockInfoKHR_host *out)
{
if (!in) return;
......@@ -43,7 +45,9 @@ static inline void convert_VkAcquireProfilingLockInfoKHR_win_to_host(const VkAcq
out->flags = in->flags;
out->timeout = in->timeout;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDescriptorSetAllocateInfo_win_to_host(const VkDescriptorSetAllocateInfo *in, VkDescriptorSetAllocateInfo_host *out)
{
if (!in) return;
......@@ -54,7 +58,9 @@ static inline void convert_VkDescriptorSetAllocateInfo_win_to_host(const VkDescr
out->descriptorSetCount = in->descriptorSetCount;
out->pSetLayouts = in->pSetLayouts;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryAllocateInfo_win_to_host(const VkMemoryAllocateInfo *in, VkMemoryAllocateInfo_host *out)
{
if (!in) return;
......@@ -64,7 +70,9 @@ static inline void convert_VkMemoryAllocateInfo_win_to_host(const VkMemoryAlloca
out->allocationSize = in->allocationSize;
out->memoryTypeIndex = in->memoryTypeIndex;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkCommandBufferInheritanceInfo_host *convert_VkCommandBufferInheritanceInfo_array_win_to_host(const VkCommandBufferInheritanceInfo *in, uint32_t count)
{
VkCommandBufferInheritanceInfo_host *out;
......@@ -87,14 +95,18 @@ static inline VkCommandBufferInheritanceInfo_host *convert_VkCommandBufferInheri
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCommandBufferInheritanceInfo_array(VkCommandBufferInheritanceInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCommandBufferBeginInfo_win_to_host(const VkCommandBufferBeginInfo *in, VkCommandBufferBeginInfo_host *out)
{
if (!in) return;
......@@ -104,12 +116,16 @@ static inline void convert_VkCommandBufferBeginInfo_win_to_host(const VkCommandB
out->flags = in->flags;
out->pInheritanceInfo = convert_VkCommandBufferInheritanceInfo_array_win_to_host(in->pInheritanceInfo, 1);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCommandBufferBeginInfo(VkCommandBufferBeginInfo_host *in)
{
free_VkCommandBufferInheritanceInfo_array((VkCommandBufferInheritanceInfo_host *)in->pInheritanceInfo, 1);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBindAccelerationStructureMemoryInfoNV_host *convert_VkBindAccelerationStructureMemoryInfoNV_array_win_to_host(const VkBindAccelerationStructureMemoryInfoNV *in, uint32_t count)
{
VkBindAccelerationStructureMemoryInfoNV_host *out;
......@@ -131,14 +147,18 @@ static inline VkBindAccelerationStructureMemoryInfoNV_host *convert_VkBindAccele
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBindAccelerationStructureMemoryInfoNV_array(VkBindAccelerationStructureMemoryInfoNV_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBindBufferMemoryInfo_host *convert_VkBindBufferMemoryInfo_array_win_to_host(const VkBindBufferMemoryInfo *in, uint32_t count)
{
VkBindBufferMemoryInfo_host *out;
......@@ -158,14 +178,18 @@ static inline VkBindBufferMemoryInfo_host *convert_VkBindBufferMemoryInfo_array_
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBindBufferMemoryInfo_array(VkBindBufferMemoryInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBindImageMemoryInfo_host *convert_VkBindImageMemoryInfo_array_win_to_host(const VkBindImageMemoryInfo *in, uint32_t count)
{
VkBindImageMemoryInfo_host *out;
......@@ -185,14 +209,18 @@ static inline VkBindImageMemoryInfo_host *convert_VkBindImageMemoryInfo_array_wi
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBindImageMemoryInfo_array(VkBindImageMemoryInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkAccelerationStructureBuildGeometryInfoKHR_host *convert_VkAccelerationStructureBuildGeometryInfoKHR_array_win_to_host(const VkAccelerationStructureBuildGeometryInfoKHR *in, uint32_t count)
{
VkAccelerationStructureBuildGeometryInfoKHR_host *out;
......@@ -218,14 +246,18 @@ static inline VkAccelerationStructureBuildGeometryInfoKHR_host *convert_VkAccele
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkAccelerationStructureBuildGeometryInfoKHR_array(VkAccelerationStructureBuildGeometryInfoKHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkConditionalRenderingBeginInfoEXT_win_to_host(const VkConditionalRenderingBeginInfoEXT *in, VkConditionalRenderingBeginInfoEXT_host *out)
{
if (!in) return;
......@@ -236,7 +268,9 @@ static inline void convert_VkConditionalRenderingBeginInfoEXT_win_to_host(const
out->offset = in->offset;
out->flags = in->flags;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkRenderPassBeginInfo_win_to_host(const VkRenderPassBeginInfo *in, VkRenderPassBeginInfo_host *out)
{
if (!in) return;
......@@ -249,7 +283,9 @@ static inline void convert_VkRenderPassBeginInfo_win_to_host(const VkRenderPassB
out->clearValueCount = in->clearValueCount;
out->pClearValues = in->pClearValues;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkBlitImageInfo2KHR_win_to_host(const VkBlitImageInfo2KHR *in, VkBlitImageInfo2KHR_host *out)
{
if (!in) return;
......@@ -264,7 +300,9 @@ static inline void convert_VkBlitImageInfo2KHR_win_to_host(const VkBlitImageInfo
out->pRegions = in->pRegions;
out->filter = in->filter;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkGeometryTrianglesNV_win_to_host(const VkGeometryTrianglesNV *in, VkGeometryTrianglesNV_host *out)
{
if (!in) return;
......@@ -283,7 +321,9 @@ static inline void convert_VkGeometryTrianglesNV_win_to_host(const VkGeometryTri
out->transformData = in->transformData;
out->transformOffset = in->transformOffset;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkGeometryAABBNV_win_to_host(const VkGeometryAABBNV *in, VkGeometryAABBNV_host *out)
{
if (!in) return;
......@@ -295,7 +335,9 @@ static inline void convert_VkGeometryAABBNV_win_to_host(const VkGeometryAABBNV *
out->stride = in->stride;
out->offset = in->offset;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkGeometryDataNV_win_to_host(const VkGeometryDataNV *in, VkGeometryDataNV_host *out)
{
if (!in) return;
......@@ -303,7 +345,9 @@ static inline void convert_VkGeometryDataNV_win_to_host(const VkGeometryDataNV *
convert_VkGeometryTrianglesNV_win_to_host(&in->triangles, &out->triangles);
convert_VkGeometryAABBNV_win_to_host(&in->aabbs, &out->aabbs);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkGeometryNV_host *convert_VkGeometryNV_array_win_to_host(const VkGeometryNV *in, uint32_t count)
{
VkGeometryNV_host *out;
......@@ -323,14 +367,18 @@ static inline VkGeometryNV_host *convert_VkGeometryNV_array_win_to_host(const Vk
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkGeometryNV_array(VkGeometryNV_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureInfoNV_win_to_host(const VkAccelerationStructureInfoNV *in, VkAccelerationStructureInfoNV_host *out)
{
if (!in) return;
......@@ -343,12 +391,16 @@ static inline void convert_VkAccelerationStructureInfoNV_win_to_host(const VkAcc
out->geometryCount = in->geometryCount;
out->pGeometries = convert_VkGeometryNV_array_win_to_host(in->pGeometries, in->geometryCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkAccelerationStructureInfoNV(VkAccelerationStructureInfoNV_host *in)
{
free_VkGeometryNV_array((VkGeometryNV_host *)in->pGeometries, in->geometryCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyAccelerationStructureInfoKHR_win_to_host(const VkCopyAccelerationStructureInfoKHR *in, VkCopyAccelerationStructureInfoKHR_host *out)
{
if (!in) return;
......@@ -359,7 +411,9 @@ static inline void convert_VkCopyAccelerationStructureInfoKHR_win_to_host(const
out->dst = in->dst;
out->mode = in->mode;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyAccelerationStructureToMemoryInfoKHR_win_to_host(const VkCopyAccelerationStructureToMemoryInfoKHR *in, VkCopyAccelerationStructureToMemoryInfoKHR_host *out)
{
if (!in) return;
......@@ -370,7 +424,9 @@ static inline void convert_VkCopyAccelerationStructureToMemoryInfoKHR_win_to_hos
out->dst = in->dst;
out->mode = in->mode;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferCopy_host *convert_VkBufferCopy_array_win_to_host(const VkBufferCopy *in, uint32_t count)
{
VkBufferCopy_host *out;
......@@ -388,14 +444,18 @@ static inline VkBufferCopy_host *convert_VkBufferCopy_array_win_to_host(const Vk
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferCopy_array(VkBufferCopy_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferCopy2KHR_host *convert_VkBufferCopy2KHR_array_win_to_host(const VkBufferCopy2KHR *in, uint32_t count)
{
VkBufferCopy2KHR_host *out;
......@@ -415,14 +475,18 @@ static inline VkBufferCopy2KHR_host *convert_VkBufferCopy2KHR_array_win_to_host(
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferCopy2KHR_array(VkBufferCopy2KHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyBufferInfo2KHR_win_to_host(const VkCopyBufferInfo2KHR *in, VkCopyBufferInfo2KHR_host *out)
{
if (!in) return;
......@@ -434,12 +498,16 @@ static inline void convert_VkCopyBufferInfo2KHR_win_to_host(const VkCopyBufferIn
out->regionCount = in->regionCount;
out->pRegions = convert_VkBufferCopy2KHR_array_win_to_host(in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCopyBufferInfo2KHR(VkCopyBufferInfo2KHR_host *in)
{
free_VkBufferCopy2KHR_array((VkBufferCopy2KHR_host *)in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferImageCopy_host *convert_VkBufferImageCopy_array_win_to_host(const VkBufferImageCopy *in, uint32_t count)
{
VkBufferImageCopy_host *out;
......@@ -460,14 +528,18 @@ static inline VkBufferImageCopy_host *convert_VkBufferImageCopy_array_win_to_hos
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferImageCopy_array(VkBufferImageCopy_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferImageCopy2KHR_host *convert_VkBufferImageCopy2KHR_array_win_to_host(const VkBufferImageCopy2KHR *in, uint32_t count)
{
VkBufferImageCopy2KHR_host *out;
......@@ -490,14 +562,18 @@ static inline VkBufferImageCopy2KHR_host *convert_VkBufferImageCopy2KHR_array_wi
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferImageCopy2KHR_array(VkBufferImageCopy2KHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyBufferToImageInfo2KHR_win_to_host(const VkCopyBufferToImageInfo2KHR *in, VkCopyBufferToImageInfo2KHR_host *out)
{
if (!in) return;
......@@ -510,12 +586,16 @@ static inline void convert_VkCopyBufferToImageInfo2KHR_win_to_host(const VkCopyB
out->regionCount = in->regionCount;
out->pRegions = convert_VkBufferImageCopy2KHR_array_win_to_host(in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCopyBufferToImageInfo2KHR(VkCopyBufferToImageInfo2KHR_host *in)
{
free_VkBufferImageCopy2KHR_array((VkBufferImageCopy2KHR_host *)in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyImageInfo2KHR_win_to_host(const VkCopyImageInfo2KHR *in, VkCopyImageInfo2KHR_host *out)
{
if (!in) return;
......@@ -529,7 +609,9 @@ static inline void convert_VkCopyImageInfo2KHR_win_to_host(const VkCopyImageInfo
out->regionCount = in->regionCount;
out->pRegions = in->pRegions;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyImageToBufferInfo2KHR_win_to_host(const VkCopyImageToBufferInfo2KHR *in, VkCopyImageToBufferInfo2KHR_host *out)
{
if (!in) return;
......@@ -542,12 +624,16 @@ static inline void convert_VkCopyImageToBufferInfo2KHR_win_to_host(const VkCopyI
out->regionCount = in->regionCount;
out->pRegions = convert_VkBufferImageCopy2KHR_array_win_to_host(in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCopyImageToBufferInfo2KHR(VkCopyImageToBufferInfo2KHR_host *in)
{
free_VkBufferImageCopy2KHR_array((VkBufferImageCopy2KHR_host *)in->pRegions, in->regionCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCopyMemoryToAccelerationStructureInfoKHR_win_to_host(const VkCopyMemoryToAccelerationStructureInfoKHR *in, VkCopyMemoryToAccelerationStructureInfoKHR_host *out)
{
if (!in) return;
......@@ -558,7 +644,9 @@ static inline void convert_VkCopyMemoryToAccelerationStructureInfoKHR_win_to_hos
out->dst = in->dst;
out->mode = in->mode;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCuLaunchInfoNVX_win_to_host(const VkCuLaunchInfoNVX *in, VkCuLaunchInfoNVX_host *out)
{
if (!in) return;
......@@ -578,7 +666,9 @@ static inline void convert_VkCuLaunchInfoNVX_win_to_host(const VkCuLaunchInfoNVX
out->extraCount = in->extraCount;
out->pExtras = in->pExtras;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkIndirectCommandsStreamNV_host *convert_VkIndirectCommandsStreamNV_array_win_to_host(const VkIndirectCommandsStreamNV *in, uint32_t count)
{
VkIndirectCommandsStreamNV_host *out;
......@@ -595,14 +685,18 @@ static inline VkIndirectCommandsStreamNV_host *convert_VkIndirectCommandsStreamN
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkIndirectCommandsStreamNV_array(VkIndirectCommandsStreamNV_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkGeneratedCommandsInfoNV_win_to_host(const VkGeneratedCommandsInfoNV *in, VkGeneratedCommandsInfoNV_host *out)
{
if (!in) return;
......@@ -623,12 +717,16 @@ static inline void convert_VkGeneratedCommandsInfoNV_win_to_host(const VkGenerat
out->sequencesIndexBuffer = in->sequencesIndexBuffer;
out->sequencesIndexOffset = in->sequencesIndexOffset;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkGeneratedCommandsInfoNV(VkGeneratedCommandsInfoNV_host *in)
{
free_VkIndirectCommandsStreamNV_array((VkIndirectCommandsStreamNV_host *)in->pStreams, in->streamCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferMemoryBarrier_host *convert_VkBufferMemoryBarrier_array_win_to_host(const VkBufferMemoryBarrier *in, uint32_t count)
{
VkBufferMemoryBarrier_host *out;
......@@ -652,14 +750,18 @@ static inline VkBufferMemoryBarrier_host *convert_VkBufferMemoryBarrier_array_wi
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferMemoryBarrier_array(VkBufferMemoryBarrier_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkImageMemoryBarrier_host *convert_VkImageMemoryBarrier_array_win_to_host(const VkImageMemoryBarrier *in, uint32_t count)
{
VkImageMemoryBarrier_host *out;
......@@ -684,14 +786,18 @@ static inline VkImageMemoryBarrier_host *convert_VkImageMemoryBarrier_array_win_
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkImageMemoryBarrier_array(VkImageMemoryBarrier_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBufferMemoryBarrier2KHR_host *convert_VkBufferMemoryBarrier2KHR_array_win_to_host(const VkBufferMemoryBarrier2KHR *in, uint32_t count)
{
VkBufferMemoryBarrier2KHR_host *out;
......@@ -717,14 +823,18 @@ static inline VkBufferMemoryBarrier2KHR_host *convert_VkBufferMemoryBarrier2KHR_
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBufferMemoryBarrier2KHR_array(VkBufferMemoryBarrier2KHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkImageMemoryBarrier2KHR_host *convert_VkImageMemoryBarrier2KHR_array_win_to_host(const VkImageMemoryBarrier2KHR *in, uint32_t count)
{
VkImageMemoryBarrier2KHR_host *out;
......@@ -751,14 +861,18 @@ static inline VkImageMemoryBarrier2KHR_host *convert_VkImageMemoryBarrier2KHR_ar
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkImageMemoryBarrier2KHR_array(VkImageMemoryBarrier2KHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDependencyInfoKHR_win_to_host(const VkDependencyInfoKHR *in, VkDependencyInfoKHR_host *out)
{
if (!in) return;
......@@ -773,13 +887,17 @@ static inline void convert_VkDependencyInfoKHR_win_to_host(const VkDependencyInf
out->imageMemoryBarrierCount = in->imageMemoryBarrierCount;
out->pImageMemoryBarriers = convert_VkImageMemoryBarrier2KHR_array_win_to_host(in->pImageMemoryBarriers, in->imageMemoryBarrierCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDependencyInfoKHR(VkDependencyInfoKHR_host *in)
{
free_VkBufferMemoryBarrier2KHR_array((VkBufferMemoryBarrier2KHR_host *)in->pBufferMemoryBarriers, in->bufferMemoryBarrierCount);
free_VkImageMemoryBarrier2KHR_array((VkImageMemoryBarrier2KHR_host *)in->pImageMemoryBarriers, in->imageMemoryBarrierCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkDescriptorImageInfo_host *convert_VkDescriptorImageInfo_array_win_to_host(const VkDescriptorImageInfo *in, uint32_t count)
{
VkDescriptorImageInfo_host *out;
......@@ -797,14 +915,18 @@ static inline VkDescriptorImageInfo_host *convert_VkDescriptorImageInfo_array_wi
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDescriptorImageInfo_array(VkDescriptorImageInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkDescriptorBufferInfo_host *convert_VkDescriptorBufferInfo_array_win_to_host(const VkDescriptorBufferInfo *in, uint32_t count)
{
VkDescriptorBufferInfo_host *out;
......@@ -822,14 +944,18 @@ static inline VkDescriptorBufferInfo_host *convert_VkDescriptorBufferInfo_array_
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDescriptorBufferInfo_array(VkDescriptorBufferInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkWriteDescriptorSet_host *convert_VkWriteDescriptorSet_array_win_to_host(const VkWriteDescriptorSet *in, uint32_t count)
{
VkWriteDescriptorSet_host *out;
......@@ -854,7 +980,9 @@ static inline VkWriteDescriptorSet_host *convert_VkWriteDescriptorSet_array_win_
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkWriteDescriptorSet_array(VkWriteDescriptorSet_host *in, uint32_t count)
{
unsigned int i;
......@@ -868,7 +996,9 @@ static inline void free_VkWriteDescriptorSet_array(VkWriteDescriptorSet_host *in
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkResolveImageInfo2KHR_win_to_host(const VkResolveImageInfo2KHR *in, VkResolveImageInfo2KHR_host *out)
{
if (!in) return;
......@@ -882,7 +1012,9 @@ static inline void convert_VkResolveImageInfo2KHR_win_to_host(const VkResolveIma
out->regionCount = in->regionCount;
out->pRegions = in->pRegions;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPerformanceMarkerInfoINTEL_win_to_host(const VkPerformanceMarkerInfoINTEL *in, VkPerformanceMarkerInfoINTEL_host *out)
{
if (!in) return;
......@@ -891,7 +1023,9 @@ static inline void convert_VkPerformanceMarkerInfoINTEL_win_to_host(const VkPerf
out->pNext = in->pNext;
out->marker = in->marker;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPerformanceOverrideInfoINTEL_win_to_host(const VkPerformanceOverrideInfoINTEL *in, VkPerformanceOverrideInfoINTEL_host *out)
{
if (!in) return;
......@@ -902,7 +1036,9 @@ static inline void convert_VkPerformanceOverrideInfoINTEL_win_to_host(const VkPe
out->enable = in->enable;
out->parameter = in->parameter;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkStridedDeviceAddressRegionKHR_win_to_host(const VkStridedDeviceAddressRegionKHR *in, VkStridedDeviceAddressRegionKHR_host *out)
{
if (!in) return;
......@@ -911,7 +1047,9 @@ static inline void convert_VkStridedDeviceAddressRegionKHR_win_to_host(const VkS
out->stride = in->stride;
out->size = in->size;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkDependencyInfoKHR_host *convert_VkDependencyInfoKHR_array_win_to_host(const VkDependencyInfoKHR *in, uint32_t count)
{
VkDependencyInfoKHR_host *out;
......@@ -935,7 +1073,9 @@ static inline VkDependencyInfoKHR_host *convert_VkDependencyInfoKHR_array_win_to
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDependencyInfoKHR_array(VkDependencyInfoKHR_host *in, uint32_t count)
{
unsigned int i;
......@@ -949,7 +1089,9 @@ static inline void free_VkDependencyInfoKHR_array(VkDependencyInfoKHR_host *in,
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureCreateInfoKHR_win_to_host(const VkAccelerationStructureCreateInfoKHR *in, VkAccelerationStructureCreateInfoKHR_host *out)
{
if (!in) return;
......@@ -963,7 +1105,9 @@ static inline void convert_VkAccelerationStructureCreateInfoKHR_win_to_host(cons
out->type = in->type;
out->deviceAddress = in->deviceAddress;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureCreateInfoNV_win_to_host(const VkAccelerationStructureCreateInfoNV *in, VkAccelerationStructureCreateInfoNV_host *out)
{
if (!in) return;
......@@ -973,7 +1117,9 @@ static inline void convert_VkAccelerationStructureCreateInfoNV_win_to_host(const
out->compactedSize = in->compactedSize;
convert_VkAccelerationStructureInfoNV_win_to_host(&in->info, &out->info);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkBufferCreateInfo_win_to_host(const VkBufferCreateInfo *in, VkBufferCreateInfo_host *out)
{
if (!in) return;
......@@ -987,7 +1133,9 @@ static inline void convert_VkBufferCreateInfo_win_to_host(const VkBufferCreateIn
out->queueFamilyIndexCount = in->queueFamilyIndexCount;
out->pQueueFamilyIndices = in->pQueueFamilyIndices;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkBufferViewCreateInfo_win_to_host(const VkBufferViewCreateInfo *in, VkBufferViewCreateInfo_host *out)
{
if (!in) return;
......@@ -1000,7 +1148,9 @@ static inline void convert_VkBufferViewCreateInfo_win_to_host(const VkBufferView
out->offset = in->offset;
out->range = in->range;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPipelineShaderStageCreateInfo_win_to_host(const VkPipelineShaderStageCreateInfo *in, VkPipelineShaderStageCreateInfo_host *out)
{
if (!in) return;
......@@ -1013,7 +1163,9 @@ static inline void convert_VkPipelineShaderStageCreateInfo_win_to_host(const VkP
out->pName = in->pName;
out->pSpecializationInfo = in->pSpecializationInfo;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkComputePipelineCreateInfo_host *convert_VkComputePipelineCreateInfo_array_win_to_host(const VkComputePipelineCreateInfo *in, uint32_t count)
{
VkComputePipelineCreateInfo_host *out;
......@@ -1035,14 +1187,18 @@ static inline VkComputePipelineCreateInfo_host *convert_VkComputePipelineCreateI
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkComputePipelineCreateInfo_array(VkComputePipelineCreateInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkCuFunctionCreateInfoNVX_win_to_host(const VkCuFunctionCreateInfoNVX *in, VkCuFunctionCreateInfoNVX_host *out)
{
if (!in) return;
......@@ -1052,7 +1208,9 @@ static inline void convert_VkCuFunctionCreateInfoNVX_win_to_host(const VkCuFunct
out->module = in->module;
out->pName = in->pName;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDescriptorUpdateTemplateCreateInfo_win_to_host(const VkDescriptorUpdateTemplateCreateInfo *in, VkDescriptorUpdateTemplateCreateInfo_host *out)
{
if (!in) return;
......@@ -1068,7 +1226,9 @@ static inline void convert_VkDescriptorUpdateTemplateCreateInfo_win_to_host(cons
out->pipelineLayout = in->pipelineLayout;
out->set = in->set;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkFramebufferCreateInfo_win_to_host(const VkFramebufferCreateInfo *in, VkFramebufferCreateInfo_host *out)
{
if (!in) return;
......@@ -1083,7 +1243,9 @@ static inline void convert_VkFramebufferCreateInfo_win_to_host(const VkFramebuff
out->height = in->height;
out->layers = in->layers;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkPipelineShaderStageCreateInfo_host *convert_VkPipelineShaderStageCreateInfo_array_win_to_host(const VkPipelineShaderStageCreateInfo *in, uint32_t count)
{
VkPipelineShaderStageCreateInfo_host *out;
......@@ -1105,14 +1267,18 @@ static inline VkPipelineShaderStageCreateInfo_host *convert_VkPipelineShaderStag
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkPipelineShaderStageCreateInfo_array(VkPipelineShaderStageCreateInfo_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkGraphicsPipelineCreateInfo_host *convert_VkGraphicsPipelineCreateInfo_array_win_to_host(const VkGraphicsPipelineCreateInfo *in, uint32_t count)
{
VkGraphicsPipelineCreateInfo_host *out;
......@@ -1146,7 +1312,9 @@ static inline VkGraphicsPipelineCreateInfo_host *convert_VkGraphicsPipelineCreat
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkGraphicsPipelineCreateInfo_array(VkGraphicsPipelineCreateInfo_host *in, uint32_t count)
{
unsigned int i;
......@@ -1159,7 +1327,9 @@ static inline void free_VkGraphicsPipelineCreateInfo_array(VkGraphicsPipelineCre
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageViewCreateInfo_win_to_host(const VkImageViewCreateInfo *in, VkImageViewCreateInfo_host *out)
{
if (!in) return;
......@@ -1173,7 +1343,9 @@ static inline void convert_VkImageViewCreateInfo_win_to_host(const VkImageViewCr
out->components = in->components;
out->subresourceRange = in->subresourceRange;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkIndirectCommandsLayoutTokenNV_host *convert_VkIndirectCommandsLayoutTokenNV_array_win_to_host(const VkIndirectCommandsLayoutTokenNV *in, uint32_t count)
{
VkIndirectCommandsLayoutTokenNV_host *out;
......@@ -1203,14 +1375,18 @@ static inline VkIndirectCommandsLayoutTokenNV_host *convert_VkIndirectCommandsLa
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkIndirectCommandsLayoutTokenNV_array(VkIndirectCommandsLayoutTokenNV_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkIndirectCommandsLayoutCreateInfoNV_win_to_host(const VkIndirectCommandsLayoutCreateInfoNV *in, VkIndirectCommandsLayoutCreateInfoNV_host *out)
{
if (!in) return;
......@@ -1224,12 +1400,16 @@ static inline void convert_VkIndirectCommandsLayoutCreateInfoNV_win_to_host(cons
out->streamCount = in->streamCount;
out->pStreamStrides = in->pStreamStrides;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkIndirectCommandsLayoutCreateInfoNV(VkIndirectCommandsLayoutCreateInfoNV_host *in)
{
free_VkIndirectCommandsLayoutTokenNV_array((VkIndirectCommandsLayoutTokenNV_host *)in->pTokens, in->tokenCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkRayTracingPipelineCreateInfoKHR_host *convert_VkRayTracingPipelineCreateInfoKHR_array_win_to_host(const VkRayTracingPipelineCreateInfoKHR *in, uint32_t count)
{
VkRayTracingPipelineCreateInfoKHR_host *out;
......@@ -1258,7 +1438,9 @@ static inline VkRayTracingPipelineCreateInfoKHR_host *convert_VkRayTracingPipeli
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkRayTracingPipelineCreateInfoKHR_array(VkRayTracingPipelineCreateInfoKHR_host *in, uint32_t count)
{
unsigned int i;
......@@ -1271,7 +1453,9 @@ static inline void free_VkRayTracingPipelineCreateInfoKHR_array(VkRayTracingPipe
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkRayTracingPipelineCreateInfoNV_host *convert_VkRayTracingPipelineCreateInfoNV_array_win_to_host(const VkRayTracingPipelineCreateInfoNV *in, uint32_t count)
{
VkRayTracingPipelineCreateInfoNV_host *out;
......@@ -1297,7 +1481,9 @@ static inline VkRayTracingPipelineCreateInfoNV_host *convert_VkRayTracingPipelin
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkRayTracingPipelineCreateInfoNV_array(VkRayTracingPipelineCreateInfoNV_host *in, uint32_t count)
{
unsigned int i;
......@@ -1310,15 +1496,20 @@ static inline void free_VkRayTracingPipelineCreateInfoNV_array(VkRayTracingPipel
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkSwapchainCreateInfoKHR_win_to_host(const VkSwapchainCreateInfoKHR *in, VkSwapchainCreateInfoKHR_host *out)
#else
static inline void convert_VkSwapchainCreateInfoKHR_win_to_host(const VkSwapchainCreateInfoKHR *in, VkSwapchainCreateInfoKHR *out)
#endif /* USE_STRUCT_CONVERSION */
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->flags = in->flags;
out->surface = in->surface;
out->surface = wine_surface_from_handle(in->surface)->driver_surface;
out->minImageCount = in->minImageCount;
out->imageFormat = in->imageFormat;
out->imageColorSpace = in->imageColorSpace;
......@@ -1335,6 +1526,7 @@ static inline void convert_VkSwapchainCreateInfoKHR_win_to_host(const VkSwapchai
out->oldSwapchain = in->oldSwapchain;
}
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDebugMarkerObjectNameInfoEXT_win_to_host(const VkDebugMarkerObjectNameInfoEXT *in, VkDebugMarkerObjectNameInfoEXT_host *out)
{
if (!in) return;
......@@ -1345,7 +1537,9 @@ static inline void convert_VkDebugMarkerObjectNameInfoEXT_win_to_host(const VkDe
out->object = in->object;
out->pObjectName = in->pObjectName;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDebugMarkerObjectTagInfoEXT_win_to_host(const VkDebugMarkerObjectTagInfoEXT *in, VkDebugMarkerObjectTagInfoEXT_host *out)
{
if (!in) return;
......@@ -1358,7 +1552,9 @@ static inline void convert_VkDebugMarkerObjectTagInfoEXT_win_to_host(const VkDeb
out->tagSize = in->tagSize;
out->pTag = in->pTag;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkMappedMemoryRange_host *convert_VkMappedMemoryRange_array_win_to_host(const VkMappedMemoryRange *in, uint32_t count)
{
VkMappedMemoryRange_host *out;
......@@ -1378,14 +1574,18 @@ static inline VkMappedMemoryRange_host *convert_VkMappedMemoryRange_array_win_to
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkMappedMemoryRange_array(VkMappedMemoryRange_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureBuildGeometryInfoKHR_win_to_host(const VkAccelerationStructureBuildGeometryInfoKHR *in, VkAccelerationStructureBuildGeometryInfoKHR_host *out)
{
if (!in) return;
......@@ -1402,7 +1602,9 @@ static inline void convert_VkAccelerationStructureBuildGeometryInfoKHR_win_to_ho
out->ppGeometries = in->ppGeometries;
out->scratchData = in->scratchData;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_win_to_host(const VkAccelerationStructureBuildSizesInfoKHR *in, VkAccelerationStructureBuildSizesInfoKHR_host *out)
{
if (!in) return;
......@@ -1413,7 +1615,9 @@ static inline void convert_VkAccelerationStructureBuildSizesInfoKHR_win_to_host(
out->updateScratchSize = in->updateScratchSize;
out->buildScratchSize = in->buildScratchSize;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureDeviceAddressInfoKHR_win_to_host(const VkAccelerationStructureDeviceAddressInfoKHR *in, VkAccelerationStructureDeviceAddressInfoKHR_host *out)
{
if (!in) return;
......@@ -1422,7 +1626,9 @@ static inline void convert_VkAccelerationStructureDeviceAddressInfoKHR_win_to_ho
out->pNext = in->pNext;
out->accelerationStructure = in->accelerationStructure;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkAccelerationStructureMemoryRequirementsInfoNV_win_to_host(const VkAccelerationStructureMemoryRequirementsInfoNV *in, VkAccelerationStructureMemoryRequirementsInfoNV_host *out)
{
if (!in) return;
......@@ -1432,7 +1638,9 @@ static inline void convert_VkAccelerationStructureMemoryRequirementsInfoNV_win_t
out->type = in->type;
out->accelerationStructure = in->accelerationStructure;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryRequirements_host_to_win(const VkMemoryRequirements_host *in, VkMemoryRequirements *out)
{
if (!in) return;
......@@ -1441,7 +1649,9 @@ static inline void convert_VkMemoryRequirements_host_to_win(const VkMemoryRequir
out->alignment = in->alignment;
out->memoryTypeBits = in->memoryTypeBits;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryRequirements2KHR_win_to_host(const VkMemoryRequirements2KHR *in, VkMemoryRequirements2KHR_host *out)
{
if (!in) return;
......@@ -1449,7 +1659,9 @@ static inline void convert_VkMemoryRequirements2KHR_win_to_host(const VkMemoryRe
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryRequirements2KHR_host_to_win(const VkMemoryRequirements2KHR_host *in, VkMemoryRequirements2KHR *out)
{
if (!in) return;
......@@ -1458,7 +1670,9 @@ static inline void convert_VkMemoryRequirements2KHR_host_to_win(const VkMemoryRe
out->pNext = in->pNext;
convert_VkMemoryRequirements_host_to_win(&in->memoryRequirements, &out->memoryRequirements);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkBufferDeviceAddressInfo_win_to_host(const VkBufferDeviceAddressInfo *in, VkBufferDeviceAddressInfo_host *out)
{
if (!in) return;
......@@ -1467,7 +1681,9 @@ static inline void convert_VkBufferDeviceAddressInfo_win_to_host(const VkBufferD
out->pNext = in->pNext;
out->buffer = in->buffer;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkBufferMemoryRequirementsInfo2_win_to_host(const VkBufferMemoryRequirementsInfo2 *in, VkBufferMemoryRequirementsInfo2_host *out)
{
if (!in) return;
......@@ -1476,7 +1692,9 @@ static inline void convert_VkBufferMemoryRequirementsInfo2_win_to_host(const VkB
out->pNext = in->pNext;
out->buffer = in->buffer;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryRequirements2_win_to_host(const VkMemoryRequirements2 *in, VkMemoryRequirements2_host *out)
{
if (!in) return;
......@@ -1484,7 +1702,9 @@ static inline void convert_VkMemoryRequirements2_win_to_host(const VkMemoryRequi
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryRequirements2_host_to_win(const VkMemoryRequirements2_host *in, VkMemoryRequirements2 *out)
{
if (!in) return;
......@@ -1493,7 +1713,9 @@ static inline void convert_VkMemoryRequirements2_host_to_win(const VkMemoryRequi
out->pNext = in->pNext;
convert_VkMemoryRequirements_host_to_win(&in->memoryRequirements, &out->memoryRequirements);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo *in, VkDeviceMemoryOpaqueCaptureAddressInfo_host *out)
{
if (!in) return;
......@@ -1502,7 +1724,9 @@ static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win_to_host(co
out->pNext = in->pNext;
out->memory = in->memory;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win_to_host(const VkGeneratedCommandsMemoryRequirementsInfoNV *in, VkGeneratedCommandsMemoryRequirementsInfoNV_host *out)
{
if (!in) return;
......@@ -1514,7 +1738,9 @@ static inline void convert_VkGeneratedCommandsMemoryRequirementsInfoNV_win_to_ho
out->indirectCommandsLayout = in->indirectCommandsLayout;
out->maxSequencesCount = in->maxSequencesCount;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageMemoryRequirementsInfo2_win_to_host(const VkImageMemoryRequirementsInfo2 *in, VkImageMemoryRequirementsInfo2_host *out)
{
if (!in) return;
......@@ -1523,7 +1749,9 @@ static inline void convert_VkImageMemoryRequirementsInfo2_win_to_host(const VkIm
out->pNext = in->pNext;
out->image = in->image;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageSparseMemoryRequirementsInfo2_win_to_host(const VkImageSparseMemoryRequirementsInfo2 *in, VkImageSparseMemoryRequirementsInfo2_host *out)
{
if (!in) return;
......@@ -1532,7 +1760,9 @@ static inline void convert_VkImageSparseMemoryRequirementsInfo2_win_to_host(cons
out->pNext = in->pNext;
out->image = in->image;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkSubresourceLayout_host_to_win(const VkSubresourceLayout_host *in, VkSubresourceLayout *out)
{
if (!in) return;
......@@ -1543,7 +1773,9 @@ static inline void convert_VkSubresourceLayout_host_to_win(const VkSubresourceLa
out->arrayPitch = in->arrayPitch;
out->depthPitch = in->depthPitch;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageViewAddressPropertiesNVX_win_to_host(const VkImageViewAddressPropertiesNVX *in, VkImageViewAddressPropertiesNVX_host *out)
{
if (!in) return;
......@@ -1551,7 +1783,9 @@ static inline void convert_VkImageViewAddressPropertiesNVX_win_to_host(const VkI
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageViewAddressPropertiesNVX_host_to_win(const VkImageViewAddressPropertiesNVX_host *in, VkImageViewAddressPropertiesNVX *out)
{
if (!in) return;
......@@ -1561,7 +1795,9 @@ static inline void convert_VkImageViewAddressPropertiesNVX_host_to_win(const VkI
out->deviceAddress = in->deviceAddress;
out->size = in->size;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageViewHandleInfoNVX_win_to_host(const VkImageViewHandleInfoNVX *in, VkImageViewHandleInfoNVX_host *out)
{
if (!in) return;
......@@ -1572,7 +1808,9 @@ static inline void convert_VkImageViewHandleInfoNVX_win_to_host(const VkImageVie
out->descriptorType = in->descriptorType;
out->sampler = in->sampler;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageFormatProperties_host_to_win(const VkImageFormatProperties_host *in, VkImageFormatProperties *out)
{
if (!in) return;
......@@ -1583,7 +1821,9 @@ static inline void convert_VkImageFormatProperties_host_to_win(const VkImageForm
out->sampleCounts = in->sampleCounts;
out->maxResourceSize = in->maxResourceSize;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageFormatProperties2_win_to_host(const VkImageFormatProperties2 *in, VkImageFormatProperties2_host *out)
{
if (!in) return;
......@@ -1591,7 +1831,9 @@ static inline void convert_VkImageFormatProperties2_win_to_host(const VkImageFor
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkImageFormatProperties2_host_to_win(const VkImageFormatProperties2_host *in, VkImageFormatProperties2 *out)
{
if (!in) return;
......@@ -1600,7 +1842,9 @@ static inline void convert_VkImageFormatProperties2_host_to_win(const VkImageFor
out->pNext = in->pNext;
convert_VkImageFormatProperties_host_to_win(&in->imageFormatProperties, &out->imageFormatProperties);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkMemoryHeap_static_array_host_to_win(const VkMemoryHeap_host *in, VkMemoryHeap *out, uint32_t count)
{
unsigned int i;
......@@ -1613,7 +1857,9 @@ static inline void convert_VkMemoryHeap_static_array_host_to_win(const VkMemoryH
out[i].flags = in[i].flags;
}
}
#endif /* USE_STRUCT_CONVERSION) */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceMemoryProperties_host_to_win(const VkPhysicalDeviceMemoryProperties_host *in, VkPhysicalDeviceMemoryProperties *out)
{
if (!in) return;
......@@ -1623,7 +1869,9 @@ static inline void convert_VkPhysicalDeviceMemoryProperties_host_to_win(const Vk
out->memoryHeapCount = in->memoryHeapCount;
convert_VkMemoryHeap_static_array_host_to_win(in->memoryHeaps, out->memoryHeaps, VK_MAX_MEMORY_HEAPS);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceMemoryProperties2_win_to_host(const VkPhysicalDeviceMemoryProperties2 *in, VkPhysicalDeviceMemoryProperties2_host *out)
{
if (!in) return;
......@@ -1631,7 +1879,9 @@ static inline void convert_VkPhysicalDeviceMemoryProperties2_win_to_host(const V
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceMemoryProperties2_host_to_win(const VkPhysicalDeviceMemoryProperties2_host *in, VkPhysicalDeviceMemoryProperties2 *out)
{
if (!in) return;
......@@ -1640,7 +1890,9 @@ static inline void convert_VkPhysicalDeviceMemoryProperties2_host_to_win(const V
out->pNext = in->pNext;
convert_VkPhysicalDeviceMemoryProperties_host_to_win(&in->memoryProperties, &out->memoryProperties);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceLimits_host_to_win(const VkPhysicalDeviceLimits_host *in, VkPhysicalDeviceLimits *out)
{
if (!in) return;
......@@ -1752,7 +2004,9 @@ static inline void convert_VkPhysicalDeviceLimits_host_to_win(const VkPhysicalDe
out->optimalBufferCopyRowPitchAlignment = in->optimalBufferCopyRowPitchAlignment;
out->nonCoherentAtomSize = in->nonCoherentAtomSize;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceProperties_host_to_win(const VkPhysicalDeviceProperties_host *in, VkPhysicalDeviceProperties *out)
{
if (!in) return;
......@@ -1767,7 +2021,9 @@ static inline void convert_VkPhysicalDeviceProperties_host_to_win(const VkPhysic
convert_VkPhysicalDeviceLimits_host_to_win(&in->limits, &out->limits);
out->sparseProperties = in->sparseProperties;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceProperties2_win_to_host(const VkPhysicalDeviceProperties2 *in, VkPhysicalDeviceProperties2_host *out)
{
if (!in) return;
......@@ -1775,7 +2031,9 @@ static inline void convert_VkPhysicalDeviceProperties2_win_to_host(const VkPhysi
out->pNext = in->pNext;
out->sType = in->sType;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceProperties2_host_to_win(const VkPhysicalDeviceProperties2_host *in, VkPhysicalDeviceProperties2 *out)
{
if (!in) return;
......@@ -1784,16 +2042,22 @@ static inline void convert_VkPhysicalDeviceProperties2_host_to_win(const VkPhysi
out->pNext = in->pNext;
convert_VkPhysicalDeviceProperties_host_to_win(&in->properties, &out->properties);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(const VkPhysicalDeviceSurfaceInfo2KHR *in, VkPhysicalDeviceSurfaceInfo2KHR_host *out)
#else
static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(const VkPhysicalDeviceSurfaceInfo2KHR *in, VkPhysicalDeviceSurfaceInfo2KHR *out)
#endif /* USE_STRUCT_CONVERSION */
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->surface = in->surface;
out->surface = wine_surface_from_handle(in->surface)->driver_surface;
}
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPipelineExecutableInfoKHR_win_to_host(const VkPipelineExecutableInfoKHR *in, VkPipelineExecutableInfoKHR_host *out)
{
if (!in) return;
......@@ -1803,7 +2067,9 @@ static inline void convert_VkPipelineExecutableInfoKHR_win_to_host(const VkPipel
out->pipeline = in->pipeline;
out->executableIndex = in->executableIndex;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkPipelineInfoKHR_win_to_host(const VkPipelineInfoKHR *in, VkPipelineInfoKHR_host *out)
{
if (!in) return;
......@@ -1812,7 +2078,9 @@ static inline void convert_VkPipelineInfoKHR_win_to_host(const VkPipelineInfoKHR
out->pNext = in->pNext;
out->pipeline = in->pipeline;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSparseMemoryBind_host *convert_VkSparseMemoryBind_array_win_to_host(const VkSparseMemoryBind *in, uint32_t count)
{
VkSparseMemoryBind_host *out;
......@@ -1832,14 +2100,18 @@ static inline VkSparseMemoryBind_host *convert_VkSparseMemoryBind_array_win_to_h
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSparseMemoryBind_array(VkSparseMemoryBind_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSparseBufferMemoryBindInfo_host *convert_VkSparseBufferMemoryBindInfo_array_win_to_host(const VkSparseBufferMemoryBindInfo *in, uint32_t count)
{
VkSparseBufferMemoryBindInfo_host *out;
......@@ -1857,7 +2129,9 @@ static inline VkSparseBufferMemoryBindInfo_host *convert_VkSparseBufferMemoryBin
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSparseBufferMemoryBindInfo_array(VkSparseBufferMemoryBindInfo_host *in, uint32_t count)
{
unsigned int i;
......@@ -1870,7 +2144,9 @@ static inline void free_VkSparseBufferMemoryBindInfo_array(VkSparseBufferMemoryB
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSparseImageOpaqueMemoryBindInfo_host *convert_VkSparseImageOpaqueMemoryBindInfo_array_win_to_host(const VkSparseImageOpaqueMemoryBindInfo *in, uint32_t count)
{
VkSparseImageOpaqueMemoryBindInfo_host *out;
......@@ -1888,7 +2164,9 @@ static inline VkSparseImageOpaqueMemoryBindInfo_host *convert_VkSparseImageOpaqu
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSparseImageOpaqueMemoryBindInfo_array(VkSparseImageOpaqueMemoryBindInfo_host *in, uint32_t count)
{
unsigned int i;
......@@ -1901,7 +2179,9 @@ static inline void free_VkSparseImageOpaqueMemoryBindInfo_array(VkSparseImageOpa
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSparseImageMemoryBind_host *convert_VkSparseImageMemoryBind_array_win_to_host(const VkSparseImageMemoryBind *in, uint32_t count)
{
VkSparseImageMemoryBind_host *out;
......@@ -1922,14 +2202,18 @@ static inline VkSparseImageMemoryBind_host *convert_VkSparseImageMemoryBind_arra
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSparseImageMemoryBind_array(VkSparseImageMemoryBind_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSparseImageMemoryBindInfo_host *convert_VkSparseImageMemoryBindInfo_array_win_to_host(const VkSparseImageMemoryBindInfo *in, uint32_t count)
{
VkSparseImageMemoryBindInfo_host *out;
......@@ -1947,7 +2231,9 @@ static inline VkSparseImageMemoryBindInfo_host *convert_VkSparseImageMemoryBindI
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSparseImageMemoryBindInfo_array(VkSparseImageMemoryBindInfo_host *in, uint32_t count)
{
unsigned int i;
......@@ -1960,7 +2246,9 @@ static inline void free_VkSparseImageMemoryBindInfo_array(VkSparseImageMemoryBin
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkBindSparseInfo_host *convert_VkBindSparseInfo_array_win_to_host(const VkBindSparseInfo *in, uint32_t count)
{
VkBindSparseInfo_host *out;
......@@ -1987,7 +2275,9 @@ static inline VkBindSparseInfo_host *convert_VkBindSparseInfo_array_win_to_host(
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkBindSparseInfo_array(VkBindSparseInfo_host *in, uint32_t count)
{
unsigned int i;
......@@ -2002,7 +2292,9 @@ static inline void free_VkBindSparseInfo_array(VkBindSparseInfo_host *in, uint32
}
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkSemaphoreSubmitInfoKHR_host *convert_VkSemaphoreSubmitInfoKHR_array_win_to_host(const VkSemaphoreSubmitInfoKHR *in, uint32_t count)
{
VkSemaphoreSubmitInfoKHR_host *out;
......@@ -2023,17 +2315,52 @@ static inline VkSemaphoreSubmitInfoKHR_host *convert_VkSemaphoreSubmitInfoKHR_ar
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSemaphoreSubmitInfoKHR_array(VkSemaphoreSubmitInfoKHR_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
static inline VkCommandBufferSubmitInfoKHR *convert_VkCommandBufferSubmitInfoKHR_array_win_to_host(const VkCommandBufferSubmitInfoKHR *in, uint32_t count)
{
VkCommandBufferSubmitInfoKHR *out;
unsigned int i;
if (!in) return NULL;
out = malloc(count * sizeof(*out));
for (i = 0; i < count; i++)
{
out[i].sType = in[i].sType;
out[i].pNext = in[i].pNext;
out[i].commandBuffer = in[i].commandBuffer->command_buffer;
out[i].deviceMask = in[i].deviceMask;
}
return out;
}
static inline void free_VkCommandBufferSubmitInfoKHR_array(VkCommandBufferSubmitInfoKHR *in, uint32_t count)
{
if (!in) return;
free(in);
}
#if defined(USE_STRUCT_CONVERSION)
static inline VkSubmitInfo2KHR_host *convert_VkSubmitInfo2KHR_array_win_to_host(const VkSubmitInfo2KHR *in, uint32_t count)
{
VkSubmitInfo2KHR_host *out;
#else
static inline VkSubmitInfo2KHR *convert_VkSubmitInfo2KHR_array_win_to_host(const VkSubmitInfo2KHR *in, uint32_t count)
{
VkSubmitInfo2KHR *out;
#endif /* USE_STRUCT_CONVERSION */
unsigned int i;
if (!in) return NULL;
......@@ -2045,17 +2372,29 @@ static inline VkSubmitInfo2KHR_host *convert_VkSubmitInfo2KHR_array_win_to_host(
out[i].pNext = in[i].pNext;
out[i].flags = in[i].flags;
out[i].waitSemaphoreInfoCount = in[i].waitSemaphoreInfoCount;
#if defined(USE_STRUCT_CONVERSION)
out[i].pWaitSemaphoreInfos = convert_VkSemaphoreSubmitInfoKHR_array_win_to_host(in[i].pWaitSemaphoreInfos, in[i].waitSemaphoreInfoCount);
#else
out[i].pWaitSemaphoreInfos = in[i].pWaitSemaphoreInfos;
#endif /* USE_STRUCT_CONVERSION */
out[i].commandBufferInfoCount = in[i].commandBufferInfoCount;
out[i].pCommandBufferInfos = in[i].pCommandBufferInfos;
out[i].pCommandBufferInfos = convert_VkCommandBufferSubmitInfoKHR_array_win_to_host(in[i].pCommandBufferInfos, in[i].commandBufferInfoCount);
out[i].signalSemaphoreInfoCount = in[i].signalSemaphoreInfoCount;
#if defined(USE_STRUCT_CONVERSION)
out[i].pSignalSemaphoreInfos = convert_VkSemaphoreSubmitInfoKHR_array_win_to_host(in[i].pSignalSemaphoreInfos, in[i].signalSemaphoreInfoCount);
#else
out[i].pSignalSemaphoreInfos = in[i].pSignalSemaphoreInfos;
#endif /* USE_STRUCT_CONVERSION */
}
return out;
}
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkSubmitInfo2KHR_array(VkSubmitInfo2KHR_host *in, uint32_t count)
#else
static inline void free_VkSubmitInfo2KHR_array(VkSubmitInfo2KHR *in, uint32_t count)
#endif /* USE_STRUCT_CONVERSION */
{
unsigned int i;
......@@ -2063,12 +2402,18 @@ static inline void free_VkSubmitInfo2KHR_array(VkSubmitInfo2KHR_host *in, uint32
for (i = 0; i < count; i++)
{
#if defined(USE_STRUCT_CONVERSION)
free_VkSemaphoreSubmitInfoKHR_array((VkSemaphoreSubmitInfoKHR_host *)in[i].pWaitSemaphoreInfos, in[i].waitSemaphoreInfoCount);
#endif /* USE_STRUCT_CONVERSION */
free_VkCommandBufferSubmitInfoKHR_array((VkCommandBufferSubmitInfoKHR *)in[i].pCommandBufferInfos, in[i].commandBufferInfoCount);
#if defined(USE_STRUCT_CONVERSION)
free_VkSemaphoreSubmitInfoKHR_array((VkSemaphoreSubmitInfoKHR_host *)in[i].pSignalSemaphoreInfos, in[i].signalSemaphoreInfoCount);
#endif /* USE_STRUCT_CONVERSION */
}
free(in);
}
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDebugUtilsObjectNameInfoEXT_win_to_host(const VkDebugUtilsObjectNameInfoEXT *in, VkDebugUtilsObjectNameInfoEXT_host *out)
{
if (!in) return;
......@@ -2079,7 +2424,9 @@ static inline void convert_VkDebugUtilsObjectNameInfoEXT_win_to_host(const VkDeb
out->objectHandle = in->objectHandle;
out->pObjectName = in->pObjectName;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDebugUtilsObjectTagInfoEXT_win_to_host(const VkDebugUtilsObjectTagInfoEXT *in, VkDebugUtilsObjectTagInfoEXT_host *out)
{
if (!in) return;
......@@ -2092,7 +2439,9 @@ static inline void convert_VkDebugUtilsObjectTagInfoEXT_win_to_host(const VkDebu
out->tagSize = in->tagSize;
out->pTag = in->pTag;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkSemaphoreSignalInfo_win_to_host(const VkSemaphoreSignalInfo *in, VkSemaphoreSignalInfo_host *out)
{
if (!in) return;
......@@ -2102,7 +2451,9 @@ static inline void convert_VkSemaphoreSignalInfo_win_to_host(const VkSemaphoreSi
out->semaphore = in->semaphore;
out->value = in->value;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkDebugUtilsObjectNameInfoEXT_host *convert_VkDebugUtilsObjectNameInfoEXT_array_win_to_host(const VkDebugUtilsObjectNameInfoEXT *in, uint32_t count)
{
VkDebugUtilsObjectNameInfoEXT_host *out;
......@@ -2122,14 +2473,18 @@ static inline VkDebugUtilsObjectNameInfoEXT_host *convert_VkDebugUtilsObjectName
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDebugUtilsObjectNameInfoEXT_array(VkDebugUtilsObjectNameInfoEXT_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win_to_host(const VkDebugUtilsMessengerCallbackDataEXT *in, VkDebugUtilsMessengerCallbackDataEXT_host *out)
{
if (!in) return;
......@@ -2147,12 +2502,16 @@ static inline void convert_VkDebugUtilsMessengerCallbackDataEXT_win_to_host(cons
out->objectCount = in->objectCount;
out->pObjects = convert_VkDebugUtilsObjectNameInfoEXT_array_win_to_host(in->pObjects, in->objectCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkDebugUtilsMessengerCallbackDataEXT(VkDebugUtilsMessengerCallbackDataEXT_host *in)
{
free_VkDebugUtilsObjectNameInfoEXT_array((VkDebugUtilsObjectNameInfoEXT_host *)in->pObjects, in->objectCount);
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline VkCopyDescriptorSet_host *convert_VkCopyDescriptorSet_array_win_to_host(const VkCopyDescriptorSet *in, uint32_t count)
{
VkCopyDescriptorSet_host *out;
......@@ -2176,16 +2535,40 @@ static inline VkCopyDescriptorSet_host *convert_VkCopyDescriptorSet_array_win_to
return out;
}
#endif /* USE_STRUCT_CONVERSION */
#if defined(USE_STRUCT_CONVERSION)
static inline void free_VkCopyDescriptorSet_array(VkCopyDescriptorSet_host *in, uint32_t count)
{
if (!in) return;
free(in);
}
#endif /* USE_STRUCT_CONVERSION */
static inline VkPhysicalDevice *convert_VkPhysicalDevice_array_win_to_host(const VkPhysicalDevice *in, uint32_t count)
{
VkPhysicalDevice *out;
unsigned int i;
if (!in) return NULL;
out = malloc(count * sizeof(*out));
for (i = 0; i < count; i++)
{
out[i] = in[i]->phys_dev;
}
return out;
}
static inline void free_VkPhysicalDevice_array(VkPhysicalDevice *in, uint32_t count)
{
if (!in) return;
free(in);
}
VkResult convert_VkDeviceCreateInfo_struct_chain(const void *pNext, VkDeviceCreateInfo *out_struct)
{
VkBaseOutStructure *out_header = (VkBaseOutStructure *)out_struct;
......@@ -2310,7 +2693,7 @@ VkResult convert_VkDeviceCreateInfo_struct_chain(const void *pNext, VkDeviceCrea
out->sType = in->sType;
out->pNext = NULL;
out->physicalDeviceCount = in->physicalDeviceCount;
out->pPhysicalDevices = in->pPhysicalDevices;
out->pPhysicalDevices = convert_VkPhysicalDevice_array_win_to_host(in->pPhysicalDevices, in->physicalDeviceCount);
out_header->pNext = (VkBaseOutStructure *)out;
out_header = out_header->pNext;
......@@ -3791,6 +4174,18 @@ void free_VkDeviceCreateInfo_struct_chain(VkDeviceCreateInfo *s)
while (header)
{
void *prev = header;
switch (header->sType)
{
case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO:
{
VkDeviceGroupDeviceCreateInfo *structure = (VkDeviceGroupDeviceCreateInfo *) header;
free_VkPhysicalDevice_array((VkPhysicalDevice *)structure->pPhysicalDevices, structure->physicalDeviceCount);
break;
}
default:
break;
}
header = header->pNext;
free(prev);
}
......@@ -3906,6 +4301,12 @@ void free_VkInstanceCreateInfo_struct_chain(VkInstanceCreateInfo *s)
while (header)
{
void *prev = header;
switch (header->sType)
{
default:
break;
}
header = header->pNext;
free(prev);
}
......@@ -5718,17 +6119,26 @@ VkResult WINAPI wine_vkCreateShaderModule(VkDevice device, const VkShaderModuleC
return device->funcs.p_vkCreateShaderModule(device->device, pCreateInfo, NULL, pShaderModule);
}
VkResult thunk_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
VkResult WINAPI wine_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
{
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkSwapchainCreateInfoKHR_host pCreateInfo_host;
TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pSwapchain);
convert_VkSwapchainCreateInfoKHR_win_to_host(pCreateInfo, &pCreateInfo_host);
result = device->funcs.p_vkCreateSwapchainKHR(device->device, &pCreateInfo_host, NULL, pSwapchain);
return result;
#else
return device->funcs.p_vkCreateSwapchainKHR(device->device, pCreateInfo, NULL, pSwapchain);
VkResult result;
VkSwapchainCreateInfoKHR pCreateInfo_host;
TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pSwapchain);
convert_VkSwapchainCreateInfoKHR_win_to_host(pCreateInfo, &pCreateInfo_host);
result = device->funcs.p_vkCreateSwapchainKHR(device->device, &pCreateInfo_host, NULL, pSwapchain);
return result;
#endif
}
......@@ -6726,7 +7136,12 @@ VkResult thunk_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physi
return result;
#else
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice->phys_dev, pSurfaceInfo, pSurfaceCapabilities);
VkResult result;
VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host;
convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(pSurfaceInfo, &pSurfaceInfo_host);
result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice->phys_dev, &pSurfaceInfo_host, pSurfaceCapabilities);
return result;
#endif
}
......@@ -6735,17 +7150,26 @@ VkResult thunk_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physic
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice->phys_dev, wine_surface_from_handle(surface)->driver_surface, pSurfaceCapabilities);
}
VkResult thunk_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats)
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats)
{
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkPhysicalDeviceSurfaceInfo2KHR_host pSurfaceInfo_host;
TRACE("%p, %p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(pSurfaceInfo, &pSurfaceInfo_host);
result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice->phys_dev, &pSurfaceInfo_host, pSurfaceFormatCount, pSurfaceFormats);
return result;
#else
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice->phys_dev, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
VkResult result;
VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo_host;
TRACE("%p, %p, %p, %p\n", physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
convert_VkPhysicalDeviceSurfaceInfo2KHR_win_to_host(pSurfaceInfo, &pSurfaceInfo_host);
result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice->phys_dev, &pSurfaceInfo_host, pSurfaceFormatCount, pSurfaceFormats);
return result;
#endif
}
......@@ -7017,8 +7441,15 @@ static VkResult WINAPI wine_vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCoun
free_VkSubmitInfo2KHR_array(pSubmits_host, submitCount);
return result;
#else
VkResult result;
VkSubmitInfo2KHR *pSubmits_host;
TRACE("%p, %u, %p, 0x%s\n", queue, submitCount, pSubmits, wine_dbgstr_longlong(fence));
return queue->device->funcs.p_vkQueueSubmit2KHR(queue->queue, submitCount, pSubmits, fence);
pSubmits_host = convert_VkSubmitInfo2KHR_array_win_to_host(pSubmits, submitCount);
result = queue->device->funcs.p_vkQueueSubmit2KHR(queue->queue, submitCount, pSubmits_host, fence);
free_VkSubmitInfo2KHR_array(pSubmits_host, submitCount);
return result;
#endif
}
......
......@@ -22,7 +22,6 @@ VkResult WINAPI wine_vkCreateDebugReportCallbackEXT(VkInstance instance, const V
VkResult WINAPI wine_vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice);
VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance);
VkResult WINAPI wine_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain);
VkResult WINAPI wine_vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
VkResult WINAPI wine_vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) DECLSPEC_HIDDEN;
......@@ -58,7 +57,6 @@ VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice
VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities);
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities);
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats);
void WINAPI wine_vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t *pData) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence);
VkResult WINAPI wine_vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) DECLSPEC_HIDDEN;
......@@ -67,14 +65,12 @@ VkResult WINAPI wine_vkSetPrivateDataEXT(VkDevice device, VkObjectType objectTyp
void WINAPI wine_vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) DECLSPEC_HIDDEN;
/* Private thunks */
VkResult thunk_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) DECLSPEC_HIDDEN;
VkResult thunk_vkDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT *pNameInfo) DECLSPEC_HIDDEN;
VkResult thunk_vkDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT *pTagInfo) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats) DECLSPEC_HIDDEN;
VkResult thunk_vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) DECLSPEC_HIDDEN;
VkResult thunk_vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo) DECLSPEC_HIDDEN;
void thunk_vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) DECLSPEC_HIDDEN;
......@@ -867,6 +863,17 @@ typedef struct VkDebugMarkerObjectTagInfoEXT_host
} VkDebugMarkerObjectTagInfoEXT_host;
typedef struct VkPhysicalDeviceGroupProperties_host
{
VkStructureType sType;
void *pNext;
uint32_t physicalDeviceCount;
VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE];
VkBool32 subsetAllocation;
} VkPhysicalDeviceGroupProperties_host;
typedef VkPhysicalDeviceGroupProperties VkPhysicalDeviceGroupPropertiesKHR;
typedef struct VkMappedMemoryRange_host
{
VkStructureType sType;
......@@ -1280,6 +1287,20 @@ typedef struct VkBindSparseInfo_host
} VkBindSparseInfo_host;
typedef struct VkSubmitInfo_host
{
VkStructureType sType;
const void *pNext;
uint32_t waitSemaphoreCount;
const VkSemaphore *pWaitSemaphores;
const VkPipelineStageFlags *pWaitDstStageMask;
uint32_t commandBufferCount;
const VkCommandBuffer *pCommandBuffers;
uint32_t signalSemaphoreCount;
const VkSemaphore *pSignalSemaphores;
} VkSubmitInfo_host;
typedef struct VkSemaphoreSubmitInfoKHR_host
{
VkStructureType sType;
......@@ -1291,6 +1312,15 @@ typedef struct VkSemaphoreSubmitInfoKHR_host
} VkSemaphoreSubmitInfoKHR_host;
typedef struct VkCommandBufferSubmitInfoKHR_host
{
VkStructureType sType;
const void *pNext;
VkCommandBuffer commandBuffer;
uint32_t deviceMask;
} VkCommandBufferSubmitInfoKHR_host;
typedef struct VkSubmitInfo2KHR_host
{
VkStructureType sType;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment