Present fence: state that it is signaled when vkQueuePresentKHR returns VK_ERROR_OUT_OF_DATE_KHR or VK_ERROR_SURFACE_LOST_KHR

Aperta
#2,861 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, cpp

Direzione di ricerca

Start in chapters/VK_KHR_surface/wsi.adoc at the vkQueuePresentKHR error paragraph and the common_present_fence text transcluded into VkSwapchainPresentFenceInfoKHR; read both together to see where the fence consequence is unstated. Then check the referenced CTS resize loop in vktWsiMaintenance1Tests.cpp and Mesa's wsi_common_queue_present for current practice. Done means the spec says whether the present fence is signaled for out-of-date/surface-lost and for the other present errors, with a CTS case noted if needed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

An application using VK_KHR_swapchain_maintenance1 (or VK_EXT_swapchain_maintenance1) that chains VkSwapchainPresentFenceInfoKHR to every present, and waits for those fences before destroying a swapchain or reusing its resources, needs to know whether the fence of a present that vkQueuePresentKHR rejects with VK_ERROR_OUT_OF_DATE_KHR or VK_ERROR_SURFACE_LOST_KHR is still signaled. If it is not, an unbounded wait on that fence never returns.

As far as I can tell the answer is "yes", but only by reading two passages together (chapters/VK_KHR_surface/wsi.adoc at 825e9b7):

  • vkQueuePresentKHR: "However, if the presentation request is rejected by the presentation engine with an error VK_ERROR_OUT_OF_DATE_KHR, [...] or VK_ERROR_SURFACE_LOST_KHR, the set of queue operations is still considered to be enqueued and thus any semaphore wait operation specified in VkPresentInfoKHR will execute when the corresponding queue operation is complete."
  • The present fence (common_present_fence, transcluded into VkSwapchainPresentFenceInfoKHR): "The application can provide a fence that the implementation will signal after all such queue operations have completed, and after the presentation engine has taken a reference to the payloads of all objects provided in VkPresentInfoKHR that the presentation engine accesses as part of the present operation." And: "[...] can destroy the swapchain when the fences associated with all past presentation requests referring to that swapchain have signaled."

The first passage draws only the semaphore consequence explicitly; no sentence names the present fence on these errors.

Observed behavior agrees with the reading: the CTS (external/vulkancts/modules/vulkan/wsi/vktWsiMaintenance1Tests.cpp, the resize loop) chains a present fence, handles VK_ERROR_OUT_OF_DATE_KHR from that present, and then waits on the fence unconditionally; Mesa's common WSI (src/vulkan/wsi/wsi_common.c, wsi_common_queue_present) submits the present fence with the per-image signal operations before the backend returns VK_ERROR_OUT_OF_DATE_KHR. I could not find a CTS case for VK_ERROR_SURFACE_LOST_KHR.

Requests:

  1. Add one sentence to the present-fence text, for example: "If a presentation request is rejected with VK_ERROR_OUT_OF_DATE_KHR, VK_ERROR_SURFACE_LOST_KHR (or the other errors for which the set of queue operations is still considered to be enqueued), any present fence specified for that request is still signaled as described above."
  2. State the fence's state for the other error codes vkQueuePresentKHR can return (e.g. VK_ERROR_OUT_OF_HOST_MEMORY, VK_ERROR_OUT_OF_DEVICE_MEMORY, VK_ERROR_DEVICE_LOST), where the queue operations are not said to be enqueued: is the fence left unsignaled, or is its state undefined?
  3. If (1) is the intent, a CTS case for VK_ERROR_SURFACE_LOST_KHR would make it binding in practice.

Related: #1533, #152 (resolved in 1.3.239), and #2007 (the case without the extension, which this issue does not cover).

This issue was prepared with the help of an AI assistant; I checked the quoted passages against the current main.

Lingua principale
JavaScript
Stelle
3.4k
Fork
555
Merge medio
3g 10h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KhronosGroup/Vulkan-Docs

Tutte le issue di KhronosGroup/Vulkan-Docs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.