glEGLImageTargetTexture2DOES needs to be called always after a buffer was (re-) attached to a Wayland surface
As discussed on IRC:
AFAICT mutter only calls glEGLImageTargetTexture2DOES
once for each Wayland buffer, then destroys the EGLImage
and just re-uses the GL texture as is. There was a discussion about this on the #dri-devel
IRC channel a while ago, and the conclusion was that glEGLImageTargetTexture2DOES
needs to be called always after the buffer is (re-)attached to a Wayland surface and before the associated GL texture is used for drawing, or the buffer contents may not be displayed correctly with all drivers (I don't know of any Mesa drivers affected by this though). The EGLImage
and GL texture object can be re-used between glEGLImageTargetTexture2DOES
calls.