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

Fix incorrect handling of xrCreateSwapchainAndroidSurfaceKHR in template_gen_dispatch.cpp #99

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

quic-yli25
Copy link

There is a bug in template_gen_dispatch.cpp that causes an error when destroying swapchain created by xrCreateSwapchainAndroidSurfaceKHR.

Here is an example. On Quest3, xrCreateSwapchainAndroidSurfaceKHR returns XR_SUCCESS, but xrDestroySwapchain returns XR_ERROR_HANDLE_INVALID.

CHECK(xrCreateSwapchainAndroidSurfaceKHR(session, &createInfo, &swapchain, &surface) == XR_SUCCESS);
CHECK(xrDestroySwapchain(swapchain) == XR_SUCCESS);

Check the log, there is an error message from conformance layer.

XrApiLayer_runtime_conformance: ERROR: Conformance Layer: Unknown handle used, created by unrecognized API call? Message = Encountered unknown XR_OBJECT_TYPE_SWAPCHAIN handle with value 519582891248
OpenXR_Conformance:   CHECK( xrDestroySwapchain(swapchain) == XR_SUCCESS )
OpenXR_Conformance: with expansion:
OpenXR_Conformance:   XR_ERROR_HANDLE_INVALID == XR_SUCCESS

template_gen_dispatch.cpp identifies a command as a create command if the function name includes "xrCreate" and the last parameter is a handle. xrCreateSwapchainAndroidSurfaceKHR is a special case because this is a create command but returned swapchain is not the last parameter. So template_gen_dispatch.cpp doesn't handle this command correctly.

Modify template_gen_dispatch.cpp, register handle state for swapchain created by xrCreateSwapchainAndroidSurfaceKHR.

@quic-yli25
Copy link
Author

Hi @rpavlik. I create a MR for this issue we discussed, thanks!

@rpavlik-bot rpavlik-bot added the synced to gitlab Synced to internal Khronos gitlab label Dec 3, 2024
@rpavlik-bot
Copy link
Collaborator

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

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

@rpavlik
Copy link
Contributor

rpavlik commented Dec 3, 2024

Can you make sure you have the CLA approved @quic-yli25 ?

@quic-yli25
Copy link
Author

Can you make sure you have the CLA approved @quic-yli25 ?

OK, I have signed CLA.

src/scripts/template_gen_dispatch.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synced to gitlab Synced to internal Khronos gitlab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants