From: Charles Giessen Date: Fri, 23 Jun 2023 03:46:17 +0000 (-0600) Subject: Cleanup test layer GIPA & GDPA function exports X-Git-Tag: upstream/1.3.268~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da7778dea71319e6f5efdeda1eb0679481fe482e;p=platform%2Fupstream%2FVulkan-Loader.git Cleanup test layer GIPA & GDPA function exports Splits apart the Version 0 layer into one with 'vkGetInstanceProcAddr' and one with 'test_layerGetInstanceProcAddr' (with a similar change for vkGetDeviceprocAddr). This is more in line with how layers in the wild are written. Removes the NO_PREFIX GIPA & GDPA exports as that is not supported by the loader. --- diff --git a/tests/framework/layer/CMakeLists.txt b/tests/framework/layer/CMakeLists.txt index 7d537792..a6240623 100644 --- a/tests/framework/layer/CMakeLists.txt +++ b/tests/framework/layer/CMakeLists.txt @@ -16,13 +16,15 @@ # ~~~ set(TEST_LAYER_BASE_EXPORTS TEST_LAYER_EXPORT_ENUMERATE_FUNCTIONS=1) -set(TEST_LAYER_VERSION_0_EXPORTS ${TEST_LAYER_BASE_EXPORTS} TEST_LAYER_EXPORT_LAYER_NAMED_GIPA=1 TEST_LAYER_EXPORT_LAYER_NAMED_GDPA=1) -set(TEST_LAYER_VERSION_1_EXPORTS ${TEST_LAYER_VERSION_0_EXPORTS} TEST_LAYER_EXPORT_NO_PREFIX_GIPA=1 TEST_LAYER_EXPORT_NO_PREFIX_GDPA=1) +set(TEST_LAYER_VERSION_0_EXPORTS ${TEST_LAYER_BASE_EXPORTS} TEST_LAYER_EXPORT_LAYER_VK_GIPA=1 TEST_LAYER_EXPORT_LAYER_VK_GDPA=1) +set(TEST_LAYER_VERSION_0_NAMED_GPA_EXPORTS ${TEST_LAYER_BASE_EXPORTS} TEST_LAYER_EXPORT_LAYER_NAMED_GIPA=1 TEST_LAYER_EXPORT_LAYER_NAMED_GDPA=1) +set(TEST_LAYER_VERSION_1_EXPORTS ${TEST_LAYER_VERSION_0_EXPORTS} TEST_LAYER_EXPORT_OVERRIDE_GIPA=1 TEST_LAYER_EXPORT_OVERRIDE_GDPA=1) set(TEST_LAYER_VERSION_2_EXPORTS ${TEST_LAYER_VERSION_1_EXPORTS} TEST_LAYER_EXPORT_GET_PHYSICAL_DEVICE_PROC_ADDR=1 LAYER_EXPORT_NEGOTIATE_LOADER_LAYER_INTERFACE_VERSION=1) AddSharedLibrary(test_layer_export_base DEF_FILE test_layer_base SOURCES test_layer.cpp DEFINITIONS ${TEST_LAYER_BASE_EXPORTS}) AddSharedLibrary(test_layer_export_version_0 DEF_FILE test_layer_0 SOURCES test_layer.cpp DEFINITIONS ${TEST_LAYER_VERSION_0_EXPORTS}) +AddSharedLibrary(test_layer_export_version_0_named_gpa DEF_FILE test_layer_0_named_gpa SOURCES test_layer.cpp DEFINITIONS ${TEST_LAYER_VERSION_0_NAMED_GPA_EXPORTS}) AddSharedLibrary(test_layer_export_version_1 DEF_FILE test_layer_1 SOURCES test_layer.cpp DEFINITIONS ${TEST_LAYER_VERSION_1_EXPORTS}) AddSharedLibrary(test_layer_export_version_2 DEF_FILE test_layer_2 SOURCES test_layer.cpp DEFINITIONS ${TEST_LAYER_VERSION_2_EXPORTS}) diff --git a/tests/framework/layer/export_definitions/test_layer_0.def b/tests/framework/layer/export_definitions/test_layer_0.def index b2406352..7be478a4 100644 --- a/tests/framework/layer/export_definitions/test_layer_0.def +++ b/tests/framework/layer/export_definitions/test_layer_0.def @@ -4,5 +4,5 @@ EXPORTS vkEnumerateInstanceExtensionProperties vkEnumerateDeviceLayerProperties vkEnumerateDeviceExtensionProperties - test_layer_GetInstanceProcAddr - test_layer_GetDeviceProcAddr \ No newline at end of file + vkGetInstanceProcAddr + vkGetDeviceProcAddr diff --git a/tests/framework/layer/export_definitions/test_layer_0_named_gpa.def b/tests/framework/layer/export_definitions/test_layer_0_named_gpa.def new file mode 100644 index 00000000..b2406352 --- /dev/null +++ b/tests/framework/layer/export_definitions/test_layer_0_named_gpa.def @@ -0,0 +1,8 @@ +LIBRARY test_layer_export_version_0 +EXPORTS + vkEnumerateInstanceLayerProperties + vkEnumerateInstanceExtensionProperties + vkEnumerateDeviceLayerProperties + vkEnumerateDeviceExtensionProperties + test_layer_GetInstanceProcAddr + test_layer_GetDeviceProcAddr \ No newline at end of file diff --git a/tests/framework/layer/export_definitions/test_layer_1.def b/tests/framework/layer/export_definitions/test_layer_1.def index 373507d3..da95aa8b 100644 --- a/tests/framework/layer/export_definitions/test_layer_1.def +++ b/tests/framework/layer/export_definitions/test_layer_1.def @@ -4,8 +4,6 @@ EXPORTS vkEnumerateInstanceExtensionProperties vkEnumerateDeviceLayerProperties vkEnumerateDeviceExtensionProperties - test_layer_GetInstanceProcAddr - test_layer_GetDeviceProcAddr - GetInstanceProcAddr - GetDeviceProcAddr - test_override_vkGetInstanceProcAddr \ No newline at end of file + vkGetInstanceProcAddr + vkGetDeviceProcAddr + test_override_vkGetInstanceProcAddr diff --git a/tests/framework/layer/export_definitions/test_layer_2.def b/tests/framework/layer/export_definitions/test_layer_2.def index a29167ba..7db1e749 100644 --- a/tests/framework/layer/export_definitions/test_layer_2.def +++ b/tests/framework/layer/export_definitions/test_layer_2.def @@ -4,13 +4,11 @@ EXPORTS vkEnumerateInstanceExtensionProperties vkEnumerateDeviceLayerProperties vkEnumerateDeviceExtensionProperties - test_layer_GetInstanceProcAddr - test_layer_GetDeviceProcAddr - GetInstanceProcAddr - GetDeviceProcAddr + vkGetInstanceProcAddr + vkGetDeviceProcAddr vk_layerGetPhysicalDeviceProcAddr vkNegotiateLoaderLayerInterfaceVersion test_preinst_vkEnumerateInstanceLayerProperties test_preinst_vkEnumerateInstanceExtensionProperties test_preinst_vkEnumerateInstanceVersion - test_override_vkGetInstanceProcAddr \ No newline at end of file + test_override_vkGetInstanceProcAddr diff --git a/tests/framework/layer/test_layer.cpp b/tests/framework/layer/test_layer.cpp index f6c2caac..a38553b4 100644 --- a/tests/framework/layer/test_layer.cpp +++ b/tests/framework/layer/test_layer.cpp @@ -39,6 +39,11 @@ #define TEST_LAYER_EXPORT_LAYER_NAMED_GIPA 0 #endif +// export test_override_GetInstanceProcAddr +#if !defined(TEST_LAYER_EXPORT_OVERRIDE_GIPA) +#define TEST_LAYER_EXPORT_OVERRIDE_GIPA 0 +#endif + // export vkGetInstanceProcAddr #if !defined(TEST_LAYER_EXPORT_LAYER_VK_GIPA) #define TEST_LAYER_EXPORT_LAYER_VK_GIPA 0 @@ -49,21 +54,16 @@ #define TEST_LAYER_EXPORT_LAYER_NAMED_GDPA 0 #endif +// export test_override_GetDeviceProcAddr +#if !defined(TEST_LAYER_EXPORT_OVERRIDE_GDPA) +#define TEST_LAYER_EXPORT_OVERRIDE_GDPA 0 +#endif + // export vkGetDeviceProcAddr #if !defined(TEST_LAYER_EXPORT_LAYER_VK_GDPA) #define TEST_LAYER_EXPORT_LAYER_VK_GDPA 0 #endif -// export GetInstanceProcAddr -#if !defined(TEST_LAYER_EXPORT_NO_PREFIX_GIPA) -#define TEST_LAYER_EXPORT_NO_PREFIX_GIPA 0 -#endif - -// export GetDeviceProcAddr -#if !defined(TEST_LAYER_EXPORT_NO_PREFIX_GDPA) -#define TEST_LAYER_EXPORT_NO_PREFIX_GDPA 0 -#endif - // export vk_layerGetPhysicalDeviceProcAddr #if !defined(TEST_LAYER_EXPORT_GET_PHYSICAL_DEVICE_PROC_ADDR) #define TEST_LAYER_EXPORT_GET_PHYSICAL_DEVICE_PROC_ADDR 0 @@ -726,6 +726,9 @@ FRAMEWORK_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProper FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL test_layer_GetInstanceProcAddr(VkInstance instance, const char* pName) { return get_instance_func(instance, pName); } +#endif + +#if TEST_LAYER_EXPORT_OVERRIDE_GIPA FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL test_override_vkGetInstanceProcAddr(VkInstance instance, const char* pName) { if (string_eq(pName, "vkCreateInstance")) return to_vkVoidFunction(test_override_vkCreateInstance); @@ -745,20 +748,14 @@ FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL test_layer_GetDevicePr } #endif -#if TEST_LAYER_EXPORT_LAYER_VK_GDPA -FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* pName) { +#if TEST_LAYER_EXPORT_OVERRIDE_GDPA +FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL test_override_GetDeviceProcAddr(VkDevice device, const char* pName) { return get_device_func(device, pName); } #endif -#if TEST_LAYER_EXPORT_NO_PREFIX_GIPA -FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char* pName) { - return get_instance_func(instance, pName); -} -#endif - -#if TEST_LAYER_EXPORT_NO_PREFIX_GDPA -FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char* pName) { +#if TEST_LAYER_EXPORT_LAYER_VK_GDPA +FRAMEWORK_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* pName) { return get_device_func(device, pName); } #endif