Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4f343c0 authored by Shambhavi Shanker's avatar Shambhavi Shanker Committed by Android (Google) Code Review
Browse files

Merge "Refactor: Group VK_API_VERSION constants into a map" into main

parents fe2ccd6c 2e0be5c2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -468,13 +468,13 @@ VK_SHADER_INDEX_UNUSED_AMDX = 4294967295

# --- Computed VK_API_VERSION Constants ---

VK_API_VERSION = 4194304
VK_API_VERSION_1_0 = 4194304
VK_API_VERSION_1_1 = 4198400
VK_API_VERSION_1_2 = 4202496
VK_API_VERSION_1_3 = 4206592
VK_API_VERSION_1_4 = 4210688

VK_API_VERSION_MAP = {
    "VK_API_VERSION_1_0": 4194304,
    "VK_API_VERSION_1_1": 4198400,
    "VK_API_VERSION_1_2": 4202496,
    "VK_API_VERSION_1_3": 4206592,
    "VK_API_VERSION_1_4": 4210688,
}

# --- VkFlags Type Aliases ---

+7 −4
Original line number Diff line number Diff line
@@ -364,10 +364,13 @@ def write_api_constants(xml_root: ET.Element, vk_py_file_handle: IO[str]):
    """Extracts VK_API_VERSION defines, computes their integer values, and writes them to vk.py."""
    version_defines = extract_make_api_versions(xml_root)
    version_content = "# --- Computed VK_API_VERSION Constants --- \n\n"
    for name, version in version_defines.items():
    version_content += "VK_API_VERSION_MAP = {\n"
    version_defines_items = list(version_defines.items())
    if(len(version_defines_items)>1):
        for name, version in version_defines_items[1:]:
            packed_value = vk_make_api_version(version[0], version[1], version[2], version[3])
        version_content += f"{name} = {packed_value}\n"
    version_content += "\n\n"
            version_content += f'    "{name}": {packed_value},\n'
    version_content += "}\n\n"
    write_py_file(vk_py_file_handle, version_content)