INNER CODE UNIT · Python

parse_xml_features

mosra/flextgl · flext.py:648

def parse_xml_features(root, version):
    enum_extensions = {}
    promoted_enum_extensions = {}
    subsets = []

    feature_set = set()
    for feature in root.findall("./feature[@api][@name][@number]"):
        # While GL has just `api="gl"` for example, Vulkam now has
        # `api="vulkan,vulkansc,vulkanbase"` etc., so we can't just match the
        # whole atttribute value via an XQuery expression above and have to
        # check if it's in the list instead
        if version.api not in feature.attrib['api'].split(','):
            continue

        # Some Vulkan extension enums get promoted to core in later versions
        # and we can't ignore them because the extension enums would then alias
        # to nonexistent values
        if (parse_int_version(feature.attrib['number'])>version.int_value()):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…