Skip to content

Swapchain and timeline semaphores #2665

@Agrael1

Description

@Agrael1

Hello,

It is already Vulkan 1.4 and Timeline semaphores have been in standard for a long time. Yet the documentation states that:

All elements of the pWaitSemaphores member of pPresentInfo must be created with a VkSemaphoreType of VK_SEMAPHORE_TYPE_BINARY

That makes a set of present semaphores. Also there is vkAcquireNextImageKHR which accepts a binary semaphore, which makes it another set of semaphores.

I was wondering, would it be possible to replace this with timeline semaphores instead, which could have meaning of present ID. Completion value on this semaphore could be interpreted as swapchain image index as well with a simple division.

Next, something like vkAcquireNextImageKHR could just return a value to wait upon with the timeline semaphore as well.

Overall that could reduce the maintenance burden of the swapchain while letting less mistakes and more variability of implementations, effectively reducing number of semaphores to 2.

Is that a good idea? Feel free to correct me if something does not make sense.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions