From 11a195747ab37b70bf90db40e67a1d8904de9b76 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Fri, 18 Nov 2022 14:54:18 +0000 Subject: [PATCH] backend: egl: don't assume glEGLImageTargetTexStorage exists Use eglGetProcAddress instead. Fixes #932 --- src/backend/gl/egl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/backend/gl/egl.c b/src/backend/gl/egl.c index 0c3c0d4840..5c3b553f9f 100644 --- a/src/backend/gl/egl.c +++ b/src/backend/gl/egl.c @@ -36,6 +36,8 @@ struct egl_data { EGLContext ctx; }; +static PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC glEGLImageTargetTexStorage = NULL; + /** * Free a glx_texture_t. */ @@ -202,6 +204,14 @@ static backend_t *egl_init(session_t *ps) { goto end; } + glEGLImageTargetTexStorage = + (PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC)eglGetProcAddress("glEGLImageTargetTexS" + "torageEXT"); + if (glEGLImageTargetTexStorage == NULL) { + log_error("Failed to get glEGLImageTargetTexStorageEXT."); + goto end; + } + gd->gl.decouple_texture_user_data = egl_decouple_user_data; gd->gl.release_user_data = egl_release_image; @@ -270,7 +280,7 @@ egl_bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, b wd->dim = 0; wd->inner->refcount = 1; glBindTexture(GL_TEXTURE_2D, inner->texture); - glEGLImageTargetTexStorageEXT(GL_TEXTURE_2D, eglpixmap->image, NULL); + glEGLImageTargetTexStorage(GL_TEXTURE_2D, eglpixmap->image, NULL); glBindTexture(GL_TEXTURE_2D, 0); gl_check_err();