Skip to content

Commit

Permalink
Workaround SteamVR-for-Linux issue 421
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophHaag committed Aug 6, 2021
1 parent 442e7f4 commit ded51e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/openxr/OpenXRApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,12 @@ void OpenXRApi::render_openxr(int eye, uint32_t texid, bool has_external_texture
return;
}
}

#ifdef __linux__
// TODO: should not be necessary, but is for SteamVR 1.16.4 (but not 1.15.x)
glXMakeCurrent(graphics_binding_gl.xDisplay, graphics_binding_gl.glxDrawable,
graphics_binding_gl.glxContext);
#endif
}

void OpenXRApi::fill_projection_matrix(int eye, godot_real p_z_near, godot_real p_z_far, godot_real *p_projection) {
Expand Down Expand Up @@ -2273,6 +2279,12 @@ int OpenXRApi::get_external_texture_for_eye(int eye, bool *has_support) {
return 0;
}

#ifdef __linux__
// TODO: should not be necessary, but is for SteamVR 1.16.4 (but not 1.15.x)
glXMakeCurrent(graphics_binding_gl.xDisplay, graphics_binding_gl.glxDrawable,
graphics_binding_gl.glxContext);
#endif

// process should be called by now but just in case...
if (state > XR_SESSION_STATE_UNKNOWN && buffer_index != NULL) {
// make sure we know that we're rendering directly to our
Expand Down Expand Up @@ -2499,6 +2511,12 @@ void OpenXRApi::process_openxr() {
// TODO: Tell godot not do render VR to save resources.
// See render_openxr() for the corresponding early exit.
}

#ifdef __linux__
// TODO: should not be necessary, but is for SteamVR 1.16.4 (but not 1.15.x)
glXMakeCurrent(graphics_binding_gl.xDisplay, graphics_binding_gl.glxDrawable,
graphics_binding_gl.glxContext);
#endif
}

////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ded51e6

Please sign in to comment.