Commit 056c45fe authored by Erik Kurzinger's avatar Erik Kurzinger

wayland/buffer: Try realizing EGLStream before EGLImage buffer

Currently, it is assumed that if querying the EGL_TEXTURE_FORMAT of a
Wayland buffer succeeds it is an EGLImage. However, this assumption will no
longer hold on upcoming versions of the NVIDIA EGL Wayland driver which
will include support for querying this attribute for EGLStream buffers as
well. Hence, we need to check if buffers are EGLStreams first.

Fixes #488
GNOME/mutter!477
parent 2ac7f7f1
......@@ -119,14 +119,6 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
return TRUE;
}
if (meta_egl_query_wayland_buffer (egl, egl_display, buffer->resource,
EGL_TEXTURE_FORMAT, &format,
NULL))
{
buffer->type = META_WAYLAND_BUFFER_TYPE_EGL_IMAGE;
return TRUE;
}
#ifdef HAVE_WAYLAND_EGLSTREAM
stream = meta_wayland_egl_stream_new (buffer, NULL);
if (stream)
......@@ -146,6 +138,14 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
}
#endif /* HAVE_WAYLAND_EGLSTREAM */
if (meta_egl_query_wayland_buffer (egl, egl_display, buffer->resource,
EGL_TEXTURE_FORMAT, &format,
NULL))
{
buffer->type = META_WAYLAND_BUFFER_TYPE_EGL_IMAGE;
return TRUE;
}
dma_buf = meta_wayland_dma_buf_from_buffer (buffer);
if (dma_buf)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment