vkAcquireNextImageKHR fence?

I’m trying to figure out how to use the fence parameter in vkAcquireNextImageKHR (that is, when is the correct time to query it?). If I create a fence and pass it as a parameter to that function, any time I query it later the LunarG validation layer throws “[WARN]: [MEM] Code 14: vkGetFenceStatus called for fence 0x26f310b1c40 which has not been submitted on a Queue.”. Eventually, I start seeing “Attempt to use CommandBuffer (handle) that doesn’t exist”, as well, but I haven’t chased that one down yet.

If I use a NULL handle for the fence, I don’t get the warning nor the command buffer error, but I still have a render loop happening several dozen times per vblank (it’s a trivial render loop).

The fence status queries return VK_SUCCESS, and there’s never blocking regardless of whether I am using FIFO or MAILBOX for the present - I see many iterations of OnPaint per vertical refresh cycle. Am I supposed to be put the fence into a queue in addition to using it as a parameter to this call? The samples I’ve seen use a null value for the fence, with a comment to the effect of “TODO: Show use of fence”, so it’s not clear to me what I need to do differently.

This sounds like a false positive in the validation layers.

Would you mind opening an issue here: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers

Thanks!

[QUOTE=Johannes van Waveren;39829]This sounds like a false positive in the validation layers.

Would you mind opening an issue here: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers

Thanks![/QUOTE]

Will do. I’m still curious why I don’t see any blocking on the fence (unless it is a side-effect of the validation layer warning?).

This was fixed very soon after the SDK 1.0.3 release in this commit. It is probably best to pick up the latest code from this same repository.