1Name 2 3 KHR_no_config_context 4 5Name Strings 6 7 EGL_KHR_no_config_context 8 9Contributors 10 11 Etay Meiri 12 Alon Or-bach 13 Jeff Vigil 14 Ray Smith 15 Michael Gold 16 James Jones 17 Daniel Kartch 18 Adam Jackson 19 Jon Leech 20 21Contact 22 23 Etay Meiri (etay.meiri 'at' intel.com) 24 25IP Status 26 27 No known IP claims. 28 29Status 30 31 Approved by the EGL Working Group on April 27, 2016 32 33 Approved by the Khronos Board of Promoters on July 22, 2016 34 35Version 36 37 Version 9, 2016/09/08 38 39Number 40 41 EGL Extension #101 42 43Extension Type 44 45 EGL display extension 46 47Dependencies 48 49 EGL 1.4 is required. This extension is written against the EGL 1.5 50 Specification of August 27, 2014. 51 52 Some of the capabilities of these extensions are only available when 53 creating OpenGL or OpenGL ES contexts supporting specific versions or 54 capabilities. All such restrictions are documented in the body of this 55 extension specification. 56 57Overview 58 59 Modern GPUs allow contexts to render to almost any combination of 60 supported color and auxiliary buffer formats. Traditionally EGL context 61 creation is done with respect to an EGLConfig specifying buffer formats, 62 and constrains contexts to only work with surfaces created with a 63 "compatible" config. 64 65 This extension allows creation of GL & ES contexts without specifying an 66 EGLConfig. 67 68New Procedures and Functions 69 70 None. 71 72New Tokens 73 74 Accepted as the <config> parameter of eglCreateContext: 75 76 EGL_NO_CONFIG_KHR ((EGLConfig)0) 77 78Additions to the EGL 1.5 Specification 79 80 Modify the 3rd paragraph of section 2.2 "Rendering Contexts and 81 Drawing Surfaces": 82 83 "Surfaces and contexts are both created with respect to an EGLConfig. 84 The EGLConfig describes the depth of the color buffer components and 85 the types, quantities and sizes of the ancillary buffers (i.e., the 86 depth, multisample, and stencil buffers). It is also possible to 87 create a context without using an EGLConfig, by specifying relevant 88 parameters at creation time (see sections 3.5 and 3.7, respectively)." 89 90 Modify the sixth paragraph of section 2.2: 91 92 "A context can be used with any EGLSurface that it is <compatible> 93 with (subject to the restrictions discussed in the section on 94 address space). A context and surface are compatible if they were 95 created with respect to the same EGLDisplay, and if either of the 96 following sets of conditions apply: 97 98 * The context was created without an EGLConfig. Such contexts match 99 any valid EGLSurface. 100 101 or, 102 103 * The context and surface support the same type of color buffer 104 (RGB or luminance). 105 106 * They have color buffers and ancillary buffers of the same depth. 107 108 ... replicate remainder of this bullet point ... 109 110 As long as the compatibility constraint and the address space ..." 111 112 Insert a new paragraph after paragraph 3 in section 3.7.1 "Creating 113 Rendering Contexts" on p. 51: 114 115 "<config> specifies an EGLConfig defining properties of the context. If 116 <config> is EGL_NO_CONFIG_KHR, the resulting context is said to be 117 created <without reference to an EGLConfig>. In this case, the context 118 must pass the required conformance tests for that client API and must 119 support being made current without a rendering surface. Such support is 120 guaranteed for OpenGL ES 2.0 implementations supporting the 121 GL_OES_surfaceless_context extension, OpenGL ES 3.0 and later versions 122 of OpenGL ES, and OpenGL 3.0 and later versions of OpenGL. Support for 123 other versions and other client APIs is implementation dependent." 124 125 Replace the EGL_BAD_CONFIG error for eglCreateContext on p. 56, and add 126 a new errors: 127 128 "* An EGL_BAD_CONFIG error is generated if <config> is neither 129 EGL_NO_CONFIG_KHR nor a valid <config>. 130 131 * An EGL_BAD_MATCH error is generated if <config> is EGL_NO_CONFIG_KHR, 132 and the requested client API type and version do not support being 133 made current without a rendering surface. 134 135 * An EGL_BAD_MATCH error is generated if <config> is EGL_NO_CONFIG_KHR, 136 and the implementation does not support the requested client API and 137 version." 138 139 Modify the first error for eglMakeCurrent in the list on p. 58: 140 141 "* An EGL_BAD_MATCH error is generated if <draw> or <read> are not 142 compatible with <ctx>, as described in section 2.2." 143 144 Modify the description of eglQueryContext in section 3.7.4 on p. 63: 145 146 "Querying EGL_CONFIG_ID returns the ID of the EGLConfig with respect 147 to which the context was created, or zero if created without 148 respect to an EGLConfig." 149 150Errors 151 152 As described in the body of the extension above. 153 154Conformance Tests 155 156 None 157 158Sample Code 159 160 None 161 162Dependencies On EGL 1.4 163 164 If implemented on EGL 1.4, interactions with EGL 1.5-specific features 165 are removed. 166 167Issues 168 169 1) Should non-conformant no-config contexts be allowed to be created? 170 171 RESOLVED: No. We are not encouraging non-conformant contexts. 172 173 2) Are no-config contexts constrained to those GL & ES implementations 174 which can support them? 175 176 RESOLVED: Yes. ES2 + OES_surfaceless_context, ES 3.0, and GL 3.0 all 177 support binding a surface without a context. This implies that they 178 don't need to know surface attributes at context creation time. 179 180 3) For an OpenGL or OpenGL ES context created with no config, what is the 181 initial state of GL_DRAW_BUFFER and GL_READ_BUFFER for the default 182 framebuffer? 183 184 RESOLVED: This is an implementation detail rather than a spec issue. 185 glReadBuffer/glDrawBuffer have undefined results if called without a 186 current context. The GL_DRAW_BUFFER and GL_READ_BUFFER are set on the 187 first eglMakeCurrent call and can be updated in glReadBuffer and 188 glDrawBuffers calls after that. Therefore, the attribute value with 189 which the context is created is irrelevant from the point of view of the 190 spec and is left up to the implementation. 191 192 4) Can eglMakeCurrent alter the GL_DRAW_BUFFER and GL_READ_BUFFER state of 193 the default framebuffer? 194 195 RESOLVED: Yes, but only on the first call to eglMakeCurrent. The two 196 relevant excerpts from the OpenGL 3.2 Core Profile Specification. 197 From Section 4.2.1 Selecting a Buffer for Writing: 198 199 For the default framebuffer, in the initial state the draw buffer 200 for fragment color zero is BACK if there is a back buffer; FRONT if 201 there is no back buffer; and NONE if no default framebuffer is 202 associated with the context. 203 204 From 4.3.3 Pixel Draw/Read State: 205 206 For the default framebuffer, in the initial state the read buffer is 207 BACK if there is a back buffer; FRONT if there is no back buffer; 208 and NONE if no default framebuffer is associated with the context. 209 210 Based on the above excerpts on the first call to eglMakeCurrent the 211 GL_DRAW_BUFFER and GL_READ_BUFFER are set to: GL_NONE if the surface is 212 NULL, GL_BACK if the surface is double buffered, GL_FRONT if the surface 213 is single buffered. Following calls to glReadBuffer and glDrawBuffers 214 change the GL_DRAW_BUFFER and GL_READ_BUFFER attributes and these values 215 persist even when the application change the current context. 216 217 5) Should we add an eglCreateGenericContext which is the same as 218 eglCreateContext but without the config parameter? 219 220 RESOLVED: No. 221 222 6) Can no-config contexts share state with contexts that has a config? 223 224 RESOLVED: Yes. This extension implies that the dependency of the context 225 on the config is quite minimal so no restriction w.r.t sharing should be 226 enforced. 227 228 7) What surface types can be made current with a no-config context? 229 230 RESOLVED: any surface type supported by the implementation can be made 231 current with a no-config context. 232 233Revision History 234 235 Version 9. 2016/09/08 (Jon Leech) - Modify cast of EGL_NO_CONFIG_KHR to 236 (EGLConfig) per bug 15473. 237 238 Version 8. 2016/08/09 (Jon Leech) - Assign extension number, reflow 239 text, and publish. 240 241 Version 7. 2016/05/09 - Recorded vote at working group and sent to 242 Promoters for ratification. 243 244 Version 6. 2016/04/27 - Updated issue #6. Added an EGL_BAD_MATCH case to 245 eglCreateContext. 246 247 Version 5. 2016/04/20 - White space cleanup. Added extension type. 248 Cleaned up issues #1, #2, #4 and #6. 249 250 Version 4. 2016/03/24 - Added a list of contributers. Fixed resolution 251 of issue #3 and #4. 252 253 Version 3. 2016/03/10 - removed restriction to window surfaces only. 254 Removed comment on EGL_RENDERABLE_TYPE. Resolved issues 3 and 4. Added 255 issue 7. 256 257 Version 2, 2016/03/09 - querying EGL_CONFIG_ID on a context created 258 without a config returns zero. Contexts created without a config can 259 share state with contexts which were created with a config. 260 261 Version 1, 2016/01/27 - branch from draft EGL_KHR_no_config specification. 262