INNER CODE UNIT · Python
generate_passthru
mosra/flextgl · flext.py:804
def generate_passthru(dependencies, types):
written_types = set()
def write_type(type, written_types, passthru):
# We're handling vk_platform ( khrplatform ourselves; VK_API_VERSION is
# deprecated
if not type.definition or type.name in ['vk_platform', 'khrplatform', 'VK_API_VERSION']:
return passthru
# Ensure all dependencies are written already. Using a simple linear
# search because this occurs for only like three or four types in the
# whole vk.xml, so I don't really care about performance. Vulkan
# bitmask types have enum dependencies, but that's not enforced by the
# type system so we don't need to handle that. Explicitly sorting the
# dependencies to get a deterministic order.
if not type.is_bitmask:
for dependency in sorted(type.required_types):
if dependency in written_types: continue