[waffle] [PATCH 4/4] wegl: remove dl_can_open() calls from check_context_attrs()
Emil Velikov
emil.l.velikov at gmail.com
Tue Sep 1 05:35:52 PDT 2015
Not required and a little bit wrong bth.
EGL already provides a way to query which APIs are supported, so let's
drop this and implement this appropriately.
Note that we're added a minimum requirement of EGL 1.2 as things will
explode badly with versions prior to it.
XXX: FINISHME
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
src/waffle/egl/wegl_config.c | 28 ++++------------------------
src/waffle/egl/wegl_display.c | 4 ++++
2 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/src/waffle/egl/wegl_config.c b/src/waffle/egl/wegl_config.c
index a79bc53..6f1e42e 100644
--- a/src/waffle/egl/wegl_config.c
+++ b/src/waffle/egl/wegl_config.c
@@ -57,6 +57,7 @@ check_context_attrs(struct wegl_display *dpy,
switch (attrs->context_api) {
case WAFFLE_CONTEXT_OPENGL:
+ // EGL >= 1.4, see supports_context_api(), eglQueryString(display, EGL_CLIENT_APIS)
if (!wcore_config_attrs_version_eq(attrs, 10) && !dpy->KHR_create_context) {
wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
"KHR_EXT_create_context is required in order to "
@@ -77,33 +78,18 @@ check_context_attrs(struct wegl_display *dpy,
return false;
}
- if (!plat->vtbl->dl_can_open(plat, WAFFLE_DL_OPENGL)) {
- wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "failed to open the OpenGL library");
- return false;
- }
-
return true;
case WAFFLE_CONTEXT_OPENGL_ES1:
- if (!plat->vtbl->dl_can_open(plat, WAFFLE_DL_OPENGL_ES1)) {
- wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "failed to open the OpenGL ES1 library");
- return false;
- }
-
+ // EGL >= 1.2, see supports_context_api(), eglQueryString(display, EGL_CLIENT_APIS)
return true;
case WAFFLE_CONTEXT_OPENGL_ES2:
- if (!plat->vtbl->dl_can_open(plat, WAFFLE_DL_OPENGL_ES2)) {
- wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "failed to open the OpenGL ES2 library");
- return false;
- }
-
+ // EGL >= 1.3, see supports_context_api(), eglQueryString(display, EGL_CLIENT_APIS)
return true;
case WAFFLE_CONTEXT_OPENGL_ES3:
+ // EGL >= 1.4 implied by the extension below, see supports_context_api(), eglQueryString(display, EGL_CLIENT_APIS)
if (!dpy->KHR_create_context) {
wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
"EGL_KHR_create_context is required to request "
@@ -111,12 +97,6 @@ check_context_attrs(struct wegl_display *dpy,
return false;
}
- if (!plat->vtbl->dl_can_open(plat, WAFFLE_DL_OPENGL_ES3)) {
- wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "failed to open the OpenGL ES3 library");
- return false;
- }
-
return true;
default:
diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c
index 88fce7a..1480f3b 100644
--- a/src/waffle/egl/wegl_display.c
+++ b/src/waffle/egl/wegl_display.c
@@ -117,15 +117,19 @@ wegl_display_supports_context_api(struct wcore_display *wc_dpy,
switch (waffle_context_api) {
case WAFFLE_CONTEXT_OPENGL:
+ // EGL >= 1.4, see check_context_attrs(), eglQueryString(display, EGL_CLIENT_APIS)
waffle_dl = WAFFLE_DL_OPENGL;
break;
case WAFFLE_CONTEXT_OPENGL_ES1:
+ // EGL >= 1.2, see check_context_attrs(), eglQueryString(display, EGL_CLIENT_APIS)
waffle_dl = WAFFLE_DL_OPENGL_ES1;
break;
case WAFFLE_CONTEXT_OPENGL_ES2:
+ // EGL >= 1.3, see check_context_attrs(), eglQueryString(display, EGL_CLIENT_APIS)
waffle_dl = WAFFLE_DL_OPENGL_ES2;
break;
case WAFFLE_CONTEXT_OPENGL_ES3:
+ // EGL > = 1.4 implied by the extension below, see check_context_attrs(), eglQueryString(display, EGL_CLIENT_APIS)
if (!dpy->KHR_create_context)
return false;
--
2.5.0
More information about the waffle
mailing list