summaryrefslogtreecommitdiff
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-08-20 13:19:10 +0800
committerChia-I Wu <olv@lunarg.com>2010-08-20 19:22:51 +0800
commit5eb33596a0db26586957365ab27fc6afdebfe057 (patch)
treeba1a37e4dcbed131d1a774d824b82d4522d0aec4 /src/egl/main/eglcontext.c
parentce2cae4130548872a0205097b0b5dbe0f4f57d5f (diff)
egl: Fix context API check and be verbose.
The API of the context was not checked against EGL_RENDERABLE_TYPE when there was no attribute list. Move the check to _eglInitContext, and be verbose about common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not set, or eglBindAPI not called).
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 9fc529613e5..e72664c23cc 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -83,15 +83,6 @@ _eglParseContextAttribList(_EGLContext *ctx, const EGLint *attrib_list)
}
}
- if (err == EGL_SUCCESS && ctx->Config) {
- EGLint renderable_type, api_bit;
-
- renderable_type = GET_CONFIG_ATTRIB(ctx->Config, EGL_RENDERABLE_TYPE);
- api_bit = _eglGetContextAPIBit(ctx);
- if (!(renderable_type & api_bit))
- err = EGL_BAD_CONFIG;
- }
-
return err;
}
@@ -121,6 +112,17 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
ctx->ClientVersion = 1; /* the default, per EGL spec */
err = _eglParseContextAttribList(ctx, attrib_list);
+ if (err == EGL_SUCCESS && ctx->Config) {
+ EGLint renderable_type, api_bit;
+
+ renderable_type = GET_CONFIG_ATTRIB(ctx->Config, EGL_RENDERABLE_TYPE);
+ api_bit = _eglGetContextAPIBit(ctx);
+ if (!(renderable_type & api_bit)) {
+ _eglLog(_EGL_DEBUG, "context api is 0x%x while config supports 0x%x",
+ api_bit, renderable_type);
+ err = EGL_BAD_CONFIG;
+ }
+ }
if (err != EGL_SUCCESS)
return _eglError(err, "eglCreateContext");