Support GL_OES_EGL_image_external for external media formats
Spun-off from #275 (closed) and the discussion in !892 (merged).
Virglrenderer mistakenly gated the use of glEglImageTargetTexture2DOES()
on support for GL_OES_EGL_image_external
, though the usage patterns assumed support for GL_OES_EGL_image
instead.
!892 (merged) corrects the gating such that GL_OES_EGL_image
is correctly checked, and GL_OES_EGL_image_external
is dropped from consideration. Additionally, however, we'd like to utilize GL_OES_EGL_image_external
to import media formats (YUV, ...) using glEGLImageTargetTexture2DOES()
with GL_TEXTURE_EXTERNAL_OES
based on discussion beginning with !892 (057100b5, comment 1511775).
Currently (Mesa 22.3.x) only advertises support for GL_OES_EGL_image_external
on GLES drivers, though it is believed that support on GL drivers can be added with trivial effort if necessary. Historically, it seems that external media formats on GL-based are converted to RGB formats by custom shaders instead of implicit driver behavior , potentially explaining why GL support for this extension has not already been added. Discussion on this is appreciated.
According to !892 (057100b5, comment 1511775) and the subsequent comment, adding support for GL_OES_EGL_image_external
involves detecting when external images with media formats are imported, testing for the extension, setting the target to GL_TEXTURE_EXTERNAL_OES
, and removing the VREND_STORAGE_GL_IMMUTABLE
flag. There may be extra gotchas in other parts of the vrend_renderer, also.