Reputation:
Assume the GPU has multiple back buffers to render into.
Timeline:
Thoughts:
If possible, I'd love to seem see documentation. I just don't know at what level the semantics are defined.
Upvotes: 3
Views: 189
Reputation: 473212
The semantics are not defined. At least, not in OpenGL, even with wgl/glX_EXT_swap_control. Swap interval will let you decide whether swapping will wait for vsyncs, but if you swap more than once between vsyncs, it's implementation defined which image gets displayed.
wgl/glX_EXT_swap_control_tear allows you to specify that you want tearing behavior if you're late on swapping buffers. But what happens if you're early is not stated.
Vulkan allows implementations to expose different kinds of "swapping" functionality through its present modes. FIFO, the only required presentation mode, means that each image you present will be presented in the order provided. Which means if you try to "swap" (in Vulkan parlance, acquire) the next image and both are waiting to be presented, then the GPU will stall.
There are modes that immediately present the given image, a mode that mirrors "swap_control_tear", and a mode that would be useful in your case, where if you try to render buffers faster than they can be presented, the one waiting is discarded in favor of the next image.
Upvotes: 2