Cleanup test layer GIPA & GDPA function exports
authorCharles Giessen <charles@lunarg.com>
Fri, 23 Jun 2023 03:46:17 +0000 (21:46 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 23 Jun 2023 04:27:45 +0000 (22:27 -0600)
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.

tests/framework/layer/CMakeLists.txt
tests/framework/layer/export_definitions/test_layer_0.def
tests/framework/layer/export_definitions/test_layer_0_named_gpa.def [new file with mode: 0644]
tests/framework/layer/export_definitions/test_layer_1.def
tests/framework/layer/export_definitions/test_layer_2.def
tests/framework/layer/test_layer.cpp

index 7d53779213211ac4020f0cff82d44929c6d8be42..a624062389c04977b1cebce7802e5a64a387caf6 100644 (file)
 # ~~~
 
 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})
 
index b24063525e5dab056ec82f66155250e336e9c16f..7be478a4d8c1701875d4d6674b9d6724642db030 100644 (file)
@@ -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 (file)
index 0000000..b240635
--- /dev/null
@@ -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
index 373507d35e0b1740e9830647ab382ad403ce2e4b..da95aa8b5e238ef9448b536c87aafdb2395093fe 100644 (file)
@@ -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
index a29167ba946ff7e9776bc58de6182ffbb23c44e6..7db1e7498940221624ffc8fd8c495fc60788792a 100644 (file)
@@ -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
index f6c2caacfb79c0662d99b695517f7c50caccb9dc..a38553b4cb9b4f8830c28997fd4f9d511ce1d062 100644 (file)
 #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
 #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