radv: apply the indexing workaround for atomic buffer operations on GFX9
[mesa.git] / src / amd / vulkan / radv_entrypoints_gen.py
index 892491e6c300381e92f9185664f5188e272edf12..946b10910c6e663d79ecbd620288179d8c862e12 100644 (file)
@@ -116,7 +116,7 @@ struct string_map_entry {
    uint32_t num;
 };
 
-/* We use a big string constant to avoid lots of reloctions from the entry
+/* We use a big string constant to avoid lots of relocations from the entry
  * point table to lots of little strings. The entries in the entry point table
  * store the index into this big string.
  */
@@ -136,7 +136,7 @@ static const struct string_map_entry string_map_entries[] = {
 /* Hash table stats:
  * size ${len(strmap.sorted_strings)} entries
  * collisions entries:
-% for i in xrange(10):
+% for i in range(10):
  *     ${i}${'+' if i == 9 else ' '}     ${strmap.collisions[i]}
 % endfor
  */
@@ -413,9 +413,6 @@ def get_entrypoints(doc, entrypoints_to_defines, start_index):
         if ext_name not in supported_exts:
             continue
 
-        if extension.attrib['supported'] != 'vulkan':
-            continue
-
         ext = supported_exts[ext_name]
         ext.type = extension.attrib['type']
 
@@ -433,7 +430,7 @@ def get_entrypoints(doc, entrypoints_to_defines, start_index):
             e_clone.name = e.name
             entrypoints[e.name] = e_clone
 
-    return [e for e in entrypoints.itervalues() if e.enabled]
+    return [e for e in entrypoints.values() if e.enabled]
 
 
 def get_entrypoints_defines(doc):
@@ -447,9 +444,15 @@ def get_entrypoints_defines(doc):
             fullname = entrypoint.attrib['name']
             entrypoints_to_defines[fullname] = define
 
+    platform_define = {}
+    for platform in doc.findall('./platforms/platform'):
+        name = platform.attrib['name']
+        define = platform.attrib['protect']
+        platform_define[name] = define
+
     for extension in doc.findall('./extensions/extension[@platform]'):
         platform = extension.attrib['platform']
-        define = 'VK_USE_PLATFORM_' + platform.upper() + '_KHR'
+        define = platform_define[platform]
 
         for entrypoint in extension.findall('./require/command'):
             fullname = entrypoint.attrib['name']