GL_OES_EGL_image_external is not available for GL-based hosts with mesa drivers
Running Steam in a VM that uses OpenGL as the host rendering API (instead of GLES) produces the following errors:
[2022-08-16T15:18:28.144105558-07:00 DEBUG rutabaga_gfx::virgl_renderer] missing GL_OES_EGL_image_external extensions
[2022-08-16T15:18:28.144265745-07:00 DEBUG devices::virtio::gpu] Some(ResourceCreate3d) -> ErrRutabaga(ComponentError(22))
[2022-08-16T15:18:28.144543848-07:00 DEBUG devices::virtio::gpu] Some(ResourceAttachBacking) -> ErrRutabaga(InvalidResourceId)
[2022-08-16T15:18:28.144687738-07:00 DEBUG devices::virtio::gpu] Some(CtxAttachResource) -> ErrRutabaga(InvalidResourceId)
[2022-08-16T15:18:28.144814122-07:00 DEBUG devices::virtio::gpu] Some(ResourceAssignUuid) -> ErrInvalidResourceId
[2022-08-16T15:18:28.144932900-07:00 DEBUG devices::virtio::gpu] Some(CtxDetachResource) -> ErrRutabaga(InvalidResourceId)
[ 19.305532] [drm:virtio_gpu_dequeue_ctrl_func] *ERROR* response 0x1200 (command 0x106)
[ 19.307324] [drm:virtio_gpu_dequeue_ctrl_func] *ERROR* response 0x1200 (command 0x202)
[ 19.309451] [drm:virtio_gpu_dequeue_ctrl_func] *ERROR* response 0x1203 (command 0x10b)
[ 19.311462] [drm:virtio_gpu_dequeue_ctrl_func] *ERROR* response 0x1200 (command 0x203)
The cause is that mesa doesn't support GL_OES_EGL_image_external
for OpenGL contexts.
In https://gitlab.freedesktop.org/virgl/virglrenderer/-/blob/master/src/vrend_renderer.c#L7807 the feature check fails and texture import fails:
It seems that vrend assumes support for the similarly named extension GL_OES_EGL_image
in its usage patterns, but gates on the GL_OES_EGL_image_external
extension by mistake.
GL_OES_EGL_image_external
requires target == GL_TEXTURE_EXTERNAL_OES
when calling glImageTargetTexture2DOES()
, while virgl uses GL_TEXTURE_2D
as allowed by GL_OES_EGL_image
, instead.
/cc @chadversary @zzyiwei