Revert "Vulkan1.1: CreateInstance downgrades apiVersion for 1.0 ICDs"
The 1.0.2 Vulkan CTS (dEQP) test case "dEQP-VK.api.device_init.create_instance_invalid_api_version" fails because we didn't return INCOMPATIBLE_DRIVER for 1.0.1023 (or something like that). That is correct for a Vulkan 1.1 instance, and the new 1.1 CTS code doesn't fail for that case. However, master still has 1.0.2 CTS, and so we need to revert this change for now.
This reverts commit 205e4611654c36dc8d5a496732c4f9681f0065e1.
Change-Id: I1f68cfe6cd5bddef7871929257596f053744c324
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
index dded1e3..ade0bde 100644
--- a/vulkan/libvulkan/driver.cpp
+++ b/vulkan/libvulkan/driver.cpp
@@ -94,7 +94,6 @@
~CreateInfoWrapper();
VkResult Validate();
- void DowngradeApiVersion();
const std::bitset<ProcHook::EXTENSION_COUNT>& GetHookExtensions() const;
const std::bitset<ProcHook::EXTENSION_COUNT>& GetHalExtensions() const;
@@ -132,8 +131,6 @@
VkDeviceCreateInfo dev_info_;
};
- VkApplicationInfo application_info_;
-
ExtensionFilter extension_filter_;
std::bitset<ProcHook::EXTENSION_COUNT> hook_extensions_;
@@ -540,15 +537,6 @@
}
}
-void CreateInfoWrapper::DowngradeApiVersion() {
- // If pApplicationInfo is NULL, apiVersion is assumed to be 1.0:
- if (instance_info_.pApplicationInfo) {
- application_info_ = *instance_info_.pApplicationInfo;
- instance_info_.pApplicationInfo = &application_info_;
- application_info_.apiVersion = VK_API_VERSION_1_0;
- }
-}
-
VKAPI_ATTR void* DefaultAllocate(void*,
size_t size,
size_t alignment,
@@ -903,33 +891,6 @@
data->hook_extensions |= wrapper.GetHookExtensions();
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wold-style-cast"
- uint32_t api_version = ((pCreateInfo->pApplicationInfo)
- ? pCreateInfo->pApplicationInfo->apiVersion
- : VK_API_VERSION_1_0);
- uint32_t api_major_version = VK_VERSION_MAJOR(api_version);
- uint32_t api_minor_version = VK_VERSION_MINOR(api_version);
- uint32_t icd_api_version;
- PFN_vkEnumerateInstanceVersion pfn_enumerate_instance_version =
- reinterpret_cast<PFN_vkEnumerateInstanceVersion>(
- Hal::Device().GetInstanceProcAddr(NULL,
- "vkEnumerateInstanceVersion"));
- if (!pfn_enumerate_instance_version) {
- icd_api_version = VK_API_VERSION_1_0;
- } else {
- result = (*pfn_enumerate_instance_version)(&icd_api_version);
- }
- uint32_t icd_api_major_version = VK_VERSION_MAJOR(icd_api_version);
- uint32_t icd_api_minor_version = VK_VERSION_MINOR(icd_api_version);
-
- if ((icd_api_major_version == 1) && (icd_api_minor_version == 0) &&
- ((api_major_version > 1) || (api_minor_version > 0))) {
- api_version = VK_API_VERSION_1_0;
- wrapper.DowngradeApiVersion();
- }
-#pragma clang diagnostic pop
-
// call into the driver
VkInstance instance;
result = Hal::Device().CreateInstance(