wsi: Get timeline semaphore exportable handle types

We need to know this for explicit sync

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Erik Kurzinger <ekurzinger@nvidia.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25709>
This commit is contained in:
Joshua Ashton 2024-03-25 18:42:54 +00:00 committed by Marge Bot
parent 6a72ea01d3
commit 4bf8f96b3e
2 changed files with 13 additions and 1 deletions

View File

@ -123,7 +123,7 @@ wsi_device_init(struct wsi_device *wsi,
for (VkExternalSemaphoreHandleTypeFlags handle_type = 1;
handle_type <= VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
handle_type <<= 1) {
const VkPhysicalDeviceExternalSemaphoreInfo esi = {
VkPhysicalDeviceExternalSemaphoreInfo esi = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO,
.handleType = handle_type,
};
@ -135,6 +135,17 @@ wsi_device_init(struct wsi_device *wsi,
if (esp.externalSemaphoreFeatures &
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT)
wsi->semaphore_export_handle_types |= handle_type;
VkSemaphoreTypeCreateInfo timeline_tci = {
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO,
.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE_KHR,
};
esi.pNext = &timeline_tci;
GetPhysicalDeviceExternalSemaphoreProperties(pdevice, &esi, &esp);
if (esp.externalSemaphoreFeatures &
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT)
wsi->timeline_semaphore_export_handle_types |= handle_type;
}
const struct vk_device_extension_table *supported_extensions =

View File

@ -112,6 +112,7 @@ struct wsi_device {
VkPhysicalDevicePCIBusInfoPropertiesEXT pci_bus_info;
VkExternalSemaphoreHandleTypeFlags semaphore_export_handle_types;
VkExternalSemaphoreHandleTypeFlags timeline_semaphore_export_handle_types;
bool has_import_memory_host;
bool has_timeline_semaphore;