From: Charles Giessen Date: Wed, 26 Jan 2022 22:14:39 +0000 (-0700) Subject: Update tests to use correct version macro X-Git-Tag: upstream/v1.3.207~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b411580d64bb87a4f50e6da34300665f502f23f1;p=platform%2Fupstream%2FVulkan-Loader.git Update tests to use correct version macro The VK_MAKE_API_VERSION macro and the VK_API_VERSION_1_X macros are better to use. This commit switches the tests over to the non-deprecated versions of the macros. --- diff --git a/tests/framework/icd/test_icd.cpp b/tests/framework/icd/test_icd.cpp index 978429d8..263e2081 100644 --- a/tests/framework/icd/test_icd.cpp +++ b/tests/framework/icd/test_icd.cpp @@ -150,7 +150,7 @@ VKAPI_ATTR VkResult VKAPI_CALL test_vkEnumerateInstanceLayerProperties(uint32_t* VKAPI_ATTR VkResult VKAPI_CALL test_vkEnumerateInstanceVersion(uint32_t* pApiVersion) { if (pApiVersion != nullptr) { - *pApiVersion = VK_MAKE_VERSION(1, 0, 0); + *pApiVersion = VK_API_VERSION_1_0; } return VK_SUCCESS; } @@ -161,8 +161,8 @@ VKAPI_ATTR VkResult VKAPI_CALL test_vkCreateInstance(const VkInstanceCreateInfo* return VK_ERROR_OUT_OF_HOST_MEMORY; } - if (icd.icd_api_version < VK_MAKE_VERSION(1, 1, 0)) { - if (pCreateInfo->pApplicationInfo->apiVersion > VK_MAKE_VERSION(1, 0, 0)) { + if (icd.icd_api_version < VK_API_VERSION_1_1) { + if (pCreateInfo->pApplicationInfo->apiVersion > VK_API_VERSION_1_0) { return VK_ERROR_INCOMPATIBLE_DRIVER; } } @@ -910,7 +910,7 @@ VKAPI_ATTR void VKAPI_CALL test_vkGetPhysicalDeviceExternalFenceProperties( #define TO_VOID_PFN(func) reinterpret_cast(func) PFN_vkVoidFunction get_instance_func_ver_1_1(VkInstance instance, const char* pName) { - if (icd.icd_api_version >= VK_MAKE_VERSION(1, 1, 0)) { + if (icd.icd_api_version >= VK_API_VERSION_1_1) { if (string_eq(pName, "test_vkEnumerateInstanceVersion")) { return TO_VOID_PFN(test_vkEnumerateInstanceVersion); } @@ -918,7 +918,7 @@ PFN_vkVoidFunction get_instance_func_ver_1_1(VkInstance instance, const char* pN return nullptr; } PFN_vkVoidFunction get_instance_func_ver_1_2(VkInstance instance, const char* pName) { - if (icd.icd_api_version >= VK_MAKE_VERSION(1, 2, 0)) { + if (icd.icd_api_version >= VK_API_VERSION_1_2) { return nullptr; } return nullptr; diff --git a/tests/framework/icd/test_icd.h b/tests/framework/icd/test_icd.h index 831b9418..dbcbb5f3 100644 --- a/tests/framework/icd/test_icd.h +++ b/tests/framework/icd/test_icd.h @@ -66,7 +66,7 @@ struct TestICD { BUILDER_VALUE(TestICD, bool, enable_icd_wsi, false); UsingICDProvidedWSI is_using_icd_wsi = UsingICDProvidedWSI::not_using; - BUILDER_VALUE(TestICD, uint32_t, icd_api_version, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(TestICD, uint32_t, icd_api_version, VK_API_VERSION_1_0) BUILDER_VECTOR(TestICD, LayerDefinition, instance_layers, instance_layer) BUILDER_VECTOR(TestICD, Extension, instance_extensions, instance_extension) diff --git a/tests/framework/layer/layer_util.h b/tests/framework/layer/layer_util.h index 332850dd..b47add00 100644 --- a/tests/framework/layer/layer_util.h +++ b/tests/framework/layer/layer_util.h @@ -31,13 +31,13 @@ struct LayerDefinition { BUILDER_VALUE(LayerDefinition, std::string, layerName, {}) - BUILDER_VALUE(LayerDefinition, uint32_t, specVersion, VK_MAKE_VERSION(1, 0, 0)) - BUILDER_VALUE(LayerDefinition, uint32_t, implementationVersion, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(LayerDefinition, uint32_t, specVersion, VK_API_VERSION_1_0) + BUILDER_VALUE(LayerDefinition, uint32_t, implementationVersion, VK_API_VERSION_1_0) BUILDER_VALUE(LayerDefinition, std::string, description, {}) BUILDER_VECTOR(LayerDefinition, Extension, extensions, extension) - LayerDefinition(std::string layerName, uint32_t specVersion = VK_MAKE_VERSION(1, 0, 0), - uint32_t implementationVersion = VK_MAKE_VERSION(1, 0, 0), std::string description = "", + LayerDefinition(std::string layerName, uint32_t specVersion = VK_API_VERSION_1_0, + uint32_t implementationVersion = VK_API_VERSION_1_0, std::string description = "", std::vector extensions = {}) : layerName(layerName), specVersion(specVersion), diff --git a/tests/framework/layer/test_layer.cpp b/tests/framework/layer/test_layer.cpp index 5aa0def7..5cf1aa1f 100644 --- a/tests/framework/layer/test_layer.cpp +++ b/tests/framework/layer/test_layer.cpp @@ -130,7 +130,7 @@ VKAPI_ATTR VkResult VKAPI_CALL test_vkEnumerateDeviceExtensionProperties(VkPhysi VKAPI_ATTR VkResult VKAPI_CALL test_vkEnumerateInstanceVersion(uint32_t* pApiVersion) { if (pApiVersion != nullptr) { - *pApiVersion = VK_MAKE_VERSION(1, 0, 0); + *pApiVersion = VK_API_VERSION_1_0; } return VK_SUCCESS; } diff --git a/tests/framework/layer/test_layer.h b/tests/framework/layer/test_layer.h index 9ea27298..cb50300d 100644 --- a/tests/framework/layer/test_layer.h +++ b/tests/framework/layer/test_layer.h @@ -90,12 +90,12 @@ using FP_layer_callback = VkResult (*)(TestLayer& layer, void* data); struct TestLayer { fs::path manifest_file_path; - uint32_t manifest_version = VK_MAKE_VERSION(1, 1, 2); + uint32_t manifest_version = VK_MAKE_API_VERSION(0, 1, 1, 2); BUILDER_VALUE(TestLayer, bool, is_meta_layer, false) BUILDER_VALUE(TestLayer, std::string, unique_name, {}) - BUILDER_VALUE(TestLayer, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(TestLayer, uint32_t, api_version, VK_API_VERSION_1_0) BUILDER_VALUE(TestLayer, uint32_t, implementation_version, 2) BUILDER_VALUE(TestLayer, uint32_t, min_implementation_version, 0) BUILDER_VALUE(TestLayer, std::string, description, {}) diff --git a/tests/framework/test_environment.h b/tests/framework/test_environment.h index 9ddc10fe..26257ffb 100644 --- a/tests/framework/test_environment.h +++ b/tests/framework/test_environment.h @@ -290,10 +290,10 @@ struct TestLayerHandle { }; struct TestICDDetails { - TestICDDetails(fs::path icd_path, uint32_t api_version = VK_MAKE_VERSION(1, 0, 0)) noexcept + TestICDDetails(fs::path icd_path, uint32_t api_version = VK_API_VERSION_1_0) noexcept : icd_path(icd_path), api_version(api_version) {} BUILDER_VALUE(TestICDDetails, fs::path, icd_path, {}); - BUILDER_VALUE(TestICDDetails, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0)); + BUILDER_VALUE(TestICDDetails, uint32_t, api_version, VK_API_VERSION_1_0); BUILDER_VALUE(TestICDDetails, std::string, json_name, "test_icd"); BUILDER_VALUE(TestICDDetails, bool, use_env_var_icd_filenames, false); BUILDER_VALUE(TestICDDetails, bool, is_fake, false); diff --git a/tests/framework/test_util.h b/tests/framework/test_util.h index aeda2b72..24508953 100644 --- a/tests/framework/test_util.h +++ b/tests/framework/test_util.h @@ -553,7 +553,7 @@ struct ManifestLayer { BUILDER_VALUE(LayerDescription, std::string, name, {}) BUILDER_VALUE(LayerDescription, Type, type, Type::INSTANCE) BUILDER_VALUE(LayerDescription, fs::path, lib_path, {}) - BUILDER_VALUE(LayerDescription, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(LayerDescription, uint32_t, api_version, VK_API_VERSION_1_0) BUILDER_VALUE(LayerDescription, uint32_t, implementation_version, 0) BUILDER_VALUE(LayerDescription, std::string, description, {}) BUILDER_VECTOR(LayerDescription, FunctionOverride, functions, function) @@ -577,9 +577,9 @@ struct ManifestLayer { struct Extension { BUILDER_VALUE(Extension, std::string, extensionName, {}) - BUILDER_VALUE(Extension, uint32_t, specVersion, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(Extension, uint32_t, specVersion, VK_API_VERSION_1_0) - Extension(std::string extensionName, uint32_t specVersion = VK_MAKE_VERSION(1, 0, 0)) + Extension(std::string extensionName, uint32_t specVersion = VK_API_VERSION_1_0) : extensionName(extensionName), specVersion(specVersion) {} VkExtensionProperties get() const noexcept { @@ -720,7 +720,7 @@ struct InstanceCreateInfo { BUILDER_VALUE(InstanceCreateInfo, std::string, engine_name, {}) BUILDER_VALUE(InstanceCreateInfo, uint32_t, app_version, 0) BUILDER_VALUE(InstanceCreateInfo, uint32_t, engine_version, 0) - BUILDER_VALUE(InstanceCreateInfo, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0)) + BUILDER_VALUE(InstanceCreateInfo, uint32_t, api_version, VK_API_VERSION_1_0) BUILDER_VECTOR(InstanceCreateInfo, const char*, enabled_layers, layer) BUILDER_VECTOR(InstanceCreateInfo, const char*, enabled_extensions, extension) // tell the get() function to not provide `application_info` diff --git a/tests/loader_wsi_tests.cpp b/tests/loader_wsi_tests.cpp index ce5c77de..8c9e309d 100644 --- a/tests/loader_wsi_tests.cpp +++ b/tests/loader_wsi_tests.cpp @@ -46,7 +46,7 @@ class WsiTests : public ::testing::Test { // When ICD doesn't support the extension, create instance should fail TEST_F(WsiTests, CreateSurfaceWin32NoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.enable_icd_wsi = false; @@ -63,7 +63,7 @@ TEST_F(WsiTests, CreateSurfaceWin32NoICDSupport) { // When ICD doesn't support the surface creation, the loader should handle it TEST_F(WsiTests, CreateSurfaceWin32NoICDCreateSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WIN32_SURFACE_EXTENSION_NAME}); @@ -85,7 +85,7 @@ TEST_F(WsiTests, CreateSurfaceWin32NoICDCreateSupport) { // When ICD does support the surface creation, the loader should delegat handle it to the ICD TEST_F(WsiTests, CreateSurfaceWin32ICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WIN32_SURFACE_EXTENSION_NAME}); @@ -135,7 +135,7 @@ TEST_F(WsiTests, CreateSurfaceWin32MixedICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceWin32PresentNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WIN32_SURFACE_EXTENSION_NAME}); @@ -156,7 +156,7 @@ TEST_F(WsiTests, GetPhysicalDeviceWin32PresentNoICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceWin32PresentICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WIN32_SURFACE_EXTENSION_NAME}); @@ -180,7 +180,7 @@ TEST_F(WsiTests, GetPhysicalDeviceWin32PresentICDSupport) { // When ICD doesn't support the extension, create instance should fail TEST_F(WsiTests, CreateSurfaceXCBNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.enable_icd_wsi = false; @@ -197,7 +197,7 @@ TEST_F(WsiTests, CreateSurfaceXCBNoICDSupport) { // When ICD doesn't support the surface creation, the loader should handle it TEST_F(WsiTests, CreateSurfaceXCBNoICDCreateSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XCB_SURFACE_EXTENSION_NAME}); @@ -219,7 +219,7 @@ TEST_F(WsiTests, CreateSurfaceXCBNoICDCreateSupport) { // When ICD does support the surface creation, the loader should delegat handle it to the ICD TEST_F(WsiTests, CreateSurfaceXCBICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XCB_SURFACE_EXTENSION_NAME}); @@ -269,7 +269,7 @@ TEST_F(WsiTests, CreateSurfaceXCBMixedICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceXcbPresentNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XCB_SURFACE_EXTENSION_NAME}); @@ -290,7 +290,7 @@ TEST_F(WsiTests, GetPhysicalDeviceXcbPresentNoICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceXcbPresentICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XCB_SURFACE_EXTENSION_NAME}); @@ -314,7 +314,7 @@ TEST_F(WsiTests, GetPhysicalDeviceXcbPresentICDSupport) { // When ICD doesn't support the extension, create instance should fail TEST_F(WsiTests, CreateSurfaceXLIBNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.enable_icd_wsi = false; @@ -331,7 +331,7 @@ TEST_F(WsiTests, CreateSurfaceXLIBNoICDSupport) { // When ICD doesn't support the surface creation, the loader should handle it TEST_F(WsiTests, CreateSurfaceXLIBNoICDCreateSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XLIB_SURFACE_EXTENSION_NAME}); @@ -353,7 +353,7 @@ TEST_F(WsiTests, CreateSurfaceXLIBNoICDCreateSupport) { // When ICD does support the surface creation, the loader should delegat handle it to the ICD TEST_F(WsiTests, CreateSurfaceXLIBICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XLIB_SURFACE_EXTENSION_NAME}); @@ -403,7 +403,7 @@ TEST_F(WsiTests, CreateSurfaceXLIBMixedICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceXlibPresentNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XLIB_SURFACE_EXTENSION_NAME}); @@ -424,7 +424,7 @@ TEST_F(WsiTests, GetPhysicalDeviceXlibPresentNoICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceXlibPresentICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_XLIB_SURFACE_EXTENSION_NAME}); @@ -448,7 +448,7 @@ TEST_F(WsiTests, GetPhysicalDeviceXlibPresentICDSupport) { // When ICD doesn't support the extension, create instance should fail TEST_F(WsiTests, CreateSurfaceWaylandNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.enable_icd_wsi = false; @@ -465,7 +465,7 @@ TEST_F(WsiTests, CreateSurfaceWaylandNoICDSupport) { // When ICD doesn't support the surface creation, the loader should handle it TEST_F(WsiTests, CreateSurfaceWaylandNoICDCreateSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME}); @@ -487,7 +487,7 @@ TEST_F(WsiTests, CreateSurfaceWaylandNoICDCreateSupport) { // When ICD does support the surface creation, the loader should delegat handle it to the ICD TEST_F(WsiTests, CreateSurfaceWaylandICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME}); @@ -537,7 +537,7 @@ TEST_F(WsiTests, CreateSurfaceWaylandMixedICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceWaylandPresentNoICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME}); @@ -558,7 +558,7 @@ TEST_F(WsiTests, GetPhysicalDeviceWaylandPresentNoICDSupport) { TEST_F(WsiTests, GetPhysicalDeviceWaylandPresentICDSupport) { auto& driver = env->get_test_icd(); - driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0)); + driver.set_icd_api_version(VK_API_VERSION_1_0); driver.set_min_icd_interface_version(5); driver.add_instance_extension({VK_KHR_SURFACE_EXTENSION_NAME}); driver.add_instance_extension({VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME});