egl: Document why EGL_OPENGL{, _ES}_API are mostly identical
authorAdam Jackson <ajax@redhat.com>
Wed, 7 Sep 2016 21:41:56 +0000 (17:41 -0400)
committerAdam Jackson <ajax@redhat.com>
Thu, 8 Sep 2016 17:19:58 +0000 (13:19 -0400)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/egl/main/eglcontext.c

index ebc004d8cf2b839122c452a2a918d7aea8284fdd..057b60fa491e279ee7b9f4982aac63facf0f7795 100644 (file)
@@ -457,6 +457,16 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
 /**
  * Initialize the given _EGLContext object to defaults and/or the values
  * in the attrib_list.
+ *
+ * According to EGL 1.5 Section 3.7:
+ *
+ * "EGL_OPENGL_API and EGL_OPENGL_ES_API are interchangeable for all
+ *  purposes except eglCreateContext."
+ *
+ * And since we only support GL and GLES, this is the only place where the
+ * bound API matters at all. We look up the current API from the current
+ * thread, and stash that in the context we're initializing. Our caller is
+ * responsible for determining whether that's an API it supports.
  */
 EGLBoolean
 _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,