Mesa (main): lavapipe: 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: 54325dd1383c9b392c8e62d961e8d73732a7bb82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=54325dd1383c9b392c8e62d961e8d73732a7bb82

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Mon Sep 27 09:30:37 2021 +0300

lavapipe: 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: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>

---

 src/gallium/frontends/lavapipe/lvp_device.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 2881670da8c..47ad0a5c9ff 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -1404,19 +1404,6 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
 
-   /* Check enabled features */
-   if (pCreateInfo->pEnabledFeatures) {
-      VkPhysicalDeviceFeatures supported_features;
-      lvp_GetPhysicalDeviceFeatures(physicalDevice, &supported_features);
-      VkBool32 *supported_feature = (VkBool32 *)&supported_features;
-      VkBool32 *enabled_feature = (VkBool32 *)pCreateInfo->pEnabledFeatures;
-      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(instance, VK_ERROR_FEATURE_NOT_PRESENT);
-      }
-   }
-
    device = vk_zalloc2(&physical_device->vk.instance->alloc, pAllocator,
                        sizeof(*device), 8,
                        VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);



More information about the mesa-commit mailing list