Potential unsafe reuse of `renderFinishedSemaphore`
I maintainer di solito rispondono entro 16 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 61/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- backend, testing-qa
Direzione di ricerca
Read 15_hello_triangle.cpp alongside 16_frames_in_flight.cpp and the linked Vulkan Guide on swapchain semaphore reuse. Check whether the chapter 15 submission and presentation sequence permits reusing the semaphore before presentation has finished waiting on it. Done when the specification or a reproducer establishes whether reuse is safe and, if not, the example’s synchronization is corrected.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
While reading the Rendering and Presentation chapter, I noticed a potential synchronization issue in 15_hello_triangle.cpp.
The example creates a single renderFinishedSemaphore, which is reused for every frame. It is signaled by queue.submit() and waited on by queue.presentKHR().
My concern is that the semaphore might be reused before the previous presentation operation has finished waiting on it.
For example, consider the following sequence:
Frame 0:
- The application submits rendering commands for swapchain Image 0, with
drawFenceandrenderFinishedSemaphore. - Once the rendering submission completes, both
drawFenceandrenderFinishedSemaphoreare signaled. - The presentation operation waits on
renderFinishedSemaphore. However, this wait may not have completed yet.
Frame 1: (assuming Frame 0's presentation wait on renderFinishedSemaphore has not yet completed):
- The CPU waits on
drawFence. Since Frame 0's rendering has completed, the fence wait can return. - The application acquires another swapchain image, say Image 1, and submits rendering commands for Frame 1.
- This submission attempts to signal the same
renderFinishedSemaphoreagain.
The potential issue is that Frame 0's presentation operation may still be waiting on renderFinishedSemaphore when Frame 1 attempts to signal it again.
Since this is a binary semaphore, it must return to the unsignaled state before it can be signaled again. Waiting for drawFence only guarantees that Frame 0's rendering submission has completed, not that its presentation wait has completed.
The Vulkan Guide on Swapchain Semaphore Reuse discusses a similar problem, where a rendering fence does not guarantee that a semaphore used by presentation is safe to reuse.
I also noticed that the next example, 16_frames_in_flight.cpp uses renderFinishedSemaphores[imageIndex], so it doesn't appear to have the same issue.
I haven't reproduced a validation error myself, but I was wondering whether this semaphore reuse in chapter 15 is guaranteed to be safe by the Vulkan specification.
Thanks!
- Lingua principale
- C++
- Stelle
- 444
- Fork
- 145
- Merge medio
- 12g 10h
- PR unite (30g)
- 12
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di KhronosGroup/Vulkan-Tutorial
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
KhronosGroup/Vulkan-Tutorial#552 ·
I maintainer di solito rispondono entro 16 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KhronosGroup/Vulkan-Tutorial#551 ·
I maintainer di solito rispondono entro 16 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
KhronosGroup/Vulkan-Tutorial#545 ·
I maintainer di solito rispondono entro 16 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
KhronosGroup/Vulkan-Tutorial#544 ·
I maintainer di solito rispondono entro 16 giorni
-
Clarify front-face culling when using a negative viewport heightForse già presa @1sgtpepper l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
I maintainer di solito rispondono entro 16 giorni
Tutte le issue di KhronosGroup/Vulkan-Tutorial
Issue simili
-
Reference check: findingsApertaaudit-reference-check
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
schrodinger/pymol-open-source#532 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
xlnt-community/xlnt#174 ·