#[SOLVED] vkAcquireNextImageKHR repeating image indices

9 messages · Page 1 of 1 (latest)

hexed lark
#

I know you can't expect the image indices to be returned in order, a swapchain with 3 images could for example return the ordering from vkAcquireNextImageKHR:
0, 1, 2, 1, 2, 1, 2, ...

But can I expect that a swapchain with >= 2 images never repeat the same index twice in a row? That is, that vkAcquireNextImageKHR would never return the current order:
0, 1, 0, 1, 0, 0, 1, 0, ...

Or is that something I have to count on to be a possibility? I guess that I'm asking for is if there is some kind of guarantee that if the swapchain has >= 2 swapchain images, I would never get an unreasonably big "stall" due to the driver choosing to present the same image twice and stalling my vkWaitForFences to wait for the availability of the image i just queued for presentation when I could be preparing the next swapchain image.

gaunt pier
#

it is a random number generator, there are no guarantees on anything

#

but any sane driver will not give you the same index 2+ frames in a row if you have to block longer than you would've for any other index

#

so the one obvious reason to give you the same index again is if it is already done by the time you call acquire again

hexed lark
#

Thank you

#

[Solved] vkAcquireNextImageKHR repeating image indices

#

[SOLVED] vkAcquireNextImageKHR repeating image indices

steel blaze
#

This seems to be the cause for a memory leak in Blender 😉

hexed lark
#

@steel blaze Happy that this thread helped! Out of curiosity, was the memory leak caused by repeating indices or out of order indices in general?