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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant