From 69e82462a14579b9182fd3c859cce2344898faba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 20 Sep 2021 14:09:40 +0300 Subject: [PATCH] anv: remove feature checks from device creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is already handled by vk_device_init(); drivers no longer need to do it themselves. Signed-off-by: Tapani Pälli Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_device.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 2424d807a78..686f351b3a6 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2845,23 +2845,6 @@ static struct intel_mapped_pinned_buffer_alloc aux_map_allocator = { .free = intel_aux_map_buffer_free, }; -static VkResult -check_physical_device_features(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceFeatures *features) -{ - VkPhysicalDeviceFeatures supported_features; - anv_GetPhysicalDeviceFeatures(physicalDevice, &supported_features); - VkBool32 *supported_feature = (VkBool32 *)&supported_features; - VkBool32 *enabled_feature = (VkBool32 *)features; - unsigned num_features = sizeof(VkPhysicalDeviceFeatures) / sizeof(VkBool32); - for (uint32_t i = 0; i < num_features; i++) { - if (enabled_feature[i] && !supported_feature[i]) - return vk_error(VK_ERROR_FEATURE_NOT_PRESENT); - } - - return VK_SUCCESS; -} - VkResult anv_CreateDevice( VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, @@ -2877,11 +2860,6 @@ VkResult anv_CreateDevice( /* Check enabled features */ bool robust_buffer_access = false; if (pCreateInfo->pEnabledFeatures) { - result = check_physical_device_features(physicalDevice, - pCreateInfo->pEnabledFeatures); - if (result != VK_SUCCESS) - return result; - if (pCreateInfo->pEnabledFeatures->robustBufferAccess) robust_buffer_access = true; } @@ -2890,11 +2868,6 @@ VkResult anv_CreateDevice( switch (ext->sType) { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: { const VkPhysicalDeviceFeatures2 *features = (const void *)ext; - result = check_physical_device_features(physicalDevice, - &features->features); - if (result != VK_SUCCESS) - return result; - if (features->features.robustBufferAccess) robust_buffer_access = true; break;