From b1f38a308b4a71dbea6292bf8803539ab68fe0bf Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Thu, 18 Jun 2015 09:05:37 -0600 Subject: [PATCH] loader: Remove support for WSI as an instance extension WSI is now a device extension so remove loader support --- loader/loader.c | 9 +++++---- loader/loader.h | 1 - loader/trampoline.c | 2 -- loader/wsi_lunarg.c | 27 ++------------------------- loader/wsi_lunarg.h | 5 ----- 5 files changed, 7 insertions(+), 37 deletions(-) diff --git a/loader/loader.c b/loader/loader.c index d5f8f462..d4965a72 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -521,7 +521,6 @@ void loader_coalesce_extensions(void) // Traverse loader's extensions, adding non-duplicate extensions to the list debug_report_add_instance_extensions(&loader.global_extensions); - wsi_lunarg_add_instance_extensions(&loader.global_extensions); } static struct loader_icd *loader_get_icd_and_device(const VkDevice device, @@ -1321,7 +1320,7 @@ uint32_t loader_activate_instance_layers(struct loader_instance *inst) loader_platform_dl_handle lib_handle; /* - * For global exenstions implemented within the loader (i.e. WSI, DEBUG_REPORT + * For global exenstions implemented within the loader (i.e. DEBUG_REPORT * the extension must provide two entry points for the loader to use: * - "trampoline" entry point - this is the address returned by GetProcAddr * and will always do what's necessary to support a global call. @@ -1767,15 +1766,16 @@ LOADER_EXPORT void * VKAPI vkGetInstanceProcAddr(VkInstance instance, const char struct loader_instance *ptr_instance = (struct loader_instance *) instance; + /* return any extension global entrypoints */ addr = debug_report_instance_gpa(ptr_instance, pName); if (addr) { return addr; } - /* return any extension global entrypoints */ + /* TODO Remove this once WSI has no loader special code */ addr = wsi_lunarg_GetInstanceProcAddr(instance, pName); if (addr) - return (ptr_instance->wsi_lunarg_enabled) ? addr : NULL; + return addr; /* return the instance dispatch table entrypoint for extensions */ const VkLayerInstanceDispatchTable *disp_table = * (VkLayerInstanceDispatchTable **) instance; @@ -1805,6 +1805,7 @@ LOADER_EXPORT void * VKAPI vkGetDeviceProcAddr(VkDevice device, const char * pNa } /* return any extension device entrypoints the loader knows about */ + /* TODO once WSI has no loader special code remove this */ addr = wsi_lunarg_GetDeviceProcAddr(device, pName); if (addr) return addr; diff --git a/loader/loader.h b/loader/loader.h index d375ebcd..dfb04b08 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -212,7 +212,6 @@ struct loader_instance { VkExtensionProperties *app_extension_props; bool debug_report_enabled; - bool wsi_lunarg_enabled; VkLayerDbgFunctionNode *DbgFunctionHead; }; diff --git a/loader/trampoline.c b/loader/trampoline.c index 95e4545c..9b4d4508 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -26,7 +26,6 @@ #include "loader_platform.h" #include "loader.h" -#include "wsi_lunarg.h" #include "debug_report.h" #if defined(WIN32) @@ -88,7 +87,6 @@ LOADER_EXPORT VkResult VKAPI vkCreateInstance( loader_enable_instance_layers(ptr_instance); debug_report_create_instance(ptr_instance); - wsi_lunarg_create_instance(ptr_instance); /* enable any layers on instance chain */ loader_activate_instance_layers(ptr_instance); diff --git a/loader/wsi_lunarg.c b/loader/wsi_lunarg.c index 0269f272..77d0788e 100644 --- a/loader/wsi_lunarg.c +++ b/loader/wsi_lunarg.c @@ -33,7 +33,6 @@ /************ Trampoline entrypoints *******************/ /* since one entrypoint is instance level will make available all entrypoints */ -/* TODO make this a device extension with NO trampoline code */ VkResult wsi_lunarg_CreateSwapChainWSI( VkDevice device, @@ -87,31 +86,7 @@ static VkResult wsi_lunarg_QueuePresentWSI( return disp->QueuePresentWSI(queue, pPresentInfo); } -/************ extension enablement ***************/ -#define WSI_LUNARG_EXT_ARRAY_SIZE 1 -static const struct loader_extension_property wsi_lunarg_extension_info = { - .info = { - .sType = VK_STRUCTURE_TYPE_EXTENSION_PROPERTIES, - .name = VK_WSI_LUNARG_EXTENSION_NAME, - .version = VK_WSI_LUNARG_REVISION, - .description = "loader: LunarG WSI extension", - }, - .origin = VK_EXTENSION_ORIGIN_LOADER, -}; - -void wsi_lunarg_add_instance_extensions( - struct loader_extension_list *ext_list) -{ - loader_add_to_ext_list(ext_list, 1, &wsi_lunarg_extension_info); -} -void wsi_lunarg_create_instance( - struct loader_instance *ptr_instance) -{ - ptr_instance->wsi_lunarg_enabled = has_vk_extension_property( - &wsi_lunarg_extension_info.info, - &ptr_instance->enabled_instance_extensions); -} void *wsi_lunarg_GetInstanceProcAddr( VkInstance instance, @@ -120,6 +95,7 @@ void *wsi_lunarg_GetInstanceProcAddr( if (instance == VK_NULL_HANDLE) return NULL; + // TODO once WSI is pure device extension with no special trampoline code remove this function /* since one of these entrypoints must be loader handled will report all */ if (!strcmp(pName, "vkCreateSwapChainWSI")) return (void*) wsi_lunarg_CreateSwapChainWSI; @@ -140,6 +116,7 @@ void *wsi_lunarg_GetDeviceProcAddr( if (device == VK_NULL_HANDLE) return NULL; + // TODO make sure WSI is enabled, but eventually this function goes away /* only handle device entrypoints that are loader special cases */ if (!strcmp(name, "vkCreateSwapChainWSI")) return (void*) wsi_lunarg_CreateSwapChainWSI; diff --git a/loader/wsi_lunarg.h b/loader/wsi_lunarg.h index 6a79c492..9dcb3501 100644 --- a/loader/wsi_lunarg.h +++ b/loader/wsi_lunarg.h @@ -28,11 +28,6 @@ #include "vk_wsi_lunarg.h" -void wsi_lunarg_add_instance_extensions( - struct loader_extension_list *ext_list); - -void wsi_lunarg_create_instance( - struct loader_instance *ptr_instance); void *wsi_lunarg_GetInstanceProcAddr( VkInstance instance, -- 2.34.1