1Name 2 3 KHR_surfaceless_context 4 5Name Strings 6 7 EGL_KHR_surfaceless_context 8 9Contributors 10 11 Acorn Pooley 12 Jon Leech 13 Kristian Hoegsberg 14 Steven Holte 15 16Contact 17 18 Acorn Pooley: apooley at nvidia dot com 19 20Notice 21 22 Copyright (c) 2010-2013 The Khronos Group Inc. Copyright terms at 23 http://www.khronos.org/registry/speccopyright.html 24 25Status 26 27 Complete. 28 Approved by the EGL Working Group on June 6, 2012. 29 Approved by the Khronos Board of Promoters on July 27, 2012. 30 31Version 32 33 Version 4, 2012/05/03 34 35Number 36 37 EGL Extension #40 38 39Dependencies 40 41 EGL 1.0 is required. 42 43 The functionality of this extension is not supported by client OpenGL ES 44 contexts unless the GL_OES_surfaceless_context extension is supported by 45 those contexts. 46 47 Written against wording of EGL 1.4 specification. 48 49Overview 50 51 These extensions allows an application to make a context current by 52 passing EGL_NO_SURFACE for the write and read surface in the 53 call to eglMakeCurrent. The motivation is that applications that only 54 want to render to client API targets (such as OpenGL framebuffer 55 objects) should not need to create a throw-away EGL surface just to get 56 a current context. 57 58 The state of an OpenGL ES context with no default framebuffer provided 59 by EGL is the same as a context with an incomplete framebuffer object 60 bound. 61 62New Procedures and Functions 63 64 None 65 66New Tokens 67 68 None 69 70Additions to the EGL Specification section "3.7.3 Binding Contexts and 71Drawables" 72 73 Replace the following two error conditions in the 74 list of eglMakeCurrent errors: 75 76 " * If <ctx> is not a valid context, an EGL_BAD_CONTEXT error is 77 generated. 78 * If either <draw> or <read> are not valid EGL surfaces, an 79 EGL_BAD_SURFACE error is generated." 80 81 with the following error conditions: 82 83 " * If <ctx> is not a valid context and is not EGL_NO_CONTEXT, an 84 EGL_BAD_CONTEXT error is generated. 85 * If either <draw> or <read> are not valid EGL surfaces and are 86 not EGL_NO_SURFACE, an EGL_BAD_SURFACE error is generated. 87 * If <ctx> is EGL_NO_CONTEXT and either <draw> or <read> are not 88 EGL_NO_SURFACE, an EGL_BAD_MATCH error is generated. 89 * If either of <draw> or <read> is a valid surface and the other 90 is EGL_NO_SURFACE, an EGL_BAD_MATCH error is generated. 91 * If <ctx> does not support being bound without read and draw 92 surfaces, and both <draw> and <read> are EGL_NO_SURFACE, an 93 EGL_BAD_MATCH error is generated." 94 95 Replace the paragraph starting "If <ctx> is EGL_NO_CONTEXT and 96 <draw> and <read> are not EGL_NO_SURFACE..." with 97 98 "If both <draw> and <read> are EGL_NO_SURFACE, and <ctx> is a context 99 which supports being bound without read and draw surfaces, then no error 100 is generated and the context is made current without a 101 <default framebuffer>. The meaning of this is defined by the API of the 102 supporting context. (See chapter 4 of the OpenGL 3.0 Specification, and 103 the GL_OES_surfaceless_context OpenGL ES extension.)" 104 105 Append to the paragraph starting "The first time an OpenGL or OpenGL 106 ES context is made current..." with 107 108 "If the first time <ctx> is made current, it is without a default 109 framebuffer (e.g. both <draw> and <read> are EGL_NO_SURFACE), then 110 the viewport and scissor regions are set as though 111 glViewport(0,0,0,0) and glScissor(0,0,0,0) were called." 112 113Interactions with other extensions 114 115 The semantics of having a current context with no surface for OpenGL ES 116 1.x and OpenGL ES 2.x are specified by the GL_OES_surfaceless_context 117 extension. 118 119Issues 120 121 1) Do we need a mechanism to indicate which contexts may be bound with 122 <read> and <draw> set to NULL? Or is it ok to require that if this 123 extension is supported then any context of the particular API may be 124 made current with no surfaces? 125 126 RESOLVED. Because multiple API implementations may be available as 127 contexts we cannot guarantee that all OpenGL ES 1.x or OpenGL ES 2.x 128 contexts will support GL_OES_surfaceless_context. If the user attempts 129 to call eglMakeCurrent with EGL_NO_SURFACE on a context which does not 130 support it, this simply results in EGL_BAD_MATCH. 131 132 2) Do we need to include all of the relevant "default framebuffer" language 133 from the OpenGL specification to properly specify OpenGL ES behavior 134 with no default framebuffer bound? 135 136 RESOLVED. Yes, the behaviour of the GLES contexts when no default 137 framebuffer is associated with the context has been moved to the OpenGL 138 ES extension OES_surfaceless_context. 139 140 3) Since these EGL extensions also modify OpenGL ES behavior and introduce 141 a new error condition, do we want corresponding OpenGL ES extension 142 strings as well? 143 144 RESOLVED. Yes, see GL_OES_surfaceless_context extension. 145 146 4) How does this document interact with EGL_KHR_create_context and OpenGL 147 contexts? 148 149 RESOLVED. Some language defining the error conditions of eglMakeCurrent 150 have been imported from the draft specification of EGL_KHR_create_context 151 and the definitions of the behaviour of the GLES contexts without a 152 default framebuffer have been moved to GL_OES_surfaceless_context. Any 153 further interactions are left to the create_context extension to define 154 when it is completed. 155 156Revision History 157 158 Version 5, 2014/01/07 (Jon Leech) - Correct references to 159 EXT_surfaceless_context with GL_OES_surfaceless_context. 160 161 Version 4, 2012/02/27 (Steven Holte) - Add language for error conditions 162 from EGL_KHR_create_context, and resolutions of issues. Combined API 163 specific extensions into a single extension. 164 165 Version 3, 2010/08/19 (Kristian Hoegsberg) - Move default framebuffer 166 language to new GLES extension (GL_OES_surfaceless_context) and make 167 this extension depend on that. 168 169 Version 2, 2010/08/03 (Jon Leech) - add default framebuffer language to 170 the OpenGL ES Specifications, including changes to initial GL state and 171 the FRAMEBUFFER_UNDEFINED incompleteness status when no default 172 framebuffer is bound. 173 174 Version 1, 2010/07/09 (Acorn Pooley) - Initial draft. 175