Repository navigation
Conversation
Rebuilding a swapchain clears its frames and indices but appends new acquire semaphores to the old pool. Repeated rebuilds retain obsolete semaphores and can reuse a signaled semaphore after SUBOPTIMAL acquisition. Clear the acquire semaphore pool after vkDeviceWaitIdle, alongside the other per-swapchain resources. The existing code resets its index and creates a fresh semaphore for each new swapchain image. Validation: - Windows x64, MSVC, RelWithDebInfo, Intel UHD 770, Vulkan 1.4.313.2. - Independent probe against master e4718bf: first rebuild retains six acquire semaphores for three images before the fix; all sixteen rebuilds retain exactly three after the fix. - Downstream resize/presentation/readback probe on 599a8c5: sixteen alternating resizes report ten Khronos validation errors before this change and zero after it (semaphore-01286).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Window::buildSwapchain()waits for device idle and clears_framesand_indices, but keeps_availableSemaphoresand appends a fresh set. Each rebuild therefore retains another swapchain's acquire semaphores. The stale set can include a semaphore signaled by aVK_SUBOPTIMAL_KHRacquisition; reusing it after the rebuild can triggerVUID-vkAcquireNextImageKHR-semaphore-01286.Clear the acquire semaphore pool alongside the old frames and indices, after
vkDeviceWaitIdle. The existing initialization resets_availableSemaphoreIndexand creates one fresh acquire semaphore per new image. No API or dependency changes.Type of change
How Has This Been Tested?
e4718bf078a26930e0b6f5932d2537b689fa3969before and after the change with MSVC x64, Ninja, RelWithDebInfo, shader compiler support disabled.599a8c5c61cbb993079261b2ada99bd843badf5b. Its separate Qt/Vulkan probe alternates window dimensions 16 times, presents and reads back after each resize. With Khronos validation enabled it completes with 10 validation errors before, 0 after, including the acquire semaphore VUID above. This downstream validation result is distinct from the standalone test of current master.Test environment: Windows x64, Intel UHD 770, MSVC 14.51, Vulkan SDK 1.4.313.2.
The standalone Windows reproduction links only VSG:
Build the snippet as a C++ executable linked to
vsg::vsg. Callingresize()intentionally rebuilds the swapchain even with unchanged dimensions, so semaphore retention is deterministic without mouse input or application data.