summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-02-20 10:34:24 +0000
committerEric Engestrom <[email protected]>2019-02-20 14:28:55 +0000
commit8cbfcab425e4430f044f2c5bb20bc54f75b700a6 (patch)
tree3d2a589fa5d8a2ad39eb1bbf9836580ce060c20b /src/intel/vulkan
parentbc76ce1033e06448256d90a6e858644563641e75 (diff)
anv: make sure the extensions stay sorted
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_extensions.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
index 49ac28f9a84..a6c05d73c96 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -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('.')