Mesa (main): radv: remove feature checks from device creation
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 1 18:11:06 UTC 2021
Module: Mesa
Branch: main
Commit: 814d6b626f58d958375aa865986761b2e7bc9b18
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=814d6b626f58d958375aa865986761b2e7bc9b18
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Mon Sep 20 14:17:19 2021 +0300
radv: 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 at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
---
src/amd/vulkan/radv_device.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index c6fc66be192..075dcea0712 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2608,24 +2608,6 @@ radv_device_init_gs_info(struct radv_device *device)
device->physical_device->rad_info.family);
}
-static VkResult
-check_physical_device_features(VkPhysicalDevice physicalDevice,
- const VkPhysicalDeviceFeatures *features)
-{
- RADV_FROM_HANDLE(radv_physical_device, physical_device, physicalDevice);
- VkPhysicalDeviceFeatures supported_features;
- radv_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(physical_device->instance, VK_ERROR_FEATURE_NOT_PRESENT);
- }
-
- return VK_SUCCESS;
-}
-
static VkResult
radv_device_init_border_color(struct radv_device *device)
{
@@ -2799,10 +2781,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
/* Check enabled features */
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;
}
@@ -2812,10 +2790,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
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;
More information about the mesa-commit
mailing list