Neil Roberts | 551d459 | 2014-03-07 18:05:47 +0000 | [diff] [blame] | 1 | Name |
| 2 | |
| 3 | MESA_configless_context |
| 4 | |
| 5 | Name Strings |
| 6 | |
| 7 | EGL_MESA_configless_context |
| 8 | |
| 9 | Contact |
| 10 | |
| 11 | Neil Roberts <neil.s.roberts@intel.com> |
| 12 | |
| 13 | Status |
| 14 | |
| 15 | Proposal |
| 16 | |
| 17 | Version |
| 18 | |
| 19 | Version 1, February 28, 2014 |
| 20 | |
| 21 | Number |
| 22 | |
| 23 | EGL Extension #not assigned |
| 24 | |
| 25 | Dependencies |
| 26 | |
| 27 | Requires EGL 1.4 or later. This extension is written against the |
| 28 | wording of the EGL 1.4 specification. |
| 29 | |
| 30 | Overview |
| 31 | |
| 32 | This extension provides a means to use a single context to render to |
| 33 | multiple surfaces which have different EGLConfigs. Without this extension |
| 34 | the EGLConfig for every surface used by the context must be compatible |
| 35 | with the one used by the context. The only way to render to surfaces with |
| 36 | different formats would be to create multiple contexts but this is |
| 37 | inefficient with modern GPUs where this restriction is unnecessary. |
| 38 | |
| 39 | IP Status |
| 40 | |
| 41 | Open-source; freely implementable. |
| 42 | |
| 43 | New Procedures and Functions |
| 44 | |
| 45 | None. |
| 46 | |
| 47 | New Tokens |
| 48 | |
| 49 | Accepted as <config> in eglCreateContext |
| 50 | |
| 51 | EGL_NO_CONFIG_MESA ((EGLConfig)0) |
| 52 | |
| 53 | Additions to the EGL Specification section "2.2 Rendering Contexts and Drawing |
| 54 | Surfaces" |
| 55 | |
| 56 | Add the following to the 3rd paragraph: |
| 57 | |
| 58 | "EGLContexts can also optionally be created with respect to an EGLConfig |
| 59 | depending on the parameters used at creation time. If a config is provided |
| 60 | then additional restrictions apply on what surfaces can be used with the |
| 61 | context." |
| 62 | |
| 63 | Replace the last sentence of the 6th paragraph with: |
| 64 | |
| 65 | "In order for a context to be compatible with a surface they both must have |
| 66 | been created with respect to the same EGLDisplay. If the context was |
| 67 | created without respect to an EGLConfig then there are no further |
| 68 | constraints. Otherwise they are only compatible if:" |
| 69 | |
| 70 | Remove the last bullet point in the list of constraints. |
| 71 | |
| 72 | Additions to the EGL Specification section "3.7.1 Creating Rendering Contexts" |
| 73 | |
| 74 | Replace the paragraph starting "If config is not a valid EGLConfig..." |
| 75 | with |
| 76 | |
| 77 | "The config argument can either be a valid EGLConfig or EGL_NO_CONFIG_MESA. |
| 78 | If it is neither of these then an EGL_BAD_CONFIG error is generated. If a |
| 79 | valid config is passed then the error will also be generated if the config |
| 80 | does not support the requested client API (this includes requesting |
| 81 | creation of an OpenGL ES 1.x context when the EGL_RENDERABLE_TYPE |
| 82 | attribute of config does not contain EGL_OPENGL_ES_BIT, or creation of an |
| 83 | OpenGL ES 2.x context when the attribute does not contain |
| 84 | EGL_OPENGL_ES2_BIT). |
| 85 | |
| 86 | Passing EGL_NO_CONFIG_MESA will create a configless context. When a |
| 87 | configless context is used with the OpenGL API it can be assumed that the |
| 88 | initial values of the context's state will be decided when the context is |
| 89 | first made current. In particular this means that the decision of whether |
| 90 | to use GL_BACK or GL_FRONT for the initial value of the first output in |
| 91 | glDrawBuffers will be decided based on the config of the draw surface when |
| 92 | it is first bound." |
| 93 | |
| 94 | Additions to the EGL Specification section "3.7.3 Binding Contexts and |
| 95 | Drawables" |
| 96 | |
| 97 | Replace the first bullet point with the following: |
| 98 | |
| 99 | "* If draw or read are not compatible with ctx as described in section 2.2, |
| 100 | then an EGL_BAD_MATCH error is generated." |
| 101 | |
| 102 | Add a second bullet point after that: |
| 103 | |
| 104 | "* If draw and read are not compatible with each other as described in |
| 105 | section 2.2, then an EGL_BAD_MATCH error is generated." |
| 106 | |
| 107 | Issues |
| 108 | |
| 109 | 1. What happens when an OpenGL context with a double-buffered surface and |
| 110 | draw buffer set to GL_BACK is made current with a single-buffered |
| 111 | surface? |
| 112 | |
| 113 | NOT RESOLVED: There are a few options here. An implementation can |
| 114 | raise an error, change the drawbuffer state to GL_FRONT or just do |
| 115 | nothing, expecting the application to set GL_FRONT drawbuffer before |
| 116 | drawing. However, this extension deliberately does not specify any |
| 117 | required behavior in this corner case and applications should avoid |
| 118 | mixing single- and double-buffered surfaces with configless contexts. |
| 119 | |
| 120 | Future extensions may specify required behavior in this case. |
| 121 | |
| 122 | Revision History |
| 123 | |
| 124 | Version 1, February 28, 2014 |
| 125 | Initial draft (Neil Roberts) |