1848b8605SmrgName 2848b8605Smrg 3848b8605Smrg MESA_configless_context 4848b8605Smrg 5848b8605SmrgName Strings 6848b8605Smrg 7848b8605Smrg EGL_MESA_configless_context 8848b8605Smrg 9848b8605SmrgContact 10848b8605Smrg 11848b8605Smrg Neil Roberts <neil.s.roberts@intel.com> 12848b8605Smrg 13848b8605SmrgStatus 14848b8605Smrg 15b8e80941Smrg Superseded by the functionally identical EGL_KHR_no_config_context 16b8e80941Smrg extension. 17848b8605Smrg 18848b8605SmrgVersion 19848b8605Smrg 20b8e80941Smrg Version 2, September 9, 2016 21848b8605Smrg 22848b8605SmrgNumber 23848b8605Smrg 24848b8605Smrg EGL Extension #not assigned 25848b8605Smrg 26848b8605SmrgDependencies 27848b8605Smrg 28848b8605Smrg Requires EGL 1.4 or later. This extension is written against the 29848b8605Smrg wording of the EGL 1.4 specification. 30848b8605Smrg 31848b8605SmrgOverview 32848b8605Smrg 33848b8605Smrg This extension provides a means to use a single context to render to 34848b8605Smrg multiple surfaces which have different EGLConfigs. Without this extension 35848b8605Smrg the EGLConfig for every surface used by the context must be compatible 36848b8605Smrg with the one used by the context. The only way to render to surfaces with 37848b8605Smrg different formats would be to create multiple contexts but this is 38848b8605Smrg inefficient with modern GPUs where this restriction is unnecessary. 39848b8605Smrg 40848b8605SmrgIP Status 41848b8605Smrg 42848b8605Smrg Open-source; freely implementable. 43848b8605Smrg 44848b8605SmrgNew Procedures and Functions 45848b8605Smrg 46848b8605Smrg None. 47848b8605Smrg 48848b8605SmrgNew Tokens 49848b8605Smrg 50848b8605Smrg Accepted as <config> in eglCreateContext 51848b8605Smrg 52848b8605Smrg EGL_NO_CONFIG_MESA ((EGLConfig)0) 53848b8605Smrg 54848b8605SmrgAdditions to the EGL Specification section "2.2 Rendering Contexts and Drawing 55848b8605SmrgSurfaces" 56848b8605Smrg 57848b8605Smrg Add the following to the 3rd paragraph: 58848b8605Smrg 59848b8605Smrg "EGLContexts can also optionally be created with respect to an EGLConfig 60848b8605Smrg depending on the parameters used at creation time. If a config is provided 61848b8605Smrg then additional restrictions apply on what surfaces can be used with the 62848b8605Smrg context." 63848b8605Smrg 64848b8605Smrg Replace the last sentence of the 6th paragraph with: 65848b8605Smrg 66848b8605Smrg "In order for a context to be compatible with a surface they both must have 67848b8605Smrg been created with respect to the same EGLDisplay. If the context was 68848b8605Smrg created without respect to an EGLConfig then there are no further 69848b8605Smrg constraints. Otherwise they are only compatible if:" 70848b8605Smrg 71848b8605Smrg Remove the last bullet point in the list of constraints. 72848b8605Smrg 73848b8605SmrgAdditions to the EGL Specification section "3.7.1 Creating Rendering Contexts" 74848b8605Smrg 75848b8605Smrg Replace the paragraph starting "If config is not a valid EGLConfig..." 76848b8605Smrg with 77848b8605Smrg 78848b8605Smrg "The config argument can either be a valid EGLConfig or EGL_NO_CONFIG_MESA. 79848b8605Smrg If it is neither of these then an EGL_BAD_CONFIG error is generated. If a 80848b8605Smrg valid config is passed then the error will also be generated if the config 81848b8605Smrg does not support the requested client API (this includes requesting 82848b8605Smrg creation of an OpenGL ES 1.x context when the EGL_RENDERABLE_TYPE 83848b8605Smrg attribute of config does not contain EGL_OPENGL_ES_BIT, or creation of an 84848b8605Smrg OpenGL ES 2.x context when the attribute does not contain 85848b8605Smrg EGL_OPENGL_ES2_BIT). 86848b8605Smrg 87848b8605Smrg Passing EGL_NO_CONFIG_MESA will create a configless context. When a 88848b8605Smrg configless context is used with the OpenGL API it can be assumed that the 89848b8605Smrg initial values of the context's state will be decided when the context is 90848b8605Smrg first made current. In particular this means that the decision of whether 91848b8605Smrg to use GL_BACK or GL_FRONT for the initial value of the first output in 92848b8605Smrg glDrawBuffers will be decided based on the config of the draw surface when 93848b8605Smrg it is first bound." 94848b8605Smrg 95848b8605SmrgAdditions to the EGL Specification section "3.7.3 Binding Contexts and 96848b8605SmrgDrawables" 97848b8605Smrg 98848b8605Smrg Replace the first bullet point with the following: 99848b8605Smrg 100848b8605Smrg "* If draw or read are not compatible with ctx as described in section 2.2, 101848b8605Smrg then an EGL_BAD_MATCH error is generated." 102848b8605Smrg 103848b8605Smrg Add a second bullet point after that: 104848b8605Smrg 105848b8605Smrg "* If draw and read are not compatible with each other as described in 106848b8605Smrg section 2.2, then an EGL_BAD_MATCH error is generated." 107848b8605Smrg 108848b8605SmrgIssues 109848b8605Smrg 110848b8605Smrg 1. What happens when an OpenGL context with a double-buffered surface and 111848b8605Smrg draw buffer set to GL_BACK is made current with a single-buffered 112848b8605Smrg surface? 113848b8605Smrg 114848b8605Smrg NOT RESOLVED: There are a few options here. An implementation can 115848b8605Smrg raise an error, change the drawbuffer state to GL_FRONT or just do 116848b8605Smrg nothing, expecting the application to set GL_FRONT drawbuffer before 117848b8605Smrg drawing. However, this extension deliberately does not specify any 118848b8605Smrg required behavior in this corner case and applications should avoid 119848b8605Smrg mixing single- and double-buffered surfaces with configless contexts. 120848b8605Smrg 121848b8605Smrg Future extensions may specify required behavior in this case. 122848b8605Smrg 123848b8605SmrgRevision History 124848b8605Smrg 125b8e80941Smrg Version 2, September 9, 2016 126b8e80941Smrg Defer to EGL_KHR_no_config_context (Adam Jackson) 127b8e80941Smrg 128848b8605Smrg Version 1, February 28, 2014 129848b8605Smrg Initial draft (Neil Roberts) 130