Patch the OpenXR headers to get EGL from GLAD if we're using it

This commit is contained in:
David Snopek 2024-11-04 10:40:05 -06:00
parent 1bffd6c73b
commit 09e09d9335
3 changed files with 36 additions and 1 deletions

View File

@ -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: |

View File

@ -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)

View File

@ -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)