Module: Mesa
Branch: main
Commit: 424df6a68d286171d14886d0383685ea65cca1bc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=424df6a68d286171d14886d0383685ea65cca1bc

Author: Molly Sophia <mollysophia...@gmail.com>
Date:   Fri Nov 10 00:51:01 2023 +0000

tu: Fix KHR_present_id and KHR_present_wait being used without initialization

KHR_present_id and KHR_present_wait were set in get_device_extensions() but 
uninitialized
in tu_get_features(). This causes presentId and presentWait to be false at all 
times. Fix it.

Signed-off-by: Molly Sophia <mollysophia...@gmail.com>
Co-Authored-By: Xilin Wu <wuxilin...@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26097>

---

 src/freedreno/vulkan/tu_device.cc | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/freedreno/vulkan/tu_device.cc 
b/src/freedreno/vulkan/tu_device.cc
index 9034b5c342f..f892fcedcb3 100644
--- a/src/freedreno/vulkan/tu_device.cc
+++ b/src/freedreno/vulkan/tu_device.cc
@@ -674,12 +674,6 @@ tu_physical_device_init(struct tu_physical_device *device,
    fd_get_driver_uuid(device->driver_uuid);
    fd_get_device_uuid(device->device_uuid, &device->dev_id);
 
-   struct vk_device_extension_table supported_extensions;
-   get_device_extensions(device, &supported_extensions);
-
-   struct vk_features supported_features;
-   tu_get_features(device, &supported_features);
-
    struct vk_physical_device_dispatch_table dispatch_table;
    vk_physical_device_dispatch_table_from_entrypoints(
       &dispatch_table, &tu_physical_device_entrypoints, true);
@@ -687,13 +681,14 @@ tu_physical_device_init(struct tu_physical_device *device,
       &dispatch_table, &wsi_physical_device_entrypoints, false);
 
    result = vk_physical_device_init(&device->vk, &instance->vk,
-                                    &supported_extensions,
-                                    &supported_features,
-                                    NULL,
+                                    NULL, NULL, NULL, /* We set up extensions 
later */
                                     &dispatch_table);
    if (result != VK_SUCCESS)
       goto fail_free_name;
 
+   get_device_extensions(device, &device->vk.supported_extensions);
+   tu_get_features(device, &device->vk.supported_features);
+
    device->vk.supported_sync_types = device->sync_types;
 
 #if TU_HAS_SURFACE

Reply via email to