Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strengthen the guarantees given by XR_KHR_vulkan_enable/XR_KHR_vulkan_enable2 #169

Open
yshui opened this issue May 8, 2024 · 3 comments
Labels
synced to gitlab A corresponding issue has been filed in the Khronos internal GitLab

Comments

@yshui
Copy link

yshui commented May 8, 2024

In section "Swapchain Image Layout", it is stated that:

When an application acquires a swapchain image by calling xrAcquireSwapchainImage in a session created using XrGraphicsBindingVulkan2KHR, the OpenXR runtime must guarantee that:

  • The image has a memory layout compatible with VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL for color images, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL for depth images.

Which means the application does not have full knowledge of the image layout, only that it is compatible with some layout. However, to perform layout transitions in Vulkan, one must guarantee that (emphasis mine):

The old layout must either be VK_IMAGE_LAYOUT_UNDEFINED, or match the current layout of the image subresource range.

This essentially means the application can't reliably perform image layout transition if it wants to. Can we strengthen the guarantee, and replace "compatible with" with "matching"?

@yshui
Copy link
Author

yshui commented May 8, 2024

From my knowledge, given how it's implemented at the moment, monado does have this guarantee.

@yshui
Copy link
Author

yshui commented May 8, 2024

Ah, so this is a problem for runtimes as well. Because the spec doesn't require the application to leave the images in a specific layout (again, only "compatible with"), the runtime can't reliably perform layout transition either. I think this is a bigger problem for runtimes, as the application can most likely get by without doing transitions, or can tolerant image content being discarded.

@rpavlik-bot
Copy link
Collaborator

An issue (number 2287) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2287 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.

@rpavlik-bot rpavlik-bot added the synced to gitlab A corresponding issue has been filed in the Khronos internal GitLab label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synced to gitlab A corresponding issue has been filed in the Khronos internal GitLab
Projects
None yet
Development

No branches or pull requests

2 participants