anv: remove feature checks from device creation

This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
This commit is contained in:
Tapani Pälli 2021-09-20 14:09:40 +03:00 committed by Marge Bot
parent 2e5718c957
commit 69e82462a1

View file

@ -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;