from anv_extensions import *
+platform_defines = []
+
def _init_exts_from_xml(xml):
""" Walk the Vulkan XML and fill out extra extension information. """
for ext in EXTENSIONS:
ext_name_map[ext.name] = ext
+ for platform in xml.findall('./platforms/platform'):
+ platform_defines.append(platform.attrib['protect'])
+
for ext_elem in xml.findall('.extensions/extension'):
ext_name = ext_elem.attrib['name']
if ext_name not in ext_name_map:
#include "vk_util.h"
/* Convert the VK_USE_PLATFORM_* defines to booleans */
-%for platform in ['ANDROID_KHR', 'WAYLAND_KHR', 'XCB_KHR', 'XLIB_KHR', 'DISPLAY_KHR', 'XLIB_XRANDR_EXT']:
-#ifdef VK_USE_PLATFORM_${platform}
-# undef VK_USE_PLATFORM_${platform}
-# define VK_USE_PLATFORM_${platform} true
+%for platform_define in platform_defines:
+#ifdef ${platform_define}
+# undef ${platform_define}
+# define ${platform_define} true
#else
-# define VK_USE_PLATFORM_${platform} false
+# define ${platform_define} false
#endif
%endfor
'MAX_API_VERSION': MAX_API_VERSION,
'instance_extensions': [e for e in EXTENSIONS if e.type == 'instance'],
'device_extensions': [e for e in EXTENSIONS if e.type == 'device'],
+ 'platform_defines': platform_defines,
}
if args.out_h: