radv: use the platform defines in vk.xml instead of hard-coding them
authorEric Engestrom <eric.engestrom@intel.com>
Wed, 27 Feb 2019 12:20:56 +0000 (12:20 +0000)
committerEric Engestrom <eric@engestrom.ch>
Tue, 5 Mar 2019 11:57:10 +0000 (11:57 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/amd/vulkan/radv_entrypoints_gen.py

index 377b544c2aa7d0802848cb0d58e55fbf5e5c1816..946b10910c6e663d79ecbd620288179d8c862e12 100644 (file)
@@ -444,12 +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']
-        ext = '_KHR'
-        if platform.upper() == 'XLIB_XRANDR':
-            ext = '_EXT'
-        define = 'VK_USE_PLATFORM_' + platform.upper() + ext
+        define = platform_define[platform]
 
         for entrypoint in extension.findall('./require/command'):
             fullname = entrypoint.attrib['name']