summaryrefslogtreecommitdiff
path: root/gui-wm/hyprland/files/legacy-renderer-fix.patch
blob: a1ecbbd7ec5a4dd43f5bc4736d122e1f549896f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# https://github.com/hyprwm/Hyprland/pull/4928
# https://bugs.gentoo.org/925912
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 64f582f2..a6f2dc03 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -353,7 +353,11 @@ void CHyprOpenGLImpl::end() {
     // check for gl errors
     const GLenum ERR = glGetError();
 
+#ifdef GLES2
+    if (ERR == GL_CONTEXT_LOST_KHR) /* We don't have infra to recover from this */
+#else
     if (ERR == GL_CONTEXT_LOST) /* We don't have infra to recover from this */
+#endif
         RASSERT(false, "glGetError at Opengl::end() returned GL_CONTEXT_LOST. Cannot continue until proper GPU reset handling is implemented.");
 }
 
@@ -2057,7 +2061,13 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
     tex.m_vSize = IMAGESIZE * scale;
 
     // copy the data to an OpenGL texture we have
-    const GLint glIFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_RGB32F : GL_RGBA;
+    const GLint glIFormat = CAIROFORMAT == CAIRO_FORMAT_RGB96F ?
+#ifdef GLES2
+	  GL_RGB32F_EXT :
+#else
+	  GL_RGB32F :
+#endif
+	  GL_RGBA;
     const GLint glFormat  = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_RGB : GL_RGBA;
     const GLint glType    = CAIROFORMAT == CAIRO_FORMAT_RGB96F ? GL_FLOAT : GL_UNSIGNED_BYTE;