Commit a6cd7ee2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winevulkan: Remove unneeded needs_conversion() calls.

parent 844f1b17
...@@ -654,19 +654,6 @@ class VkFunction(object): ...@@ -654,19 +654,6 @@ class VkFunction(object):
def returns_longlong(self): def returns_longlong(self):
return self.type in ["uint64_t", "VkDeviceAddress"] return self.type in ["uint64_t", "VkDeviceAddress"]
def needs_conversion(self):
""" Check if the function needs any input/output type conversion.
Functions need input/output conversion if struct parameters have
alignment differences between Win32 and Linux 32-bit.
"""
for p in self.params:
if p.needs_conversion():
LOGGER.debug("Parameter {0} to {1} requires conversion".format(p.name, self.name))
return True
return False
def needs_unwrapping(self): def needs_unwrapping(self):
""" Check if the function needs any input/output type unwrapping. """ Check if the function needs any input/output type unwrapping.
Functions need input/output unwrapping if struct parameters have Functions need input/output unwrapping if struct parameters have
...@@ -1098,9 +1085,6 @@ class VkHandle(object): ...@@ -1098,9 +1085,6 @@ class VkHandle(object):
def is_wrapped(self): def is_wrapped(self):
return self.native_handle("test") is not None return self.native_handle("test") is not None
def needs_conversion(self):
return False
def needs_unwrapping(self): def needs_unwrapping(self):
return self.is_wrapped() return self.is_wrapped()
...@@ -1384,20 +1368,17 @@ class VkMember(VkVariable): ...@@ -1384,20 +1368,17 @@ class VkMember(VkVariable):
def get_conversions(self, func=None): def get_conversions(self, func=None):
""" Return any conversion description for this member and its children when conversion is needed. """ """ Return any conversion description for this member and its children when conversion is needed. """
# 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() and not self.needs_unwrapping():
return None
conversions = [] conversions = []
# Collect any conversion for any member structs. # Collect any conversion for any member structs.
if self.is_struct(): if self.is_struct():
struct = self.type_info["data"] struct = self.type_info["data"]
for m in struct: for m in struct:
if m.type == struct.name:
continue
m.needs_struct_extensions_conversion() m.needs_struct_extensions_conversion()
if m.needs_conversion() or m.needs_unwrapping(): conversions.extend(m.get_conversions(func))
conversions.extend(m.get_conversions(func))
struct.needs_struct_extensions_conversion() struct.needs_struct_extensions_conversion()
direction = Direction.OUTPUT if struct.returnedonly else Direction.INPUT direction = Direction.OUTPUT if struct.returnedonly else Direction.INPUT
...@@ -1640,9 +1621,6 @@ class VkParam(VkVariable): ...@@ -1640,9 +1621,6 @@ class VkParam(VkVariable):
elif not self.is_handle(): elif not self.is_handle():
return None return None
if not self.needs_conversion() and not self.needs_unwrapping():
return None
conversions = [] conversions = []
# Collect any member conversions first, so we can guarantee # Collect any member conversions first, so we can guarantee
...@@ -1653,9 +1631,6 @@ class VkParam(VkVariable): ...@@ -1653,9 +1631,6 @@ class VkParam(VkVariable):
if not m.is_struct(): if not m.is_struct():
continue continue
if not m.needs_conversion() and not m.needs_unwrapping():
continue
conversions.extend(m.get_conversions(func)) conversions.extend(m.get_conversions(func))
# Conversion requirements for the 'parent' parameter. # Conversion requirements for the 'parent' parameter.
...@@ -2334,9 +2309,6 @@ class VkGenerator(object): ...@@ -2334,9 +2309,6 @@ class VkGenerator(object):
if not func.is_required(): if not func.is_required():
continue continue
if not func.needs_conversion() and not func.needs_unwrapping():
continue
conversions = func.get_conversions() conversions = func.get_conversions()
for conv in conversions: for conv in conversions:
# Append if we don't already have this conversion. # Append if we don't already have this conversion.
......
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