android: Fix android build.
Temporarily disable shader checker which now depends on glslang
Fix xcb guards and set the ifdef based on platform
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index cc1fb42..5218ec5 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -3,6 +3,7 @@
# VK
#
# Copyright (C) 2015 Valve Corporation
+# Copyright (C) 2015 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -430,8 +431,12 @@
func_body.append(' {')
extra_space = " "
for ext_name in ext_list:
+ if 'Xcb' in ext_name:
+ func_body.append("#ifdef VK_USE_PLATFORM_XCB_KHR")
func_body.append(' %sif (!strcmp("%s", funcName))\n'
' return reinterpret_cast<PFN_vkVoidFunction>(%s);' % (extra_space, ext_name, ext_name))
+ if 'Xcb' in ext_name:
+ func_body.append("#endif //VK_USE_PLATFORM_XCB_KHR")
if 0 != len(ext_enable):
func_body.append(' }\n')
@@ -536,8 +541,12 @@
func_body.append(' {')
extra_space = " "
for ext_name in ext_list:
+ if 'Xcb' in ext_name:
+ func_body.append('#ifdef VK_USE_PLATFORM_XCB_KHR')
func_body.append(' %sif (!strcmp("%s", funcName))\n'
' return reinterpret_cast<PFN_vkVoidFunction>(%s);' % (extra_space, ext_name, ext_name))
+ if 'Xcb' in ext_name:
+ func_body.append('#endif //VK_USE_PLATFORM_XCB_KHR')
if 0 != len(ext_enable):
func_body.append(' }\n')
@@ -739,6 +748,8 @@
' return result;\n'
'}\n' % (qual, decl, ret_val, proto.c_call(), proto.name))
else:
+ if 'Xcb' in proto.name:
+ funcs.append("#ifdef VK_USE_PLATFORM_XCB_KHR")
funcs.append('%s' % self.lineinfo.get())
dispatch_param = proto.params[0].name
# Must use 'instance' table for these APIs, 'device' table otherwise
@@ -752,6 +763,8 @@
' %s%s_dispatch_table(%s)->%s;\n'
'%s'
'}' % (qual, decl, ret_val, table_type, dispatch_param, proto.c_call(), stmt))
+ if 'Xcb' in proto.name:
+ funcs.append("#endif //VK_USE_PLATFORM_XCB_KHR")
return "\n\n".join(funcs)
def generate_body(self):
@@ -1159,6 +1172,8 @@
'%s'
'}' % (qual, decl, table_type, dispatch_param, ret_val, proto.c_call(), f_open, log_func, f_close, stmt))
else:
+ if 'Xcb' in decl:
+ funcs.append('#ifdef VK_USE_PLATFORM_XCB_KHR')
funcs.append('%s%s\n'
'{\n'
' using namespace StreamControl;\n'
@@ -1166,25 +1181,27 @@
' %s%s%s\n'
'%s'
'}' % (qual, decl, ret_val, table_type, dispatch_param, proto.c_call(), f_open, log_func, f_close, stmt))
+ if 'Xcb' in decl:
+ funcs.append('#endif //VK_USE_PLATFORM_XCB_KHR')
return "\n\n".join(funcs)
def generate_body(self):
self.layer_name = "APIDump"
- if sys.platform == 'win32':
- instance_extensions=[('wsi_enabled',
- ['vkGetPhysicalDeviceSurfaceSupportKHR',
- 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
- 'vkGetPhysicalDeviceSurfaceFormatsKHR',
- 'vkGetPhysicalDeviceSurfacePresentModesKHR',
- 'vkCreateWin32SurfaceKHR',
- 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
- else:
- instance_extensions=[('wsi_enabled',
- ['vkGetPhysicalDeviceSurfaceSupportKHR',
- 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
- 'vkGetPhysicalDeviceSurfaceFormatsKHR',
- 'vkGetPhysicalDeviceSurfacePresentModesKHR',
- 'vkCreateXcbSurfaceKHR',
+ if sys.platform == 'win32':
+ instance_extensions=[('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateWin32SurfaceKHR',
+ 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
+ else:
+ instance_extensions=[('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateXcbSurfaceKHR',
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
extensions=[('wsi_enabled',
['vkCreateSwapchainKHR',
@@ -1707,6 +1724,8 @@
table_type = "instance"
else:
table_type = "device"
+ if 'Xcb' in proto.name:
+ funcs.append("#ifdef VK_USE_PLATFORM_XCB_KHR")
funcs.append('%s%s\n'
'{\n'
'%s'
@@ -1715,6 +1734,8 @@
'%s'
'%s'
'}' % (qual, decl, using_line, destroy_line, ret_val, table_type, dispatch_param, proto.c_call(), create_line, stmt))
+ if 'Xcb' in proto.name:
+ funcs.append("#endif //VK_USE_PLATFORM_XCB_KHR")
return "\n\n".join(funcs)
def generate_body(self):
@@ -1723,23 +1744,23 @@
['vkCreateSwapchainKHR',
'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR',
'vkAcquireNextImageKHR', 'vkQueuePresentKHR'])]
- if sys.platform == 'win32':
- instance_extensions=[('msg_callback_get_proc_addr', []),
- ('wsi_enabled',
- ['vkGetPhysicalDeviceSurfaceSupportKHR',
- 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
- 'vkGetPhysicalDeviceSurfaceFormatsKHR',
- 'vkGetPhysicalDeviceSurfacePresentModesKHR',
- 'vkCreateWin32SurfaceKHR',
- 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
- else:
- instance_extensions=[('msg_callback_get_proc_addr', []),
- ('wsi_enabled',
- ['vkGetPhysicalDeviceSurfaceSupportKHR',
- 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
- 'vkGetPhysicalDeviceSurfaceFormatsKHR',
- 'vkGetPhysicalDeviceSurfacePresentModesKHR',
- 'vkCreateXcbSurfaceKHR',
+ if sys.platform == 'win32':
+ instance_extensions=[('msg_callback_get_proc_addr', []),
+ ('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateWin32SurfaceKHR',
+ 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
+ else:
+ instance_extensions=[('msg_callback_get_proc_addr', []),
+ ('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateXcbSurfaceKHR',
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
body = [self.generate_maps(),
self.generate_procs(),