15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    KHR_robustness
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_KHR_robustness
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Daniel Koch, NVIDIA
125bd8deadSopenharmony_ci    Nicolas Capens, TransGaming
135bd8deadSopenharmony_ci    Contributors to ARB_robustness
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciContact
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    Jon Leech (oddhack 'at' sonic.net) 
185bd8deadSopenharmony_ci    Greg Roth, NVIDIA (groth 'at' nvidia.com)
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciNotice
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci    Copyright (c) 2012-2014 The Khronos Group Inc. Copyright terms at
235bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciSpecification Update Policy
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
285bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL and OpenGL ES Working Groups. For
295bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
305bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
315bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
325bd8deadSopenharmony_ci    described in more detail at
335bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciStatus
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Complete. 
385bd8deadSopenharmony_ci    Approved by the OpenGL ES Working Group on June 25, 2014.
395bd8deadSopenharmony_ci    Approved by the ARB on June 26, 2014.
405bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on August 7, 2014.
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciVersion
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Version 11, August 21, 2014
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciNumber
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    ARB Extension #170
495bd8deadSopenharmony_ci    OpenGL ES Extension #190
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciDependencies
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    OpenGL ES 2.0 or OpenGL 3.2 are required. Some features of this
545bd8deadSopenharmony_ci    extension are supported by OpenGL ES only if OpenGL ES 3.0 or later is
555bd8deadSopenharmony_ci    supported.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    EGL_EXT_create_context_robustness is used to determine if a context
585bd8deadSopenharmony_ci    implementing this extension supports robust buffer access, and if it
595bd8deadSopenharmony_ci    supports reset notification.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.1 Specification
625bd8deadSopenharmony_ci    (version of June 4, 2014) and the OpenGL ES 3.10.3 Shading Language
635bd8deadSopenharmony_ci    Specification (version of June 6, 2014).
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ciOverview
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    Several recent trends in how OpenGL ES integrates into modern computer
685bd8deadSopenharmony_ci    systems have created new requirements for robustness and security for GL
695bd8deadSopenharmony_ci    rendering contexts.
705bd8deadSopenharmony_ci    
715bd8deadSopenharmony_ci    Additionally GPU architectures now support hardware fault detection;
725bd8deadSopenharmony_ci    for example, video memory supporting ECC (error correcting codes)
735bd8deadSopenharmony_ci    and error detection.  GL contexts should be capable of recovering
745bd8deadSopenharmony_ci    from hardware faults such as uncorrectable memory errors.  Along with
755bd8deadSopenharmony_ci    recovery from such hardware faults, the recovery mechanism can
765bd8deadSopenharmony_ci    also allow recovery from video memory access exceptions and system
775bd8deadSopenharmony_ci    software failures.  System software failures can be due to device
785bd8deadSopenharmony_ci    changes or driver failures.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    GL queries that return (write) some number of bytes to a
815bd8deadSopenharmony_ci    buffer indicated by a pointer parameter introduce risk of buffer
825bd8deadSopenharmony_ci    overflows that might be exploitable by malware. To address this,
835bd8deadSopenharmony_ci    queries with return value sizes that are not expressed directly by
845bd8deadSopenharmony_ci    the parameters to the query itself are given additional API
855bd8deadSopenharmony_ci    functions with an additional parameter that specifies the number of
865bd8deadSopenharmony_ci    bytes in the buffer and never writing bytes beyond that limit. This
875bd8deadSopenharmony_ci    is particularly useful for multi-threaded usage of GL contexts
885bd8deadSopenharmony_ci    in a "share group" where one context can change objects in ways that
895bd8deadSopenharmony_ci    can cause buffer overflows for another context's GL queries.
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    The original ARB_vertex_buffer_object extension includes an issue
925bd8deadSopenharmony_ci    that explicitly states program termination is allowed when
935bd8deadSopenharmony_ci    out-of-bounds vertex buffer object fetches occur. Modern graphics
945bd8deadSopenharmony_ci    hardware is capable of well-defined behavior in the case of out-of-
955bd8deadSopenharmony_ci    bounds vertex buffer object fetches. Older hardware may require
965bd8deadSopenharmony_ci    extra checks to enforce well-defined (and termination free)
975bd8deadSopenharmony_ci    behavior, but this expense is warranted when processing potentially
985bd8deadSopenharmony_ci    untrusted content.
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    The intent of this extension is to address some specific robustness
1015bd8deadSopenharmony_ci    goals:
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    *   For all existing GL queries, provide additional "safe" APIs 
1045bd8deadSopenharmony_ci        that limit data written to user pointers to a buffer size in 
1055bd8deadSopenharmony_ci        bytes that is an explicit additional parameter of the query.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    *   Provide a mechanism for a GL application to learn about
1085bd8deadSopenharmony_ci        graphics resets that affect the context.  When a graphics reset
1095bd8deadSopenharmony_ci        occurs, the GL context becomes unusable and the application
1105bd8deadSopenharmony_ci        must create a new context to continue operation. Detecting a
1115bd8deadSopenharmony_ci        graphics reset happens through an inexpensive query.
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    *   Define behavior of OpenGL calls made after a graphics reset.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    *   Provide an enable to guarantee that out-of-bounds buffer object
1165bd8deadSopenharmony_ci        accesses by the GPU will have deterministic behavior and preclude
1175bd8deadSopenharmony_ci        application instability or termination due to an incorrect buffer
1185bd8deadSopenharmony_ci        access.  Such accesses include vertex buffer fetches of
1195bd8deadSopenharmony_ci        attributes and indices, and indexed reads of uniforms or
1205bd8deadSopenharmony_ci        parameters from buffers.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ciNew Procedures and Functions
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    NOTE: when implemented in an OpenGL ES context, all entry points defined
1255bd8deadSopenharmony_ci    by this extension must have a "KHR" suffix. When implemented in an
1265bd8deadSopenharmony_ci    OpenGL context, all entry points must have NO suffix, as shown below.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    enum GetGraphicsResetStatus();
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    void ReadnPixels(int x, int y, sizei width, sizei height,
1315bd8deadSopenharmony_ci                        enum format, enum type, sizei bufSize,
1325bd8deadSopenharmony_ci                        void *data);
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    void GetnUniformfv(uint program, int location, sizei bufSize,
1355bd8deadSopenharmony_ci                          float *params);
1365bd8deadSopenharmony_ci    void GetnUniformiv(uint program, int location, sizei bufSize,
1375bd8deadSopenharmony_ci                          int *params);
1385bd8deadSopenharmony_ci    void GetnUniformuiv(uint program, int location, sizei bufSize,
1395bd8deadSopenharmony_ci                           uint *params);
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ciNew Tokens
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    NOTE: when implemented in an OpenGL ES context, all tokens defined by
1455bd8deadSopenharmony_ci    this extension must have a "_KHR" suffix. When implemented in an OpenGL
1465bd8deadSopenharmony_ci    context, all tokens must have NO suffix, as described below.
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    Returned by GetGraphicsResetStatus:
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci        NO_ERROR                                        0x0000
1515bd8deadSopenharmony_ci        GUILTY_CONTEXT_RESET                            0x8253
1525bd8deadSopenharmony_ci        INNOCENT_CONTEXT_RESET                          0x8254
1535bd8deadSopenharmony_ci        UNKNOWN_CONTEXT_RESET                           0x8255
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
1565bd8deadSopenharmony_ci    and GetFloatv:
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci        CONTEXT_ROBUST_ACCESS                           0x90F3
1595bd8deadSopenharmony_ci        RESET_NOTIFICATION_STRATEGY                     0x8256
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    Returned by GetIntegerv and related simple queries when <value> is
1625bd8deadSopenharmony_ci    RESET_NOTIFICATION_STRATEGY :
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci        LOSE_CONTEXT_ON_RESET                           0x8252
1655bd8deadSopenharmony_ci        NO_RESET_NOTIFICATION                           0x8261
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci    Returned by GetError:
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci        CONTEXT_LOST                                    0x0507
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ciAdditions to the OpenGL ES 3.1 Specification
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    Add to section 2.3.1 "Errors" in the bullet list of implicit errors for
1755bd8deadSopenharmony_ci    GL commands on p. 14, and modify the following paragraph:
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci     * If the GL context has been reset as a result of a previous GL
1785bd8deadSopenharmony_ci       command, or if the context is reset as a side effect of execution of
1795bd8deadSopenharmony_ci       a command, a CONTEXT_LOST error is generated.
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    The Specification attempts to explicitly describe these implicit error
1825bd8deadSopenharmony_ci    conditions (with the exception of OUT_OF_MEMORY [fn2] and CONTEXT_LOST
1835bd8deadSopenharmony_ci    [fn3]) wherever they apply. However ...
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    [fn3] CONTEXT_LOST is not described because it occurs for reasons not
1865bd8deadSopenharmony_ci    directly related to the affected commands, and applies to almost all GL
1875bd8deadSopenharmony_ci    commands.
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    Add to table 2.3 "Summary of GL errors" on p. 15:
1915bd8deadSopenharmony_ci    
1925bd8deadSopenharmony_ci    Error          Description               Offending command ignored?
1935bd8deadSopenharmony_ci    ------------   -----------------------   --------------------------
1945bd8deadSopenharmony_ci    CONTEXT_LOST   Context has been lost     Except as noted for
1955bd8deadSopenharmony_ci                   and reset by the driver   specific commands
1965bd8deadSopenharmony_ci    
1975bd8deadSopenharmony_ci    
1985bd8deadSopenharmony_ci    Add a new subsection 2.3.1rob after 2.3.1 "GL Errors", and renumber
1995bd8deadSopenharmony_ci    subsequent sections accordingly:
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    2.3.1rob "Graphics Reset Recovery"
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    Certain events can result in a reset of the GL context. After such an
2045bd8deadSopenharmony_ci    event, it is referred to as a <lost context> and is unusable for almost
2055bd8deadSopenharmony_ci    all purposes. Recovery requires creating a new context and recreating
2065bd8deadSopenharmony_ci    all relevant state from the lost context. The current status of the
2075bd8deadSopenharmony_ci    graphics reset state is returned by
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci        enum GetGraphicsResetStatus();
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    The value returned indicates if the GL context has been in a reset state
2125bd8deadSopenharmony_ci    at any point since the last call to GetGraphicsResetStatus:
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci      * NO_ERROR indicates that the GL context has not been in a reset state
2155bd8deadSopenharmony_ci        since the last call.
2165bd8deadSopenharmony_ci      * GUILTY_CONTEXT_RESET indicates that a reset has been detected
2175bd8deadSopenharmony_ci        that is attributable to the current GL context.
2185bd8deadSopenharmony_ci      * INNOCENT_CONTEXT_RESET indicates a reset has been detected that
2195bd8deadSopenharmony_ci        is not attributable to the current GL context.
2205bd8deadSopenharmony_ci      * UNKNOWN_CONTEXT_RESET indicates a detected graphics reset whose
2215bd8deadSopenharmony_ci        cause is unknown.
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    If a reset status other than NO_ERROR is returned and subsequent calls
2245bd8deadSopenharmony_ci    return NO_ERROR, the context reset was encountered and completed. If a
2255bd8deadSopenharmony_ci    reset status is repeatedly returned, the context may be in the process
2265bd8deadSopenharmony_ci    of resetting.
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    Reset notification behavior is determined at context creation time, and
2295bd8deadSopenharmony_ci    may be queried by calling GetIntegerv with the symbolic constant
2305bd8deadSopenharmony_ci    RESET_NOTIFICATION_STRATEGY.
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    If the reset notification behavior is NO_RESET_NOTIFICATION, then
2335bd8deadSopenharmony_ci    the implementation will never deliver notification of reset events, and
2345bd8deadSopenharmony_ci    GetGraphicsResetStatus will always return NO_ERROR[fn1].
2355bd8deadSopenharmony_ci       [fn1: In this case it is recommended that implementations should not
2365bd8deadSopenharmony_ci        allow loss of context state no matter what events occur. However,
2375bd8deadSopenharmony_ci        this is only a recommendation, and cannot be relied upon by
2385bd8deadSopenharmony_ci        applications.]
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci    If the behavior is LOSE_CONTEXT_ON_RESET, a graphics reset will
2415bd8deadSopenharmony_ci    result in a lost context and require creating a new context as described
2425bd8deadSopenharmony_ci    above. In this case GetGraphicsResetStatus will return an appropriate
2435bd8deadSopenharmony_ci    value from those described above.
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    If a graphics reset notification occurs in a context, a notification
2465bd8deadSopenharmony_ci    must also occur in all other contexts which share objects with that
2475bd8deadSopenharmony_ci    context[fn2].
2485bd8deadSopenharmony_ci       [fn2: The values returned by GetGraphicsResetStatus in the
2495bd8deadSopenharmony_ci        different contexts may differ.]
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci    After a graphics reset has occurred on a context, subsequent GL commands
2525bd8deadSopenharmony_ci    on that context (or any context which shares with that context) will
2535bd8deadSopenharmony_ci    generate a CONTEXT_LOST error. Such commands will not have side effects
2545bd8deadSopenharmony_ci    (in particular, they will not modify memory passed by pointer for query
2555bd8deadSopenharmony_ci    results), and may not block indefinitely or cause termination of the
2565bd8deadSopenharmony_ci    application. Exceptions to this behavior include:
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci      * GetError and GetGraphicsResetStatus behave normally following a
2595bd8deadSopenharmony_ci        graphics reset, so that the application can determine a reset has
2605bd8deadSopenharmony_ci        occurred, and when it is safe to destroy and recreate the context.
2615bd8deadSopenharmony_ci      * Any commands which might cause a polling application to block
2625bd8deadSopenharmony_ci        indefinitely will generate a CONTEXT_LOST error, but will also
2635bd8deadSopenharmony_ci        return a value indicating completion to the application. Such
2645bd8deadSopenharmony_ci        commands include:
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci        + GetSynciv with <pname> SYNC_STATUS ignores the other parameters
2675bd8deadSopenharmony_ci          and returns SIGNALED in <values>.
2685bd8deadSopenharmony_ci        + GetQueryObjectuiv with <pname> QUERY_RESULT_AVAILABLE ignores the
2695bd8deadSopenharmony_ci          other parameters and returns TRUE in <params>.
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    Modify section 7.12 "Shader, Program, and Program Pipeline Queries"
2735bd8deadSopenharmony_ci    on p. 125 to add the GetnUniform* commands:
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    The commands
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci            [enumerate existing GetUniform*v commands, then add]
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci        void GetnUniformfv(uint program, int location, sizei bufSize,
2805bd8deadSopenharmony_ci                              float *params);
2815bd8deadSopenharmony_ci        void GetnUniformiv(uint program, int location, sizei bufSize,
2825bd8deadSopenharmony_ci                              int *params);
2835bd8deadSopenharmony_ci        void GetnUniformuiv(uint program, int location, sizei bufSize,
2845bd8deadSopenharmony_ci                               uint *params);
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    return the value or values of the uniform at location <location> of the
2875bd8deadSopenharmony_ci    default uniform block for program object <program> in the array
2885bd8deadSopenharmony_ci    <params>. The type of the uniform at <location> determines the number of
2895bd8deadSopenharmony_ci    values returned. Calling GetnUniform*v ensures that no more than
2905bd8deadSopenharmony_ci    <bufSize> bytes are written into <params>.
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci    Add to the Errors section for Get*Uniform* on p. 126:
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by GetnUniform* if the buffer
2955bd8deadSopenharmony_ci    size required to store the requested data is greater than <bufSize>
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    Add subsection 10.3.1.1rob prior to section 10.3.2 "Vertex Attribute
2995bd8deadSopenharmony_ci    Divisors" on p. 241:
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    10.3.1.1rob Robust Buffer Access Behavior
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    Robust buffer access is enabled by creating a context with robust access
3045bd8deadSopenharmony_ci    enabled through the window system binding APIs. When enabled, indices
3055bd8deadSopenharmony_ci    within the element array that reference vertex data that lies outside
3065bd8deadSopenharmony_ci    the enabled attribute's vertex buffer object 
3075bd8deadSopenharmony_ci        [for OpenGL ES] result in undefined values
3085bd8deadSopenharmony_ci        [for OpenGL] result in reading zero
3095bd8deadSopenharmony_ci    for the corresponding attributes, but cannot result in application
3105bd8deadSopenharmony_ci    failure. 
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci    Robust buffer access behavior may be queried by calling
3135bd8deadSopenharmony_ci    GetIntegerv with the symbolic constant CONTEXT_ROBUST_ACCESS.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ci    Modify section 16.1.2 "ReadPixels" on p. 332 to add the ReadnPixels
3175bd8deadSopenharmony_ci    command:
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    Pixels are read using
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci        void ReadPixels(int x, int y, sizei width, sizei height,
3225bd8deadSopenharmony_ci                        enum format, enum type, void *data);
3235bd8deadSopenharmony_ci        void ReadnPixels(int x, int y, sizei width, sizei height,
3245bd8deadSopenharmony_ci                            enum format, enum type, sizei bufSize,
3255bd8deadSopenharmony_ci                            void *data);
3265bd8deadSopenharmony_ci
3275bd8deadSopenharmony_ci    The arguments after <x> and <y> to ReadPixels ... are summarized in
3285bd8deadSopenharmony_ci    table 16.1. ReadnPixels behaves identically to ReadPixels except that
3295bd8deadSopenharmony_ci    it does not write more than <bufSize> bytes into <data>.
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci    Add to the Errors section for ReadPixels and ReadnPixels:
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ReadnPixels if the buffer
3355bd8deadSopenharmony_ci    size required to store the requested data is greater than <bufSize>.
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ciAdditions to The OpenGL ES Shading Language Specification, Version 3.10
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    Modify the first paragraph of section 4.1.9 "Arrays" on p. 30:
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    Variables of the same type ... Undefined behavior results from indexing
3435bd8deadSopenharmony_ci    an array with a non-constant expression that is greater than or equal to
3445bd8deadSopenharmony_ci    the array size or less than 0. If robust buffer access is enabled (see
3455bd8deadSopenharmony_ci    section 10.3.1.1rob of the OpenGL ES 3.1 API Specification), such
3465bd8deadSopenharmony_ci    indexing must not result in abnormal program termination. The results
3475bd8deadSopenharmony_ci    are still undefined, but implementations are encouraged to produce zero
3485bd8deadSopenharmony_ci    values for such accesses. Arrays only have a single dimension ...
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ciDependencies on OpenGL ES
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    For implementations against OpenGL ES, if OpenGL ES 3.0 or a later
3535bd8deadSopenharmony_ci    version is not supported, remove all references to GetnUniformuiv and
3545bd8deadSopenharmony_ci    remove the exceptional behavior of GetSynciv and GetQueryObjectuiv for
3555bd8deadSopenharmony_ci    lost contexts.
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ciInteractions with EGL_EXT_create_context_robustness
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    If the EGL window-system binding API is used to create a context, the
3605bd8deadSopenharmony_ci    EGL_EXT_create_context_robustness extension is supported, and the
3615bd8deadSopenharmony_ci    attribute EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT is set to EGL_TRUE when
3625bd8deadSopenharmony_ci    eglCreateContext is called, the resulting context will perform robust
3635bd8deadSopenharmony_ci    buffer access as described above in section 10.3.1.1rob, and the
3645bd8deadSopenharmony_ci    CONTEXT_ROBUST_ACCESS query will return GL_TRUE.
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci    If the EGL window-system binding API is used to create a context and the
3675bd8deadSopenharmony_ci    EGL_EXT_create_context_robustness extension is supported, then the value
3685bd8deadSopenharmony_ci    of attribute EGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_EXT determines the
3695bd8deadSopenharmony_ci    reset notification behavior and the value of
3705bd8deadSopenharmony_ci    RESET_NOTIFICATION_STRATEGY, as described in section 2.3.1rob.
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ciNew Implementation Dependent State
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci    Get Value                   Type  Get Command Minimum Value     Description                 Sec.        Attribute
3755bd8deadSopenharmony_ci    --------------------------- ----  ----------- ----------------- --------------------------- ----------- ---------
3765bd8deadSopenharmony_ci    CONTEXT_ROBUST_ACCESS       B     GetIntegerv -                 Robust access enabled       10.3.1.1rob -
3775bd8deadSopenharmony_ci    RESET_NOTIFICATION_STRATEGY Z_2   GetIntegerv See sec. 2.3.1rob Reset notification behavior 2.3.1rob    -
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ciIssues
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci    (Issues 2-8 are identical to those in the base EXT_robustness
3825bd8deadSopenharmony_ci    extension).
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    1. What should this extension be called?
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci       RESOLVED: KHR_robustness
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci       This is just the OpenGL ES EXT_robustness extension (itself based on
3895bd8deadSopenharmony_ci       ARB_robustness) promoted to KHR status, with consistency with OpenGL
3905bd8deadSopenharmony_ci       4.5 behavior and phrasing included.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci    2. How does this extension differ from Desktop GL's ARB_robustness?
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci       RESOLVED: Because EGL_EXT_create_context_robustness uses a separate
3955bd8deadSopenharmony_ci       attribute to enable robust buffer access, a corresponding query is
3965bd8deadSopenharmony_ci       added here.
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci       Also see issue 12.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci    3. Should we provide a context creation mechanism to enable this
4015bd8deadSopenharmony_ci       extension?
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci       RESOLVED. Yes.
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci       Currently, EGL_EXT_create_context_robustness provides this mechanism
4065bd8deadSopenharmony_ci       via two unique attributes. These attributes differ from those
4075bd8deadSopenharmony_ci       specified by KHR_create_context to allow for differences in what
4085bd8deadSopenharmony_ci       functionality those attributes define.
4095bd8deadSopenharmony_ci        
4105bd8deadSopenharmony_ci    4. What can cause a graphics reset?
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci       Either user or implementor errors may result in a graphics reset. If
4135bd8deadSopenharmony_ci       the application attempts to perform a rendering that takes too long
4145bd8deadSopenharmony_ci       whether due to an infinite loop in a shader or even just a rendering
4155bd8deadSopenharmony_ci       operation that takes too long on the given hardware. Implementation
4165bd8deadSopenharmony_ci       errors may produce badly formed hardware commands. Memory access
4175bd8deadSopenharmony_ci       errors may result from user or implementor mistakes. On some systems,
4185bd8deadSopenharmony_ci       power management events such as system sleep, screen saver
4195bd8deadSopenharmony_ci       activation, or pre-emption may also context resets to occur. Any of
4205bd8deadSopenharmony_ci       these events may result in a graphics reset event that will be
4215bd8deadSopenharmony_ci       detectable by the mechanism described in this extension.
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ci    5. How should the application react to a reset context event?
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci       RESOLVED: For this extension, the application is expected to query
4265bd8deadSopenharmony_ci       the reset status until NO_ERROR is returned. If a reset is
4275bd8deadSopenharmony_ci       encountered, at least one *RESET* status will be returned. Once
4285bd8deadSopenharmony_ci       NO_ERROR is again encountered, the application can safely destroy the
4295bd8deadSopenharmony_ci       old context and create a new one.
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci       After a reset event, apps should not use a context for any purpose
4325bd8deadSopenharmony_ci       other than determining its reset status (using either GetError to
4335bd8deadSopenharmony_ci       identify a CONTEXT_LOST error, or GetGraphicsResetStatus()), and
4345bd8deadSopenharmony_ci       then destroying it. If a context receives a reset event, all other
4355bd8deadSopenharmony_ci       contexts in its share group will also receive reset events, and
4365bd8deadSopenharmony_ci       should be destroyed and recreated.
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci       Apps should be cautious in interpreting the GUILTY and INNOCENT reset
4395bd8deadSopenharmony_ci       statuses. These are guidelines to the immediate cause of a reset, but
4405bd8deadSopenharmony_ci       not guarantees of the ultimate cause.
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    6. If a graphics reset occurs in a shared context, what happens in
4435bd8deadSopenharmony_ci       shared contexts?
4445bd8deadSopenharmony_ci
4455bd8deadSopenharmony_ci       RESOLVED: A reset in one context will result in a reset in all other
4465bd8deadSopenharmony_ci       contexts in its share group.
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    7. How can an application query for robust buffer access support, since
4495bd8deadSopenharmony_ci       this is now determined at context creation time?
4505bd8deadSopenharmony_ci
4515bd8deadSopenharmony_ci       RESOLVED. The application can query the value of
4525bd8deadSopenharmony_ci       CONTEXT_ROBUST_ACCESS using GetIntegerv. If true, this
4535bd8deadSopenharmony_ci       functionality is enabled.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci    8. How is the reset notification behavior controlled?
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci       RESOLVED: Reset notification behavior is determined at context
4585bd8deadSopenharmony_ci       creation time using EGL/GLX/WGL/etc. mechanisms. In order that shared
4595bd8deadSopenharmony_ci       objects be handled predictably, a context cannot share with another
4605bd8deadSopenharmony_ci       context unless both have the same reset notification behavior.
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci    9. How does this extension differ from EXT_robustness?
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ci       RESOLVED: By adding the new CONTEXT_LOST error, removing support for
4655bd8deadSopenharmony_ci       ES 1.1 (for logistical reasons), and changing suffixes from EXT to
4665bd8deadSopenharmony_ci       KHR (for ES) or no suffix (for GL).
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci   10. How should this extension be enabled via EGL?
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ci       PROPOSED: Either by using EGL 1.5 context creation APIs (see section
4715bd8deadSopenharmony_ci       3.7.1.5 of the EGL 1.5 spec), or EGL_EXT_create_context_robustness.
4725bd8deadSopenharmony_ci       This interaction will be noted in both the EGL 1.5 spec and the
4735bd8deadSopenharmony_ci       extension spec by allowing at least one, and possibly both of
4745bd8deadSopenharmony_ci       GL_EXT_robustness and GL_KHR_robustness to be supported by contexts
4755bd8deadSopenharmony_ci       created via these mechanisms. If a context supporting
4765bd8deadSopenharmony_ci       GL_KHR_robustness is created, it will optionally support
4775bd8deadSopenharmony_ci       GL_KHR_robust_buffer_access_behavior as well (see issue 5 of that
4785bd8deadSopenharmony_ci       extension).
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci   11. What should the behavior of GL calls made after a context is lost be?
4815bd8deadSopenharmony_ci       This can be expected to occur when the context has been lost, but the
4825bd8deadSopenharmony_ci       app hasn't polled the reset status yet.
4835bd8deadSopenharmony_ci
4845bd8deadSopenharmony_ci       RESOLVED: Set a new CONTEXT_LOST error on all GL calls (except
4855bd8deadSopenharmony_ci       GetError and GetGraphicsReset).
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ci       DISCUSSION: GetError and GetGraphicsResetStatus must continue to
4885bd8deadSopenharmony_ci       work at least to the extent of their interactions with robustness
4895bd8deadSopenharmony_ci       features, so that apps can determine a context was lost and see the
4905bd8deadSopenharmony_ci       effect on other commands. Commands which might block indefinitely or
4915bd8deadSopenharmony_ci       cause the app to block indefinitely while polling are defined to
4925bd8deadSopenharmony_ci       return immediately, with values which should end a polling loop. Such
4935bd8deadSopenharmony_ci       commands include sync and query object queries for completion.
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci       Special handling of these commands is defined to return values which
4965bd8deadSopenharmony_ci       should not cause blocking, but also to generate the CONTEXT_LOST
4975bd8deadSopenharmony_ci       error. This is intended to deal well both with apps that are polling
4985bd8deadSopenharmony_ci       on a query value, and apps that may test for the error immediately
4995bd8deadSopenharmony_ci       after each command (such as debuggers). There has been no pushback
5005bd8deadSopenharmony_ci       against
5015bd8deadSopenharmony_ci
5025bd8deadSopenharmony_ci       We believe there are no other commands requiring this special
5035bd8deadSopenharmony_ci       handling in the core API. ClientWaitSync and WaitSync were also
5045bd8deadSopenharmony_ci       proposed, but with the current language (which specifies that
5055bd8deadSopenharmony_ci       commands on a lost context may not block) should not need exceptional
5065bd8deadSopenharmony_ci       handling.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci       REJECTED OPTIONS:
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci       A) GL will try to handle the call as best as possible. Depending on
5115bd8deadSopenharmony_ci       the call this may use GPU resources which may now have undefined
5125bd8deadSopenharmony_ci       contents.
5135bd8deadSopenharmony_ci
5145bd8deadSopenharmony_ci       B) GL calls become no-ops. This would be like having a null-dispatch
5155bd8deadSopenharmony_ci       table installed when you don't have a current context. The problem
5165bd8deadSopenharmony_ci       with this approach is that any call that has return parameters won't
5175bd8deadSopenharmony_ci       fill them in and the application won't be able to detect that a value
5185bd8deadSopenharmony_ci       was not returned.
5195bd8deadSopenharmony_ci
5205bd8deadSopenharmony_ci       REJECTED SUB-FEATURES:
5215bd8deadSopenharmony_ci
5225bd8deadSopenharmony_ci       We discussed using OUT_OF_MEMORY or INVALID_OPERATION. Both are
5235bd8deadSopenharmony_ci       misleading and don't uniquely identify the problem as a runtime error
5245bd8deadSopenharmony_ci       out of scope of anything the app did.
5255bd8deadSopenharmony_ci
5265bd8deadSopenharmony_ci       We discussed allowing all commands to have side effects in addition
5275bd8deadSopenharmony_ci       to generating CONTEXT_LOST, such as putting a "safe" value into
5285bd8deadSopenharmony_ci       return parameters. Without compelling reason to allow this behavior,
5295bd8deadSopenharmony_ci       it is cleaner to define the spec to leave results unchanged aside
5305bd8deadSopenharmony_ci       from the exceptional cases intended to prevent hanging on polling
5315bd8deadSopenharmony_ci       loops.
5325bd8deadSopenharmony_ci
5335bd8deadSopenharmony_ci   12. What changed in promoting OES_robustness to KHR_robustness? What
5345bd8deadSopenharmony_ci       remains to be done for consistency between GL and ES?
5355bd8deadSopenharmony_ci
5365bd8deadSopenharmony_ci       DISCUSSION: The ARB agreed to support robustness and
5375bd8deadSopenharmony_ci       robust_buffer_access_behavior as a KHR extension, with the following
5385bd8deadSopenharmony_ci       chnages and issues to be resolved during the ratification period
5395bd8deadSopenharmony_ci       (none are IP-related):
5405bd8deadSopenharmony_ci
5415bd8deadSopenharmony_ci       a) As was done for KHR_debug, the extension is defined to have KHR
5425bd8deadSopenharmony_ci          suffixes only in ES implementations. GL implementations do not
5435bd8deadSopenharmony_ci          have suffixes. This is so KHR_robustness can be used as a
5445bd8deadSopenharmony_ci          backwards-compatibility extension for OpenGL 4.5.
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci       b) Minor spec language tweaks were done for consistency with OpenGL
5475bd8deadSopenharmony_ci          4.5, to eliminate redundancy. None are functional with the
5485bd8deadSopenharmony_ci          exception of a change in section 10.3.1.1rob, which imposes
5495bd8deadSopenharmony_ci          stronger requirements on out-of-bounds indexed attribute access
5505bd8deadSopenharmony_ci          for GL (returns zero) relative to ES (undefined return values).
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci       c) The ARB wants to add these commands to the extension, as defined
5535bd8deadSopenharmony_ci          in OpenGL 4.5. They would be only be supported in GL contexts:
5545bd8deadSopenharmony_ci
5555bd8deadSopenharmony_ci            GetnUniformdv
5565bd8deadSopenharmony_ci            GetnTexImage
5575bd8deadSopenharmony_ci            GetnCompressedTexImage
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci          We do not think we need to add the compatibility-mode Getn*
5605bd8deadSopenharmony_ci          queries defined by ARB_robustness.
5615bd8deadSopenharmony_ci
5625bd8deadSopenharmony_ci       d) OpenGL 4.5 exposes support for robustness by setting
5635bd8deadSopenharmony_ci          CONTEXT_FLAG_ROBUST_ACCESS_BIT in the CONTEXT_FLAGS query. ES (and
5645bd8deadSopenharmony_ci          this extension) expose it with the CONTEXT_ROBUST_ACCESS query.
5655bd8deadSopenharmony_ci          Jon proposes we resolve this by only defining the CONTEXT_FLAGS
5665bd8deadSopenharmony_ci          query for GL, but defining the CONTEXT_ROBUST_ACCESS query for
5675bd8deadSopenharmony_ci          both GL and ES, and aliasing the flag bit with the access boolean.
5685bd8deadSopenharmony_ci          This will result in minor changes to both GL 4.5 and this
5695bd8deadSopenharmony_ci          extension.
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci       e) This extension modifies the Shading Language specification in
5725bd8deadSopenharmony_ci          section 4.1.9 to restrict behavior of out of bounds array
5735bd8deadSopenharmony_ci          accesses. GLSL 4.50 has a considerably broader section 5.11
5745bd8deadSopenharmony_ci          "Out-of-Bounds Accesses" which restricts behavior of arrays,
5755bd8deadSopenharmony_ci          vectors, structs, etc. We will want to include that language in
5765bd8deadSopenharmony_ci          KHR_robustness at least as GLSL-specific language; if ES wants to
5775bd8deadSopenharmony_ci          adopt the broader language for GLSL-ES that might still be doable.
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ciRevision History
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci    Rev.    Date       Author     Changes
5825bd8deadSopenharmony_ci    ----  ------------ ---------  ------------------------------------------
5835bd8deadSopenharmony_ci     11   2014/08/21   Jon Leech  Fix typo.
5845bd8deadSopenharmony_ci     10   2014/06/26   Jon Leech  Change from OES to KHR. Update issues 1
5855bd8deadSopenharmony_ci                                  and 9; add issue 12 on ES / GL
5865bd8deadSopenharmony_ci                                  differences.
5875bd8deadSopenharmony_ci      9   2014/06/26   Jon Leech  Minor phrasing fixes to be more consistent
5885bd8deadSopenharmony_ci                                  with equivalent GL functionality.
5895bd8deadSopenharmony_ci      8   2014/06/24   Jon Leech  Fix typos & mention GetError in issue 5.
5905bd8deadSopenharmony_ci                                  Reorder API spec edits in section order.
5915bd8deadSopenharmony_ci                                  Resolve issues 9-11 (Bug 12104 comments
5925bd8deadSopenharmony_ci                                  #42-45). Assign CONTEXT_LOST enum.
5935bd8deadSopenharmony_ci      7   2014/06/02   Jon Leech  Remove "safe" return value behavior for
5945bd8deadSopenharmony_ci                                  queries when contexts are lost (Bug 12104
5955bd8deadSopenharmony_ci                                  comment #27).
5965bd8deadSopenharmony_ci      6   2014/06/02   Jon Leech  Rebase extension on OpenGL ES 3.1 specs
5975bd8deadSopenharmony_ci                                  and reflow paragraphs (no functionality
5985bd8deadSopenharmony_ci                                  changes are made in this version).
5995bd8deadSopenharmony_ci      5   2014/05/16   Jon Leech  Add CONTEXT_LOST error and exceptional
6005bd8deadSopenharmony_ci                                  behavior for potentially-blocking
6015bd8deadSopenharmony_ci                                  commands (Bug 8411).
6025bd8deadSopenharmony_ci      4   2014/05/14   Jon Leech  Add issue 11 on behavior of GL calls made
6035bd8deadSopenharmony_ci                                  after a context is lost.
6045bd8deadSopenharmony_ci      3   2014/05/07   Jon Leech  Add GetnUniformuivOES for ES 3.0.
6055bd8deadSopenharmony_ci      2   2014/04/26   Jon Leech  Updates based on Ken's comments in bug
6065bd8deadSopenharmony_ci                                  12104 and to reference EGL 1.5.
6075bd8deadSopenharmony_ci      1   2014/04/23   Jon Leech  Branch from EXT_robustness version 3 and
6085bd8deadSopenharmony_ci                                  promote to OES suffixes. Add issues 9-10.
609