summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index e854903a6f1..19f54dec660 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -593,13 +593,13 @@ dri2_setup_screen(_EGLDisplay *disp)
}
disp->ClientAPIs = 0;
- if (api_mask & (1 <<__DRI_API_OPENGL))
+ if ((api_mask & (1 <<__DRI_API_OPENGL)) && _eglIsApiValid(EGL_OPENGL_API))
disp->ClientAPIs |= EGL_OPENGL_BIT;
- if (api_mask & (1 <<__DRI_API_GLES))
+ if ((api_mask & (1 << __DRI_API_GLES)) && _eglIsApiValid(EGL_OPENGL_ES_API))
disp->ClientAPIs |= EGL_OPENGL_ES_BIT;
- if (api_mask & (1 << __DRI_API_GLES2))
+ if ((api_mask & (1 << __DRI_API_GLES2)) && _eglIsApiValid(EGL_OPENGL_ES_API))
disp->ClientAPIs |= EGL_OPENGL_ES2_BIT;
- if (api_mask & (1 << __DRI_API_GLES3))
+ if ((api_mask & (1 << __DRI_API_GLES3)) && _eglIsApiValid(EGL_OPENGL_ES_API))
disp->ClientAPIs |= EGL_OPENGL_ES3_BIT_KHR;
assert(dri2_dpy->image_driver || dri2_dpy->dri2 || dri2_dpy->swrast);