From: Karl Schultz Date: Tue, 8 Mar 2016 22:14:11 +0000 (-0700) Subject: codegen: LX424 Generate code for WSI-specific funs in GIPA. X-Git-Tag: submit/tizen/20181227.054638~3630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b37b2561bd2de539918ddd660a2ccd64fe4dd7e;p=platform%2Fupstream%2FVulkan-Tools.git codegen: LX424 Generate code for WSI-specific funs in GIPA. For the unique_objects and object_tracker layers, generate system types (xcb, xlib, wayland, mir) in GetInstanceProcAddr. The previous code would only generate code for one display system, even if more than one was selected by the CMake config. The code to return these proc addresses is conditionally compiled with the corresponding USE_PLATFORM #ifdef, and the CMake config can go ahead and set multiple USE_PLATFORM defines. The result is that GIPA resolves proc address requests for these functions and allows them to be hooked properly when the layers are loaded. Change-Id: I2fa38847863f0a1187dd17d882ef9d94f546527f --- diff --git a/vk-layer-generate.py b/vk-layer-generate.py index f3868b9f..6e4fb4bd 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -1418,7 +1418,7 @@ class ObjectTrackerSubcommand(Subcommand): 'vkGetPhysicalDeviceSurfaceFormatsKHR', 'vkGetPhysicalDeviceSurfacePresentModesKHR', 'vkCreateAndroidSurfaceKHR'])] - elif self.wsi == 'Xcb': + elif self.wsi == 'Xcb' or self.wsi == 'Xlib' or self.wsi == 'Wayland' or self.wsi == 'Mir': instance_extensions=[('msg_callback_get_proc_addr', []), ('wsi_enabled', ['vkDestroySurfaceKHR', @@ -1427,35 +1427,11 @@ class ObjectTrackerSubcommand(Subcommand): 'vkGetPhysicalDeviceSurfaceFormatsKHR', 'vkGetPhysicalDeviceSurfacePresentModesKHR', 'vkCreateXcbSurfaceKHR', - 'vkGetPhysicalDeviceXcbPresentationSupportKHR'])] - elif self.wsi == 'Xlib': - instance_extensions=[('msg_callback_get_proc_addr', []), - ('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', + 'vkGetPhysicalDeviceXcbPresentationSupportKHR', 'vkCreateXlibSurfaceKHR', - 'vkGetPhysicalDeviceXlibPresentationSupportKHR'])] - elif self.wsi == 'Wayland': - instance_extensions=[('msg_callback_get_proc_addr', []), - ('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', + 'vkGetPhysicalDeviceXlibPresentationSupportKHR', 'vkCreateWaylandSurfaceKHR', - 'vkGetPhysicalDeviceWaylandPresentationSupportKHR'])] - elif self.wsi == 'Mir': - instance_extensions=[('msg_callback_get_proc_addr', []), - ('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', + 'vkGetPhysicalDeviceWaylandPresentationSupportKHR', 'vkCreateMirSurfaceKHR', 'vkGetPhysicalDeviceMirPresentationSupportKHR'])] else: @@ -1741,7 +1717,7 @@ class UniqueObjectsSubcommand(Subcommand): 'vkGetPhysicalDeviceSurfaceFormatsKHR', 'vkGetPhysicalDeviceSurfacePresentModesKHR', 'vkCreateAndroidSurfaceKHR'])] - elif self.wsi == 'Xcb': + elif self.wsi == 'Xcb' or self.wsi == 'Xlib' or self.wsi == 'Wayland' or self.wsi == 'Mir': instance_extensions=[('wsi_enabled', ['vkDestroySurfaceKHR', 'vkGetPhysicalDeviceSurfaceSupportKHR', @@ -1749,34 +1725,14 @@ class UniqueObjectsSubcommand(Subcommand): 'vkGetPhysicalDeviceSurfaceFormatsKHR', 'vkGetPhysicalDeviceSurfacePresentModesKHR', 'vkCreateXcbSurfaceKHR', - ])] - elif self.wsi == 'Xlib': - instance_extensions=[('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', - 'vkCreateXlibSurfaceKHR' - ])] - elif self.wsi == 'Wayland': - instance_extensions=[('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', - 'vkCreateWaylandSurfaceKHR' - ])] - else: #Mir - instance_extensions=[('wsi_enabled', - ['vkDestroySurfaceKHR', - 'vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', + 'vkCreateXlibSurfaceKHR', + 'vkCreateWaylandSurfaceKHR', 'vkCreateMirSurfaceKHR' ])] + else: + print('Error: Undefined DisplayServer') + instance_extensions=[] + body = [self._generate_dispatch_entrypoints("VK_LAYER_EXPORT"), self._generate_layer_gpa_function(extensions, instance_extensions)]