}
}
+ // Make sure the application provided API version has 0 for its variant
+ if (NULL != pCreateInfo->pApplicationInfo) {
+ uint32_t variant_version = VK_API_VERSION_VARIANT(pCreateInfo->pApplicationInfo->apiVersion);
+ if (0 != variant_version) {
+ loader_log(ptr_instance, VULKAN_LOADER_WARN_BIT, 0,
+ "vkCreateInstance: The API Variant specified in pCreateInfo->pApplicationInfo.apiVersion is %d instead of "
+ "the expected value of 0.",
+ variant_version);
+ }
+ }
+
// Due to implicit layers need to get layer list even if
// enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
// get layer list via loader_scan_for_layers().
QueueSubmit2(nullptr, 0, nullptr, VK_NULL_HANDLE);
auto SetPrivateData = reinterpret_cast<PFN_vkSetPrivateData>(inst.functions->vkGetDeviceProcAddr(device, "vkSetPrivateData"));
SetPrivateData(device, VK_OBJECT_TYPE_UNKNOWN, 0, {}, 0);
+}
+
+TEST(ApplicationInfoVersion, NonVulkanVariant) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
+ env.get_test_icd().physical_devices.push_back({});
+
+ DebugUtilsLogger log;
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.set_api_version(VK_MAKE_API_VERSION(1, 0, 0, 0));
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+ inst.CheckCreate();
+ ASSERT_TRUE(log.find(
+ std::string("vkCreateInstance: The API Variant specified in pCreateInfo->pApplicationInfo.apiVersion is 1 instead of "
+ "the expected value of 0.")));
}
\ No newline at end of file