Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d13196c authored by Ian Elliott's avatar Ian Elliott Committed by android-build-merger
Browse files

Merge "Return an error if apiVersion is 1.1+." into oc-dev am: 8c109c63

am: d46d4311

Change-Id: If52f2c1d233cb2a18aaa527a972519e9b145247e
parents 7b3e965b d46d4311
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -887,6 +887,19 @@ VkResult CreateInstance(const VkInstanceCreateInfo* pCreateInfo,
    const VkAllocationCallbacks& data_allocator =
        (pAllocator) ? *pAllocator : GetDefaultAllocator();

    if (pCreateInfo->pApplicationInfo &&
        pCreateInfo->pApplicationInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
        ALOGI(
            "Requested Vulkan instance version %d.%d is greater than max "
            "supported version (1.0)",
            VK_VERSION_MAJOR(pCreateInfo->pApplicationInfo->apiVersion),
            VK_VERSION_MINOR(pCreateInfo->pApplicationInfo->apiVersion));
#pragma clang diagnostic pop
        return VK_ERROR_INCOMPATIBLE_DRIVER;
    }

    CreateInfoWrapper wrapper(*pCreateInfo, data_allocator);
    VkResult result = wrapper.Validate();
    if (result != VK_SUCCESS)