mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
anv: make sure the extensions stay sorted
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
bc76ce1033
commit
8cbfcab425
1 changed files with 20 additions and 0 deletions
|
|
@ -141,6 +141,26 @@ EXTENSIONS = [
|
|||
Extension('VK_GOOGLE_hlsl_functionality1', 1, True),
|
||||
]
|
||||
|
||||
# Sort the extension list the way we expect: KHR, then EXT, then vendors
|
||||
# alphabetically. For digits, read them as a whole number sort that.
|
||||
# eg.: VK_KHR_8bit_storage < VK_KHR_16bit_storage < VK_EXT_acquire_xlib_display
|
||||
def extension_order(ext):
|
||||
order = []
|
||||
for substring in re.split('(KHR|EXT|[0-9]+)', ext.name):
|
||||
if substring == 'KHR':
|
||||
order.append(1)
|
||||
if substring == 'EXT':
|
||||
order.append(2)
|
||||
elif substring.isdigit():
|
||||
order.append(int(substring))
|
||||
else:
|
||||
order.append(substring)
|
||||
return order
|
||||
for i in range(len(EXTENSIONS) - 1):
|
||||
if extension_order(EXTENSIONS[i + 1]) < extension_order(EXTENSIONS[i]):
|
||||
print(EXTENSIONS[i + 1].name + ' should come before ' + EXTENSIONS[i].name)
|
||||
exit(1)
|
||||
|
||||
class VkVersion:
|
||||
def __init__(self, string):
|
||||
split = string.split('.')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue