102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    KHR_no_config_context
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_KHR_no_config_context
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContributors
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    Etay Meiri
1202f4aeb0Sopenharmony_ci    Alon Or-bach
1302f4aeb0Sopenharmony_ci    Jeff Vigil
1402f4aeb0Sopenharmony_ci    Ray Smith
1502f4aeb0Sopenharmony_ci    Michael Gold
1602f4aeb0Sopenharmony_ci    James Jones
1702f4aeb0Sopenharmony_ci    Daniel Kartch
1802f4aeb0Sopenharmony_ci    Adam Jackson
1902f4aeb0Sopenharmony_ci    Jon Leech
2002f4aeb0Sopenharmony_ci
2102f4aeb0Sopenharmony_ciContact
2202f4aeb0Sopenharmony_ci
2302f4aeb0Sopenharmony_ci    Etay Meiri (etay.meiri 'at' intel.com)
2402f4aeb0Sopenharmony_ci
2502f4aeb0Sopenharmony_ciIP Status
2602f4aeb0Sopenharmony_ci
2702f4aeb0Sopenharmony_ci    No known IP claims.
2802f4aeb0Sopenharmony_ci
2902f4aeb0Sopenharmony_ciStatus
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ci    Approved by the EGL Working Group on April 27, 2016
3202f4aeb0Sopenharmony_ci
3302f4aeb0Sopenharmony_ci    Approved by the Khronos Board of Promoters on July 22, 2016
3402f4aeb0Sopenharmony_ci
3502f4aeb0Sopenharmony_ciVersion
3602f4aeb0Sopenharmony_ci
3702f4aeb0Sopenharmony_ci    Version 9, 2016/09/08
3802f4aeb0Sopenharmony_ci
3902f4aeb0Sopenharmony_ciNumber
4002f4aeb0Sopenharmony_ci
4102f4aeb0Sopenharmony_ci    EGL Extension #101
4202f4aeb0Sopenharmony_ci
4302f4aeb0Sopenharmony_ciExtension Type
4402f4aeb0Sopenharmony_ci
4502f4aeb0Sopenharmony_ci    EGL display extension
4602f4aeb0Sopenharmony_ci
4702f4aeb0Sopenharmony_ciDependencies
4802f4aeb0Sopenharmony_ci
4902f4aeb0Sopenharmony_ci    EGL 1.4 is required. This extension is written against the EGL 1.5
5002f4aeb0Sopenharmony_ci    Specification of August 27, 2014.
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ci    Some of the capabilities of these extensions are only available when
5302f4aeb0Sopenharmony_ci    creating OpenGL or OpenGL ES contexts supporting specific versions or
5402f4aeb0Sopenharmony_ci    capabilities. All such restrictions are documented in the body of this
5502f4aeb0Sopenharmony_ci    extension specification.
5602f4aeb0Sopenharmony_ci
5702f4aeb0Sopenharmony_ciOverview
5802f4aeb0Sopenharmony_ci
5902f4aeb0Sopenharmony_ci    Modern GPUs allow contexts to render to almost any combination of
6002f4aeb0Sopenharmony_ci    supported color and auxiliary buffer formats. Traditionally EGL context
6102f4aeb0Sopenharmony_ci    creation is done with respect to an EGLConfig specifying buffer formats,
6202f4aeb0Sopenharmony_ci    and constrains contexts to only work with surfaces created with a
6302f4aeb0Sopenharmony_ci    "compatible" config.
6402f4aeb0Sopenharmony_ci
6502f4aeb0Sopenharmony_ci    This extension allows creation of GL & ES contexts without specifying an
6602f4aeb0Sopenharmony_ci    EGLConfig.
6702f4aeb0Sopenharmony_ci
6802f4aeb0Sopenharmony_ciNew Procedures and Functions
6902f4aeb0Sopenharmony_ci
7002f4aeb0Sopenharmony_ci    None.
7102f4aeb0Sopenharmony_ci
7202f4aeb0Sopenharmony_ciNew Tokens
7302f4aeb0Sopenharmony_ci
7402f4aeb0Sopenharmony_ci    Accepted as the <config> parameter of eglCreateContext:
7502f4aeb0Sopenharmony_ci
7602f4aeb0Sopenharmony_ci        EGL_NO_CONFIG_KHR                   ((EGLConfig)0)
7702f4aeb0Sopenharmony_ci
7802f4aeb0Sopenharmony_ciAdditions to the EGL 1.5 Specification
7902f4aeb0Sopenharmony_ci
8002f4aeb0Sopenharmony_ci    Modify the 3rd paragraph of section 2.2 "Rendering Contexts and
8102f4aeb0Sopenharmony_ci    Drawing Surfaces":
8202f4aeb0Sopenharmony_ci
8302f4aeb0Sopenharmony_ci   "Surfaces and contexts are both created with respect to an EGLConfig.
8402f4aeb0Sopenharmony_ci    The EGLConfig describes the depth of the color buffer components and
8502f4aeb0Sopenharmony_ci    the types, quantities and sizes of the ancillary buffers (i.e., the
8602f4aeb0Sopenharmony_ci    depth, multisample, and stencil buffers). It is also possible to
8702f4aeb0Sopenharmony_ci    create a context without using an EGLConfig, by specifying relevant
8802f4aeb0Sopenharmony_ci    parameters at creation time (see sections 3.5 and 3.7, respectively)."
8902f4aeb0Sopenharmony_ci
9002f4aeb0Sopenharmony_ci    Modify the sixth paragraph of section 2.2:
9102f4aeb0Sopenharmony_ci
9202f4aeb0Sopenharmony_ci   "A context can be used with any EGLSurface that it is <compatible>
9302f4aeb0Sopenharmony_ci    with (subject to the restrictions discussed in the section on
9402f4aeb0Sopenharmony_ci    address space). A context and surface are compatible if they were
9502f4aeb0Sopenharmony_ci    created with respect to the same EGLDisplay, and if either of the
9602f4aeb0Sopenharmony_ci    following sets of conditions apply:
9702f4aeb0Sopenharmony_ci
9802f4aeb0Sopenharmony_ci    * The context was created without an EGLConfig. Such contexts match
9902f4aeb0Sopenharmony_ci    any valid EGLSurface.
10002f4aeb0Sopenharmony_ci
10102f4aeb0Sopenharmony_ci    or,
10202f4aeb0Sopenharmony_ci
10302f4aeb0Sopenharmony_ci    * The context and surface support the same type of color buffer
10402f4aeb0Sopenharmony_ci      (RGB or luminance).
10502f4aeb0Sopenharmony_ci
10602f4aeb0Sopenharmony_ci    * They have color buffers and ancillary buffers of the same depth.
10702f4aeb0Sopenharmony_ci
10802f4aeb0Sopenharmony_ci      ... replicate remainder of this bullet point ...
10902f4aeb0Sopenharmony_ci
11002f4aeb0Sopenharmony_ci    As long as the compatibility constraint and the address space ..."
11102f4aeb0Sopenharmony_ci
11202f4aeb0Sopenharmony_ci    Insert a new paragraph after paragraph 3 in section 3.7.1 "Creating
11302f4aeb0Sopenharmony_ci    Rendering Contexts" on p. 51:
11402f4aeb0Sopenharmony_ci
11502f4aeb0Sopenharmony_ci   "<config> specifies an EGLConfig defining properties of the context. If
11602f4aeb0Sopenharmony_ci    <config> is EGL_NO_CONFIG_KHR, the resulting context is said to be
11702f4aeb0Sopenharmony_ci    created <without reference to an EGLConfig>. In this case, the context
11802f4aeb0Sopenharmony_ci    must pass the required conformance tests for that client API and must
11902f4aeb0Sopenharmony_ci    support being made current without a rendering surface. Such support is
12002f4aeb0Sopenharmony_ci    guaranteed for OpenGL ES 2.0 implementations supporting the
12102f4aeb0Sopenharmony_ci    GL_OES_surfaceless_context extension, OpenGL ES 3.0 and later versions
12202f4aeb0Sopenharmony_ci    of OpenGL ES, and OpenGL 3.0 and later versions of OpenGL. Support for
12302f4aeb0Sopenharmony_ci    other versions and other client APIs is implementation dependent."
12402f4aeb0Sopenharmony_ci
12502f4aeb0Sopenharmony_ci    Replace the EGL_BAD_CONFIG error for eglCreateContext on p. 56, and add
12602f4aeb0Sopenharmony_ci    a new errors:
12702f4aeb0Sopenharmony_ci
12802f4aeb0Sopenharmony_ci   "* An EGL_BAD_CONFIG error is generated if <config> is neither
12902f4aeb0Sopenharmony_ci      EGL_NO_CONFIG_KHR nor a valid <config>.
13002f4aeb0Sopenharmony_ci
13102f4aeb0Sopenharmony_ci    * An EGL_BAD_MATCH error is generated if <config> is EGL_NO_CONFIG_KHR,
13202f4aeb0Sopenharmony_ci      and the requested client API type and version do not support being
13302f4aeb0Sopenharmony_ci      made current without a rendering surface.
13402f4aeb0Sopenharmony_ci
13502f4aeb0Sopenharmony_ci    * An EGL_BAD_MATCH error is generated if <config> is EGL_NO_CONFIG_KHR,
13602f4aeb0Sopenharmony_ci      and the implementation does not support the requested client API and
13702f4aeb0Sopenharmony_ci      version."
13802f4aeb0Sopenharmony_ci
13902f4aeb0Sopenharmony_ci    Modify the first error for eglMakeCurrent in the list on p. 58:
14002f4aeb0Sopenharmony_ci
14102f4aeb0Sopenharmony_ci   "* An EGL_BAD_MATCH error is generated if <draw> or <read> are not
14202f4aeb0Sopenharmony_ci    compatible with <ctx>, as described in section 2.2."
14302f4aeb0Sopenharmony_ci
14402f4aeb0Sopenharmony_ci    Modify the description of eglQueryContext in section 3.7.4 on p. 63:
14502f4aeb0Sopenharmony_ci
14602f4aeb0Sopenharmony_ci   "Querying EGL_CONFIG_ID returns the ID of the EGLConfig with respect
14702f4aeb0Sopenharmony_ci    to which the context was created, or zero if created without
14802f4aeb0Sopenharmony_ci    respect to an EGLConfig."
14902f4aeb0Sopenharmony_ci
15002f4aeb0Sopenharmony_ciErrors
15102f4aeb0Sopenharmony_ci
15202f4aeb0Sopenharmony_ci    As described in the body of the extension above.
15302f4aeb0Sopenharmony_ci
15402f4aeb0Sopenharmony_ciConformance Tests
15502f4aeb0Sopenharmony_ci
15602f4aeb0Sopenharmony_ci    None
15702f4aeb0Sopenharmony_ci
15802f4aeb0Sopenharmony_ciSample Code
15902f4aeb0Sopenharmony_ci
16002f4aeb0Sopenharmony_ci    None
16102f4aeb0Sopenharmony_ci
16202f4aeb0Sopenharmony_ciDependencies On EGL 1.4
16302f4aeb0Sopenharmony_ci
16402f4aeb0Sopenharmony_ci    If implemented on EGL 1.4, interactions with EGL 1.5-specific features
16502f4aeb0Sopenharmony_ci    are removed.
16602f4aeb0Sopenharmony_ci
16702f4aeb0Sopenharmony_ciIssues
16802f4aeb0Sopenharmony_ci
16902f4aeb0Sopenharmony_ci 1) Should non-conformant no-config contexts be allowed to be created?
17002f4aeb0Sopenharmony_ci
17102f4aeb0Sopenharmony_ci    RESOLVED: No. We are not encouraging non-conformant contexts.
17202f4aeb0Sopenharmony_ci
17302f4aeb0Sopenharmony_ci 2) Are no-config contexts constrained to those GL & ES implementations
17402f4aeb0Sopenharmony_ci    which can support them?
17502f4aeb0Sopenharmony_ci
17602f4aeb0Sopenharmony_ci    RESOLVED: Yes. ES2 + OES_surfaceless_context, ES 3.0, and GL 3.0 all
17702f4aeb0Sopenharmony_ci    support binding a surface without a context. This implies that they
17802f4aeb0Sopenharmony_ci    don't need to know surface attributes at context creation time.
17902f4aeb0Sopenharmony_ci
18002f4aeb0Sopenharmony_ci 3) For an OpenGL or OpenGL ES context created with no config, what is the
18102f4aeb0Sopenharmony_ci    initial state of GL_DRAW_BUFFER and GL_READ_BUFFER for the default
18202f4aeb0Sopenharmony_ci    framebuffer?
18302f4aeb0Sopenharmony_ci
18402f4aeb0Sopenharmony_ci    RESOLVED: This is an implementation detail rather than a spec issue.
18502f4aeb0Sopenharmony_ci    glReadBuffer/glDrawBuffer have undefined results if called without a
18602f4aeb0Sopenharmony_ci    current context. The GL_DRAW_BUFFER and GL_READ_BUFFER are set on the
18702f4aeb0Sopenharmony_ci    first eglMakeCurrent call and can be updated in glReadBuffer and
18802f4aeb0Sopenharmony_ci    glDrawBuffers calls after that. Therefore, the attribute value with
18902f4aeb0Sopenharmony_ci    which the context is created is irrelevant from the point of view of the
19002f4aeb0Sopenharmony_ci    spec and is left up to the implementation.
19102f4aeb0Sopenharmony_ci
19202f4aeb0Sopenharmony_ci 4) Can eglMakeCurrent alter the GL_DRAW_BUFFER and GL_READ_BUFFER state of
19302f4aeb0Sopenharmony_ci    the default framebuffer?
19402f4aeb0Sopenharmony_ci
19502f4aeb0Sopenharmony_ci    RESOLVED: Yes, but only on the first call to eglMakeCurrent. The two
19602f4aeb0Sopenharmony_ci    relevant excerpts from the OpenGL 3.2 Core Profile Specification.
19702f4aeb0Sopenharmony_ci    From Section 4.2.1 Selecting a Buffer for Writing:
19802f4aeb0Sopenharmony_ci
19902f4aeb0Sopenharmony_ci        For the default framebuffer, in the initial state the draw buffer
20002f4aeb0Sopenharmony_ci        for fragment color zero is BACK if there is a back buffer; FRONT if
20102f4aeb0Sopenharmony_ci        there is no back buffer; and NONE if no default framebuffer is
20202f4aeb0Sopenharmony_ci        associated with the context.
20302f4aeb0Sopenharmony_ci
20402f4aeb0Sopenharmony_ci    From 4.3.3 Pixel Draw/Read State:
20502f4aeb0Sopenharmony_ci
20602f4aeb0Sopenharmony_ci        For the default framebuffer, in the initial state the read buffer is
20702f4aeb0Sopenharmony_ci        BACK if there is a back buffer; FRONT if there is no back buffer;
20802f4aeb0Sopenharmony_ci        and NONE if no default framebuffer is associated with the context.
20902f4aeb0Sopenharmony_ci
21002f4aeb0Sopenharmony_ci    Based on the above excerpts on the first call to eglMakeCurrent the
21102f4aeb0Sopenharmony_ci    GL_DRAW_BUFFER and GL_READ_BUFFER are set to: GL_NONE if the surface is
21202f4aeb0Sopenharmony_ci    NULL, GL_BACK if the surface is double buffered, GL_FRONT if the surface
21302f4aeb0Sopenharmony_ci    is single buffered. Following calls to glReadBuffer and glDrawBuffers
21402f4aeb0Sopenharmony_ci    change the GL_DRAW_BUFFER and GL_READ_BUFFER attributes and these values
21502f4aeb0Sopenharmony_ci    persist even when the application change the current context.
21602f4aeb0Sopenharmony_ci
21702f4aeb0Sopenharmony_ci 5) Should we add an eglCreateGenericContext which is the same as
21802f4aeb0Sopenharmony_ci    eglCreateContext but without the config parameter?
21902f4aeb0Sopenharmony_ci
22002f4aeb0Sopenharmony_ci    RESOLVED: No.
22102f4aeb0Sopenharmony_ci
22202f4aeb0Sopenharmony_ci 6) Can no-config contexts share state with contexts that has a config?
22302f4aeb0Sopenharmony_ci
22402f4aeb0Sopenharmony_ci    RESOLVED: Yes. This extension implies that the dependency of the context
22502f4aeb0Sopenharmony_ci    on the config is quite minimal so no restriction w.r.t sharing should be
22602f4aeb0Sopenharmony_ci    enforced.
22702f4aeb0Sopenharmony_ci
22802f4aeb0Sopenharmony_ci 7) What surface types can be made current with a no-config context?
22902f4aeb0Sopenharmony_ci
23002f4aeb0Sopenharmony_ci    RESOLVED: any surface type supported by the implementation can be made
23102f4aeb0Sopenharmony_ci    current with a no-config context.
23202f4aeb0Sopenharmony_ci
23302f4aeb0Sopenharmony_ciRevision History
23402f4aeb0Sopenharmony_ci
23502f4aeb0Sopenharmony_ci    Version 9. 2016/09/08 (Jon Leech) - Modify cast of EGL_NO_CONFIG_KHR to
23602f4aeb0Sopenharmony_ci    (EGLConfig) per bug 15473.
23702f4aeb0Sopenharmony_ci
23802f4aeb0Sopenharmony_ci    Version 8. 2016/08/09 (Jon Leech) - Assign extension number, reflow
23902f4aeb0Sopenharmony_ci    text, and publish.
24002f4aeb0Sopenharmony_ci
24102f4aeb0Sopenharmony_ci    Version 7. 2016/05/09 - Recorded vote at working group and sent to
24202f4aeb0Sopenharmony_ci    Promoters for ratification.
24302f4aeb0Sopenharmony_ci
24402f4aeb0Sopenharmony_ci    Version 6. 2016/04/27 - Updated issue #6. Added an EGL_BAD_MATCH case to
24502f4aeb0Sopenharmony_ci    eglCreateContext.
24602f4aeb0Sopenharmony_ci
24702f4aeb0Sopenharmony_ci    Version 5. 2016/04/20 - White space cleanup. Added extension type.
24802f4aeb0Sopenharmony_ci    Cleaned up issues #1, #2, #4 and #6.
24902f4aeb0Sopenharmony_ci
25002f4aeb0Sopenharmony_ci    Version 4. 2016/03/24 - Added a list of contributers. Fixed resolution
25102f4aeb0Sopenharmony_ci    of issue #3 and #4.
25202f4aeb0Sopenharmony_ci
25302f4aeb0Sopenharmony_ci    Version 3. 2016/03/10 - removed restriction to window surfaces only.
25402f4aeb0Sopenharmony_ci    Removed comment on EGL_RENDERABLE_TYPE. Resolved issues 3 and 4. Added
25502f4aeb0Sopenharmony_ci    issue 7.
25602f4aeb0Sopenharmony_ci
25702f4aeb0Sopenharmony_ci    Version 2, 2016/03/09 - querying EGL_CONFIG_ID on a context created
25802f4aeb0Sopenharmony_ci    without a config returns zero. Contexts created without a config can
25902f4aeb0Sopenharmony_ci    share state with contexts which were created with a config.
26002f4aeb0Sopenharmony_ci
26102f4aeb0Sopenharmony_ci    Version 1, 2016/01/27 - branch from draft EGL_KHR_no_config specification.
262