diff options
author | Daniel Stone <daniels@collabora.com> | 2017-07-11 13:30:06 +0100 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2017-07-22 14:22:03 +0200 |
commit | e82d039ec283a238caf08504ab3132d2c2cd2885 (patch) | |
tree | beef25aa0ed3a2629c1f71aec963261f73604477 | |
parent | 4c3e166469b724ff1b3c232473b1dacca2a42fe4 (diff) | |
download | mutter-e82d039ec283a238caf08504ab3132d2c2cd2885.tar.gz |
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 <daniels@collabora.com>
-rw-r--r-- | src/wayland/meta-wayland-buffer.c | 5 |
1 files 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); |