Results 1 to 3 of 3

Thread: vkAcquireNextImageKHR semantics? What does timing out mean?

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2018

    vkAcquireNextImageKHR semantics? What does timing out mean?

    I am confused about the semantics of vkAcquireNextImageKHR. Specifically, under what circumstances can the function return VK_TIMEOUT? ie What could block it from not being able to acquire an image immediately? What might it wait for to happen?

    It seems that an image can be acquired even if the presentation engine hasn't finished reading from the image, and one needs to use a semaphore or fence to synchronize usage of the acquired image anyway. What am I missing?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2016
    The semantics is whatever the spec says. You get a VK_TIMEOUT if you provided non-zero and non-infinite timeout argument, and the Implementation was not able to service your request within that time.

    The Vulkan is an abstraction for all possible underlying OS APIs. It is a valid choice to copy the swapchain image, schedule copying it, or use it directly by the compositor. So some implementations might be able to give you all Images (down to zero owned by the Swapchain), some might let you wait if the Swapchain has less than minImages.

    The Implementation cannot return and give you a Semaphore, unless it is 200 % sure the semaphore\fence actually gets signaled (at all, or within a time past which the OS can kill you). It is called Forward Progress Guarantee.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2017
    From my (limited!) understanding, it should return VK_SUCCESS only when the queue is ready to accept the next image submission. If you have a FIFO present mode, a.k.a. v-sync, the GPU will present at the intervals your display supports (for example every 1/60th of a second). If you render faster than this, your queue will be full at some point. I doubt any implementation would allow you to acquire the same image twice if it's not presenting yet, thus it will have to block you.

    Ironically, I have recently found that on (some?) NVIDIA cards it never blocks, but the vkQueuePresentKHR call performs the synchronization instead (i.e. blocks). Unfortunately, I haven't found a way to control it.

    Edit: written while krOoze posted, sorry for the duplication
    Last edited by Buxxy11; 10-05-2018 at 12:28 PM.

Similar Threads

  1. Replies: 4
    Last Post: 07-25-2016, 07:40 PM
  2. vkAcquireNextImageKHR extremely slow?
    By Silverlan in forum Vulkan
    Replies: 2
    Last Post: 05-02-2016, 02:30 AM
  3. vkAcquireNextImageKHR fence?
    By Ghotep in forum Vulkan
    Replies: 3
    Last Post: 02-29-2016, 01:09 PM
  4. Semantics system
    By jbasic in forum OpenCL
    Replies: 0
    Last Post: 10-12-2009, 02:05 PM
  5. why different semantics
    By Mazy in forum OpenGL: General
    Replies: 4
    Last Post: 06-23-2005, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean