I've pushed an egl_context branch to https://gitlab.freedesktop.org/jameshogan/openxr-simple-example.git which adds a commit to reproduce this. It clears the EGL context before calling xrCreateSwapchain() and xrCreateSession(), then verifies its still clear afterwards.
Check EGL is being used:
Using EGL with context 0x559d33742020
SteamVR currently shows these warning messages:
EGL CONTEXT CHANGED (nil) to 0x559d33742020 by xrCreateSession()
EGL CONTEXT CHANGED (nil) to 0x559d33742020 by xrCreateSwapchain()
EGL CONTEXT CHANGED (nil) to 0x559d33742020 by xrCreateSwapchain()
Nothing extracted yet.
Describe the bug
If the app's specified EGL context (via
XR_MNDX_egl_enableextension) is not current whenxrCreateSessionorxrCreateSwapchainare called, those calls return with the EGL context changed to the app's EGL context. Whenever changing the EGL context, SteamVR should restore the previous value, as is now done for GLX, otherwise an app may legitimately assume the context isn't in use and attempt toeglMakeCurrentfrom another thread, which then fails witheglGetError()returning EGL_BAD_ACCESS.(My notes indicate that prior to 1.16.2, linux_v1.14 switched GLX context but didn't restore, similar to this bug, but I think only for
xrCreateSwapchain).To Reproduce
Steps to reproduce the behavior:
eglMakeCurrent()to clear the EGL contextxrCreateSwapchainorxrCreateSession(usingXR_MNDX_egl_enable)eglGetCurrentContext()and observe that the context has been alteredExpected behavior
eglGetCurrentContext()before and after these calls should always show the exact same value.System Information (please complete the following information):
Please use the latest Steam beta client and SteamVR beta for your bug reports!