eglWaitClient() doesn't work for surfaceless contexts
Submitted by Mike Gorchak
Assigned to mes..@..op.org
When surfaceless contexts are in use (for example, for FBO rendering), eglWaitClient return an error EGL_BAD_CURRENT_SURFACE. According to spec it should do glFinish()-like behavior disregarding if it has bound surface to the context or not.
In case of using DRI2 backend it happens that in case of surfaceless context dri2_wait_client() is not called at all and aborted at _eglWaitClientCommon() function with following check:
/* let bad current context imply bad current surface */ if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT || _eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE) RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);