protonscr

[BUG] Cannot successfully use OpenXR with OpenGL

steamvrclosed bugNeed Retest
ValveSoftware/SteamVR-for-Linux#546 · opened 2022-11-05 by farmboy0 · updated 2022-12-01 · 8 comments · github
Ffarmboy0 2022-11-05 github

Describe the bug
I tried 3 different OpenGL+OpenXR samples that all fail to correctly run.
The samples tried are the following:

  1. OpenXR-SDK's hello_xr with OpenGL as graphics parameter set
  2. LWJGL3's HelloOpenXRGL demo
  3. https://github.com/ChatImproVR/rust-opengl-openxr-example

The first 2 listed are suffering from the fact that they are not looking for
GL_SRGB8 or GL_SRGB8_ALPHA8 which are the only xolor formats
SteamVR's EnumerateSwapchainFormats will return.
But that it is easily fixed but will not make the samples run completely either.

To Reproduce
Steps to reproduce the behavior:

  1. Run any of the samples listed above, fixing color format selection like described

Expected behavior
I expect the samples to run successfully or at least produce errors why they cant.

System Information (please complete the following information):

  • Distribution: [Arch/Manjaro/Ubuntu/etc.] Gentoo
  • SteamVR version: [E.g. 1.7.2] 1.24
  • Steam client version: [build number or date] 19.10.2022 00:56:44
  • Opted into Steam client beta?: [Yes/No] No
  • Graphics driver version: [run nvidia-settings or vulkaninfo | grep driverInfo: Mesa 22.2.2
  • Gist for SteamVR System Information: [See instructions] https://gist.github.com/farmboy0/16f79f8c08e6062bb1cf5365963499ce

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
xrclient_hello_xr.txt
xrclient_java.txt
xrclient_ugly_gl.txt

If there are OpenGL samples that can successfully run I would appreciate it a lot if you could provide them.

Note: Commenters who are also experiencing this issue are encouraged to include the "System Information" section in their replies.

CChristophHaag 2022-11-05 github

There's this bug #421

In https://gitlab.freedesktop.org/monado/demos/openxr-simple-example I worked around it. godot_openxr does too.

Ffarmboy0 2022-11-07 github

@ChristophHaag Thanks alot

Ccnlohr 2022-11-09 github

What version of SteamVR are you using? We are in the process of pushing a fix for newer SteamVR.

Ffarmboy0 2022-11-10 github

Im on beta channel so currently running 1.25.1

Ccnlohr 2022-11-11 github

@farmboy0, our fix should be in 1.25 (It was a bug from 1.16-1.24). We are now doing the following:

		m_glxDisplayToRestore = glXGetCurrentDisplay();
		m_glxContextToRestore = glXGetCurrentContext();
		m_glxDrawableToRestore = glXGetCurrentDrawable();
		if( m_glxDisplayToRestore != m_xDisplay || m_glxDrawable != m_glxDrawableToRestore || m_glxContextToRestore != m_glxContext )
			glXMakeCurrent( m_xDisplay, m_glxDrawable, m_glxContext );

Can you confirm that you still need to perform the glXMakeCurrent command in your app using the current beta?

Ffarmboy0 2022-11-14 github

I can confirm that

  1. hello_xr works partially, it renders to the headset but the desktop window shows only artifacts.
  2. The LWJGL3 sample works fine headset and desktop window
  3. The rust sample doesnt run anymore with some weird error, thats a cargo error, nothing to do with OpenXR
CChristophHaag 2022-11-14 github

hello_xr works partially, it renders to the headset but the desktop window shows only artifacts.

fyi this is normal, the hello_xr desktop window doesn't have any output

Ffarmboy0 2022-12-01 github

I consider this issue to be resolved, I have no problems anymore using OpenGL with OpenXR

Nothing extracted yet.