Skip to content

Commit

Permalink
Patch the OpenXR headers to get EGL from GLAD if we're using it
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Nov 4, 2024
1 parent 1bffd6c commit 09e09d9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
# TODO: Figure out somehow how to embed this one.
- name: wayland-scanner dependency
run: |
sudo apt-get install libwayland-bin libegl-dev
sudo apt-get install libwayland-bin
- name: Free disk space on runner
run: |
Expand Down
27 changes: 27 additions & 0 deletions thirdparty/openxr/patches/use-egl-from-glad.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff -Nur openxr-orig/src/common/xr_dependencies.h openxr/src/common/xr_dependencies.h
--- openxr-orig/src/common/xr_dependencies.h 2024-11-04 10:38:11.940682727 -0600
+++ openxr/src/common/xr_dependencies.h 2024-11-04 10:38:46.351415476 -0600
@@ -65,7 +65,11 @@
#endif // XR_USE_GRAPHICS_API_OPENGL

#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
+#ifdef GLAD_ENABLED
+#include "thirdparty/glad/glad/egl.h"
+#else
#include <EGL/egl.h>
+#endif
#endif // XR_USE_GRAPHICS_API_OPENGL_ES

#ifdef XR_USE_GRAPHICS_API_VULKAN
@@ -77,7 +81,11 @@
#endif // XR_USE_PLATFORM_WAYLAND

#ifdef XR_USE_PLATFORM_EGL
+#ifdef GLAD_ENABLED
+#include "thirdparty/glad/glad/egl.h"
+#else
#include <EGL/egl.h>
+#endif
#endif // XR_USE_PLATFORM_EGL

#if defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB)
8 changes: 8 additions & 0 deletions thirdparty/openxr/src/common/xr_dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
#endif // XR_USE_GRAPHICS_API_OPENGL

#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
#ifdef GLAD_ENABLED
#include "thirdparty/glad/glad/egl.h"
#else
#include <EGL/egl.h>
#endif
#endif // XR_USE_GRAPHICS_API_OPENGL_ES

#ifdef XR_USE_GRAPHICS_API_VULKAN
Expand All @@ -77,7 +81,11 @@
#endif // XR_USE_PLATFORM_WAYLAND

#ifdef XR_USE_PLATFORM_EGL
#ifdef GLAD_ENABLED
#include "thirdparty/glad/glad/egl.h"
#else
#include <EGL/egl.h>
#endif
#endif // XR_USE_PLATFORM_EGL

#if defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB)
Expand Down

0 comments on commit 09e09d9

Please sign in to comment.