diff --git a/pkgs/flatpak/gstreamer-1.0/gst-plugins-base-do-not-set-backbuffer.patch b/pkgs/flatpak/gstreamer-1.0/gst-plugins-base-do-not-set-backbuffer.patch new file mode 100644 index 00000000..d4fe1aa0 --- /dev/null +++ b/pkgs/flatpak/gstreamer-1.0/gst-plugins-base-do-not-set-backbuffer.patch @@ -0,0 +1,34 @@ +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 + diff --git a/pkgs/flatpak/gstreamer-1.0/gst-plugins-base.json b/pkgs/flatpak/gstreamer-1.0/gst-plugins-base.json index bcf8b6af..48d1bd55 100644 --- a/pkgs/flatpak/gstreamer-1.0/gst-plugins-base.json +++ b/pkgs/flatpak/gstreamer-1.0/gst-plugins-base.json @@ -25,6 +25,10 @@ { "type": "patch", "path": "gst-plugins-base-autodetect-subtitle-text-encoding.patch" + }, + { + "type": "patch", + "path": "gst-plugins-base-do-not-set-backbuffer.patch" } ] }