anv/entrypoints: Generate #ifdef guards from platform attributes
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 17 Oct 2017 04:46:55 +0000 (21:46 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Mar 2018 20:13:47 +0000 (12:13 -0800)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/vulkan/anv_entrypoints_gen.py

index fbbbf896a6ce6a2eb25af40e2217d08832857235..55ebd169064c60f6015627ba7c7b8c88311e57c7 100644 (file)
@@ -512,6 +512,14 @@ def get_entrypoints_defines(doc):
             fullname = entrypoint.attrib['name']
             entrypoints_to_defines[fullname] = define
 
+    for extension in doc.findall('./extensions/extension[@platform]'):
+        platform = extension.attrib['platform']
+        define = 'VK_USE_PLATFORM_' + platform.upper() + '_KHR'
+
+        for entrypoint in extension.findall('./require/command'):
+            fullname = entrypoint.attrib['name']
+            entrypoints_to_defines[fullname] = define
+
     return entrypoints_to_defines