winevulkan: Move need for output member copy check to needs_conversion.

This commit is contained in:
Jacek Caban 2022-11-11 19:51:36 +01:00 committed by Alexandre Julliard
parent 1e3d0c863c
commit 85f9960147

View file

@ -1956,19 +1956,7 @@ class VkStruct(Sequence):
# so that we have a chance to allocate buffers
if e.needs_conversion(conv, True, Direction.OUTPUT, is_const, check_extensions=False):
return True
elif not needs_output_copy and not is_const:
for m in e:
if m.name in ["sType", "pNext"]:
continue
# pointers will be handled by needs_conversion, but if we have any other non-const
# member, we may need to copy output
if not m.is_pointer() and not m.is_const():
needs_output_copy = True
break
# if output needs any copy and we need input conversion, then we also need output conversion
if needs_output_copy and self.needs_extensions_conversion(conv, Direction.INPUT):
return True
return False
def needs_conversion(self, conv, unwrap, direction, is_const, check_extensions=True):
@ -1982,6 +1970,8 @@ class VkStruct(Sequence):
if direction == Direction.OUTPUT and self.name == "VkImageCompressionControlEXT":
return False
needs_output_copy = False
for m in self.members:
if self.name == m.type:
continue
@ -2011,6 +2001,15 @@ class VkStruct(Sequence):
if m.needs_conversion(conv, unwrap, direction, is_const):
return True
# pointers will be handled by needs_conversion, but if we have any other non-const
# member, we may need to copy output
if direction == Direction.OUTPUT and not m.is_pointer() and not is_const and not m.is_const():
needs_output_copy = True
# if output needs any copy and we need input conversion, then we also need output conversion
if needs_output_copy and self.needs_conversion(conv, unwrap, Direction.INPUT, check_extensions):
return True
return check_extensions and self.needs_extensions_conversion(conv, direction)
def needs_alloc(self, conv, unwrap):