wgpu: Imageless Swapchain Vulkan Validation Error
Description On all wgpu programs that create a swapchain, I receive this Vulkan validation layer on my machine:
Validation Error: [ VUID-VkRenderPassBeginInfo-framebuffer-04627 ] Object 0: handle = 0x3a6cbb0000000025, type =
VK_OBJECT_TYPE_RENDER_PASS
; | MessageID = 0x45125641 | vkCmdBeginRenderPass: Image view #0 created from an image with usage set as (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
) but using VkImageViewUsageCreateInfo the inherited usage is the subset (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
) and the image info #0 used to create the framebuffer had usage set as (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
). The Vulkan spec states: If framebuffer was created with a VkFramebufferCreateInfo::flags value that includedVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element of the pAttachments member of a VkRenderPassAttachmentBeginInfo structure included in the pNext chain must be a VkImageView with an inherited usage equal to the usage member of the corresponding element of VkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos used to create framebuffer (https://vulkan.lunarg.com/doc/view/1.3.250.0/windows/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-04627)
On some wgpu applications I have, this error is logged every frame. I think that’s because I’m recreating the image view every frame, but I haven’t looked into it.
Repro steps
Run the hello-triangle
example from wgpu with Vulkan validation layers enabled.
Platform
- Windows 10 22H2
- Nvidia Driver 535.98
- Vulkan SDK 1.3.250.0
- Nvidia RTX 3070
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 20 (12 by maintainers)
I’m still seeing this on Windows 10, with a new bevy 12 project. Setting
DISABLE_VULKAN_OBS_CAPTURE
to1
(as described in one of the related links) does not help.2023-12-17T16:50:29.184103Z ERROR log: VALIDATION [VUID-VkRenderPassBeginInfo-framebuffer-04627 (0x45125641)] Validation Error: [ VUID-VkRenderPassBeginInfo-framebuffer-04627 ] Object 0: handle = 0x18543900000000ff, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0x1e7d540000000102, type = VK_OBJECT_TYPE_FRAMEBUFFER; Object 2: handle = 0x76b5190000000902, type = VK_OBJECT_TYPE_IMAGE_VIEW; Object 3: handle = 0xf799000000000a9, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x45125641 | vkCmdBeginRenderPass(): pRenderPassBegin->pNext<VkRenderPassAttachmentBeginInfo>.pAttachments[0].usage is (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), which has an inherited usage subset from VkImageViewUsageCreateInfo of (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), but the VkFramebuffer was created with vkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos[0].usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT. The Vulkan spec states: If framebuffer was created with a VkFramebufferCreateInfo::flags value that included VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the pAttachments member of a VkRenderPassAttachmentBeginInfo structure included in the pNext chain must be a VkImageView with an inherited usage equal to the usage member of the corresponding element of VkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos used to create framebuffer (https://vulkan.lunarg.com/doc/view/1.3.268.0/windows/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-04627)
2023-12-17T16:50:29.185082Z ERROR log: objects: (type: RENDER_PASS, hndl: 0x18543900000000ff, name: ?), (type: FRAMEBUFFER, hndl: 0x1e7d540000000102, name: ?), (type: IMAGE_VIEW, hndl: 0x76b5190000000902, name: ?), (type: IMAGE, hndl: 0xf799000000000a9, name: ?)
Windows 11, AMD 6800xt driver 23.5.2, Vulkan SDK 1.3.250.1, same issue.
I tested disabling layers with vulkan configurator (it’s part of the VulkanSDK), and found that forcing the OBS layer off fixed it.