mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-16 11:55:39 +00:00
a/vk: Add function to check timeline semaphore import/export cap
This commit is contained in:
parent
3492c9e948
commit
0dbe9857c3
|
@ -1148,6 +1148,15 @@ vk_csci_get_image_external_handle_type(struct vk_bundle *vk);
|
|||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Is there a good likelihood that the import/export of a timeline semaphore
|
||||
* will succeed, in other words will the below functions work.
|
||||
*
|
||||
* @ingroup aux_vk
|
||||
*/
|
||||
XRT_CHECK_RESULT bool
|
||||
vk_can_import_and_export_timeline_semaphore(struct vk_bundle *vk);
|
||||
|
||||
/*!
|
||||
* @brief Creates a Vulkan fence, submits it to the default VkQueue and return
|
||||
* its native graphics sync handle.
|
||||
|
|
|
@ -61,6 +61,34 @@ vk_get_timeline_semaphore_handle_type(struct vk_bundle *vk)
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Check functions.
|
||||
*
|
||||
*/
|
||||
|
||||
bool
|
||||
vk_can_import_and_export_timeline_semaphore(struct vk_bundle *vk)
|
||||
{
|
||||
#ifdef VK_KHR_timeline_semaphore
|
||||
// Timeline semaphore extension and feature been enabled?
|
||||
if (!vk->features.timeline_semaphore) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Supported handle type for import/export?
|
||||
if (vk_get_timeline_semaphore_handle_type(vk) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Everything points to yes!
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Export.
|
||||
|
|
Loading…
Reference in a new issue