KhronosGroup / KhronosGroup/Vulkan-Docs

vkAcquireNextImageKHR unclear relationship between return codes and image acquisition

Open
#1,776 9 comments 0 reactions 1 assignee Assigned to @cubanismo View on GitHub
System Integration
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

In the documentation for `vkAcquireNextImageKHR`, four return codes (`VK_SUCCESS`, `VK_TIMEOUT`, `VK_NOT_READY`, and `VK_SUBOPTIMAL_KHR`) are listed as “success”es, with a bunch of others being listed as “failure”s.

However, the immediately following paragraph states:
> When successful, `vkAcquireNextImageKHR` acquires a presentable image from swapchain that an application can use, and sets `pImageIndex` to the index of that image within the swapchain.

Intuitively, this seems clearly wrong: an image should be acquired if the result is `VK_SUCCESS` or `VK_SUBOPTIMAL_KHR`, but *not* if the result is `VK_TIMEOUT` or `VK_NOT_READY`, even though those are considered “success” results.

The next paragraph states:
> If `timeout` is zero, then `vkAcquireNextImageKHR` does not wait, and will either successfully acquire an image, or fail and return `VK_NOT_READY` if no image is available.

This seems poorly worded and potentially contradictory: if no image is immediately available, then `vkAcquireNextImageKHR` will *fail* and return… a success code?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.