From d42546dda8fdb3d044e715d0a6a1a74cd411acbe Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Mon, 5 Apr 2021 18:05:38 +0200 Subject: [PATCH] GL: Do not set backbuffer on Wayland memory copy This aims to workaround a Mesa bug that causes crash on Intel GPUs caused by calling "glDrawBuffer (GL_BACK)" on Wayland where there is no actual backbuffer in GStreamer OpenGL context. --- gst-libs/gst/gl/gstglmemory.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index 76c04eb1b..cd3481847 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -762,7 +762,13 @@ gst_gl_memory_copy_teximage (GstGLMemory * src, guint tex_id, gl->DeleteFramebuffers (n_fbos, &fbo[0]); if (gl->DrawBuffer) - gl->DrawBuffer (GL_BACK); + gl->DrawBuffer ( +#if GST_GL_HAVE_WINDOW_WAYLAND + GL_NONE +#else + GL_BACK +#endif + ); } gst_memory_unmap (GST_MEMORY_CAST (src), &sinfo); -- 2.28.0