From e82d039ec283a238caf08504ab3132d2c2cd2885 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 11 Jul 2017 13:30:06 +0100 Subject: [PATCH] wayland/buffer: Create EGLImage with no context Since a wl_buffer is independent of the GL context in use (unlike, e.g., a GL renderbuffer), EGLImages with the EGL_WAYLAND_BUFFER_WL target must pass EGL_NO_CONTEXT as the context. Quoting from the EGL_WL_bind_wayland_display spec: After querying the wl_buffer layout, create EGLImages for the planes by calling eglCreateImageKHR with wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL context. The check was already present inside _cogl_egl_create_image. https://bugzilla.gnome.org/show_bug.cgi?id=785263 Signed-off-by: Daniel Stone --- src/wayland/meta-wayland-buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c index 85c3c228f..1b10c51ff 100644 --- a/src/wayland/meta-wayland-buffer.c +++ b/src/wayland/meta-wayland-buffer.c @@ -221,7 +221,6 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer, ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend); EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context); - EGLContext egl_context = cogl_egl_context_get_egl_context (cogl_context); int format, width, height, y_inverted; CoglPixelFormat cogl_format; EGLImageKHR egl_image; @@ -265,7 +264,9 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer, return FALSE; } - egl_image = meta_egl_create_image (egl, egl_display, egl_context, + /* The WL_bind_wayland_display spec states that EGL_NO_CONTEXT is to be used + * in conjunction with the EGL_WAYLAND_BUFFER_WL target. */ + egl_image = meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT, EGL_WAYLAND_BUFFER_WL, buffer->resource, NULL, error);