}
/* flush before context switch */
- if (old_ctx && dri2_drv->glFlush)
+ if (old_ctx)
dri2_drv->glFlush();
ddraw = (dsurf) ? dri2_dpy->vtbl->get_dri_drawable(dsurf) : NULL;
if (dri2_ctx && dri2_sync->base.SyncStatus == EGL_UNSIGNALED_KHR &&
(flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)) {
/* flush context if EGL_SYNC_FLUSH_COMMANDS_BIT_KHR is set */
- if (dri2_drv->glFlush)
- dri2_drv->glFlush();
+ dri2_drv->glFlush();
}
/* if timeout is EGL_FOREVER_KHR, it should wait without any timeout.*/
dri2_drv->glFlush = (void (*)(void))
dri2_drv->get_proc_address("glFlush");
+ /* if glFlush is not available things are horribly broken */
+ if (!dri2_drv->glFlush) {
+ _eglLog(_EGL_WARNING, "DRI2: failed to find glFlush entry point");
+ return EGL_FALSE;
+ }
+
dri2_drv->handle = handle;
return EGL_TRUE;