glcolorconvert: conversion to multi-planar format broken for GLES 2.0 with GL_NV_draw_buffers
This is either a bug in glcolorconvert
or Mesa. It has been reproduced on RadeonSi, Iris, Crocus and Panfrost. On GLES 2.0 hardware this currently breaks the internal screen recorder in Gnome-Shell 46.
Reproducer:
MESA_GLES_VERSION_OVERRIDE=2.0 gst-launch-1.0 videotestsrc ! glupload ! glcolorconvert ! gldownload ! "video/x-raw,format=I420,width=640,height=480" ! waylandsink
Only the first plane gets valid data in the shader, resulting in something like this:
Note that there is a check here, however Mesa exposes GL_NV_draw_buffers
(and GL_EXT_draw_buffers
but Gst doesn't check for that) so gl->DrawBuffers
is set.
I wonder if Mesa actually only support GL_EXT_draw_buffers
while the Gst implementation is written for GL_NV_draw_buffers
:
This extension is similar to the combination of the GL_NV_draw_buffers and GL_NV_fbo_color_attachments extensions, but imposes certain restrictions informed by the OpenGL ES 3.0 API.