Potential unsafe reuse of `renderFinishedSemaphore`
Maintainer thường phản hồi trong vòng 16 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 61/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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!
- Ngôn ngữ chính
- C++
- Star
- 444
- Fork
- 145
- Merge trung bình
- 12 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của KhronosGroup/Vulkan-Tutorial
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
KhronosGroup/Vulkan-Tutorial#552 ·
Maintainer thường phản hồi trong vòng 16 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
KhronosGroup/Vulkan-Tutorial#551 ·
Maintainer thường phản hồi trong vòng 16 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
KhronosGroup/Vulkan-Tutorial#545 ·
Maintainer thường phản hồi trong vòng 16 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
KhronosGroup/Vulkan-Tutorial#544 ·
Maintainer thường phản hồi trong vòng 16 ngày
-
Clarify front-face culling when using a negative viewport heightCó thể đã có người làm @1sgtpepper đã nhận 19 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
Maintainer thường phản hồi trong vòng 16 ngày
Tất cả issue của KhronosGroup/Vulkan-Tutorial
Issue tương tự
-
Reference check: findingsĐang mởaudit-reference-check
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
schrodinger/pymol-open-source#532 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
xlnt-community/xlnt#174 ·