From: Arnaud Vrac <av...@freebox.fr>

The GL_EXT_unpack_subimage and GL_EXT_texture_rg are part of the core ES
3.0 specification, so also check the GL driver version in addition to
the extension string to determine if those features are supported.
---
 libweston/gl-renderer.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index e237edf2..3dce8c2f 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -3202,9 +3202,6 @@ gl_renderer_setup_egl_extensions(struct weston_compositor 
*ec)
                gr->has_dmabuf_import_modifiers = 1;
        }
 
-       if (weston_check_egl_extension(extensions, "GL_EXT_texture_rg"))
-               gr->has_gl_texture_rg = 1;
-
        if (weston_check_egl_extension(extensions, "EGL_KHR_fence_sync") &&
            weston_check_egl_extension(extensions, 
"EGL_ANDROID_native_fence_sync")) {
                gr->create_sync =
@@ -3669,9 +3666,14 @@ gl_renderer_setup(struct weston_compositor *ec, 
EGLSurface egl_surface)
        else
                ec->read_format = PIXMAN_a8b8g8r8;
 
-       if (weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage"))
+       if (gr->gl_major >= 3 ||
+           weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage"))
                gr->has_unpack_subimage = 1;
 
+       if (gr->gl_major >= 3 ||
+           weston_check_egl_extension(extensions, "GL_EXT_texture_rg"))
+               gr->has_gl_texture_rg = 1;
+
        if (weston_check_egl_extension(extensions, "GL_OES_EGL_image_external"))
                gr->has_egl_image_external = 1;
 
-- 
2.15.0

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to