openvr icon indicating copy to clipboard operation
openvr copied to clipboard

[Vulkan] vr::VROverlay()->SetOverlayTexture validation layer error

Open Nyabsi opened this issue 6 months ago • 0 comments

  • Operating System: Windows 10 21H2 Build 19044
  • SteamVR Version: Beta 2.12.1
  • GPU: RX 6800 XT
  • Driver Version: 25.3.1 (Vulkan Version 1.3.302)

I'm working on a cross-platform Vulkan based OpenVR Overlay using OpenVR SDK 2.7.1 which follows the practices documented at https://github.com/ValveSoftware/openvr/wiki/Vulkan and I am targetting Vulkan 1.1 spec (the error does happen on 1.2 and 1.3 as well)

When calling vr::VROverlay()->SetOverlayTexture, I receive the following validation error from the validation layer:

vkCreateImage(): pCreateInfo->pNext<VkExternalMemoryImageCreateInfo>.handleTypes is 16 but the initialLayout is VK_IMAGE_LAYOUT_PREINITIALIZED.

according to the Vulkan Specification:

If the pNext chain includes a VkExternalMemoryImageCreateInfo or VkExternalMemoryImageCreateInfoNV structure whose handleTypes member is not 0, initialLayout must be VK_IMAGE_LAYOUT_UNDEFINED

Since I am creating my vkCreateImage with initialLayout being VK_IMAGE_LAYOUT_UNDEFINED , when I am not calling vr::VROverlay()->SetOverlayTexture the validation error does not show up.

My only suspicion left is that SteamVR is calling vkCreateImage internally with VK_IMAGE_LAYOUT_PREINITIALIZED which goes against the Vulkan spec.

Nyabsi avatar Jun 17 '25 10:06 Nyabsi