KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
False positive with oldSwapchain created from a different VkSurface
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
**Environment:**
- OS: Arch Linux
- GPU and driver version: Mesa 25.0
- SDK or header version if building from repo: 1.4.313.0
- Options enabled (synchronization, best practices, etc.):
**Describe the Issue**
1. Create two VkSurfaces (A, B) from the same native window.
2. Create a swapchain S from A.
3. Create a swapchain T from B, passing in S as the oldSwapchain.
**Expected behavior**
No error.
**Valid Usage ID**
VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933
```
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933 ] | MessageID = 0xe7c1ebde
vkCreateSwapchainKHR(): pCreateInfo->oldSwapchain surface is not pCreateInfo->surface.
The Vulkan spec states: If oldSwapchain is not VK_NULL_HANDLE, oldSwapchain must be a non-retired swapchain associated with native window referred to by surface (https://docs.vulkan.org/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933)
```
>oldSwapchain must be a non-retired swapchain associated with native window referred to by surface
The old swapchain, S, is, in fact, associated with the same native window referred to by B since A and B refer to the same native window.
Contributor guide
Research direction
Start at the vkCreateSwapchainKHR validation for VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933 and trace how the old and new VkSurface objects are compared. Reproduce the two-surface scenario from the issue, then verify that using a swapchain from surface A with surface B produces no false validation error when both refer to the same native window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100