diff options
Diffstat (limited to 'vulkan/libvulkan/driver.cpp')
| -rw-r--r-- | vulkan/libvulkan/driver.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index 991c3edef4..32f777dc87 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -899,7 +899,29 @@ VkResult CreateDevice(VkPhysicalDevice physicalDevice, return VK_ERROR_INCOMPATIBLE_DRIVER; } + + // sanity check ANDROID_native_buffer implementation, whose set of + // entrypoints varies according to the spec version. + if ((wrapper.GetHalExtensions()[ProcHook::ANDROID_native_buffer]) && + !data->driver.GetSwapchainGrallocUsageANDROID && + !data->driver.GetSwapchainGrallocUsage2ANDROID) { + ALOGE("Driver's implementation of ANDROID_native_buffer is broken;" + " must expose at least one of " + "vkGetSwapchainGrallocUsageANDROID or " + "vkGetSwapchainGrallocUsage2ANDROID"); + + data->driver.DestroyDevice(dev, pAllocator); + FreeDeviceData(data, data_allocator); + + return VK_ERROR_INCOMPATIBLE_DRIVER; + } + + VkPhysicalDeviceProperties properties; + instance_data.driver.GetPhysicalDeviceProperties(physicalDevice, + &properties); + data->driver_device = dev; + data->driver_version = properties.driverVersion; *pDevice = dev; |