15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_EGL_image_storage
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_EGL_image_storage
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Krzysztof Kosinski (krzysio 'at' google.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Krzysztof Kosinski, Google
165bd8deadSopenharmony_ci    Craig Donner, Google
175bd8deadSopenharmony_ci    Jesse Hall, Google
185bd8deadSopenharmony_ci    Jan-Harald Fredriksen, ARM
195bd8deadSopenharmony_ci    Daniel Koch, Nvidia
205bd8deadSopenharmony_ci    Gurchetan Singh, Google
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Complete
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    August 22, 2019 (version 8)
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciNumber
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    #522
335bd8deadSopenharmony_ci    OpenGL ES Extension #301
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciDependencies
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Requires OpenGL 4.2, OpenGL ES 3.0, or ARB_texture_storage.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    Requires EGL 1.4 and either the EGL_KHR_image or EGL_KHR_image_base
405bd8deadSopenharmony_ci    extensions.
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    The EGL_KHR_gl_texture_2D_image, EGL_KHR_gl_texture_cubemap_image,
435bd8deadSopenharmony_ci    EGL_KHR_gl_texture_3D_image, EGL_KHR_gl_renderbuffer_image,
445bd8deadSopenharmony_ci    EGL_KHR_vg_parent_image, EGL_ANDROID_get_native_client_buffer,
455bd8deadSopenharmony_ci    EGL_EXT_image_dma_buf_import and EGL_EXT_image_gl_colorspace extensions
465bd8deadSopenharmony_ci    provide additional functionality layered on EGL_KHR_image_base and
475bd8deadSopenharmony_ci    related to this extension.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    EXT_direct_state_access, ARB_direct_state_access, and OpenGL 4.5 affect
505bd8deadSopenharmony_ci    the definition of this extension.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    This extension interacts with GL_OES_EGL_image, GL_OES_EGL_image_external,
535bd8deadSopenharmony_ci    GL_OES_EGL_image_external_essl3, and GL_EXT_EGL_image_array.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    This extension is written based on the wording of the OpenGL ES 3.2
565bd8deadSopenharmony_ci    Specification.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciOverview
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    The OpenGL ES extension OES_EGL_image provides a mechanism for creating
615bd8deadSopenharmony_ci    GL textures sharing storage with EGLImage objects (in other words, creating
625bd8deadSopenharmony_ci    GL texture EGLImage targets).  The extension was written against the
635bd8deadSopenharmony_ci    OpenGL ES 2.0 specification, which does not have the concept of immutable
645bd8deadSopenharmony_ci    textures.  As a result, it specifies that respecification of a texture by
655bd8deadSopenharmony_ci    calling TexImage* on a texture that is an EGLImage target causes it to be
665bd8deadSopenharmony_ci    implicitly orphaned.  In most cases, this is not the desired behavior, but
675bd8deadSopenharmony_ci    rather a result of an application error.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    This extension provides a mechanism for creating texture objects that are
705bd8deadSopenharmony_ci    both EGLImage targets and immutable.  Since immutable textures cannot be
715bd8deadSopenharmony_ci    respecified, they also cannot accidentally be orphaned, and attempts to do
725bd8deadSopenharmony_ci    so generate errors instead of resulting in well-defined, but often
735bd8deadSopenharmony_ci    undesirable and surprising behavior.  It provides a strong guarantee that
745bd8deadSopenharmony_ci    texture data that is intended to be shared will remain shared.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    EGL extension specifications are located in the EGL Registry at
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci        http://www.khronos.org/registry/egl/
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ciGlossary
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    Please see the EGL_KHR_image specification for a list of terms
835bd8deadSopenharmony_ci    used by this specification.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ciNew Types
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    /*
885bd8deadSopenharmony_ci     * GLeglImageOES is an opaque handle to an EGLImage
895bd8deadSopenharmony_ci     * Note: GLeglImageOES is also defined in GL_OES_EGL_image
905bd8deadSopenharmony_ci     */
915bd8deadSopenharmony_ci    typedef void* GLeglImageOES;
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ciNew Procedures and Functions
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    void EGLImageTargetTexStorageEXT(enum target, eglImageOES image,
965bd8deadSopenharmony_ci                                     const int* attrib_list)
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    <If EXT_direct_state_access or an equivalent mechanism is supported:>
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    void EGLImageTargetTextureStorageEXT(uint texture, eglImageOES image,
1015bd8deadSopenharmony_ci                                         const int* attrib_list)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ciNew Tokens
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci     None.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL ES 3.2 Specification (Textures and
1085bd8deadSopenharmony_ciSamplers)
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    - (8.18, p. 210)  Insert the following text before the paragraph starting
1115bd8deadSopenharmony_ci    with "After a successful call to any TexStorage* command":
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    The command
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci        void EGLImageTargetTexStorageEXT(enum target, eglImageOES image,
1165bd8deadSopenharmony_ci                                         const int* attrib_list);
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    specifies all levels and properties of a texture (including dimensionality,
1195bd8deadSopenharmony_ci    width, height, format, mipmap levels of detail, and image data) by taking
1205bd8deadSopenharmony_ci    them from the specified eglImageOES <image>.  Images specified this way
1215bd8deadSopenharmony_ci    will be EGLImage siblings with the original EGLImage source and any other
1225bd8deadSopenharmony_ci    EGLImage targets.
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    <target> must be one of GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D,
1255bd8deadSopenharmony_ci    GL_TEXTURE_CUBE_MAP, GL_TEXTURE_CUBE_MAP_ARRAY.  On OpenGL implementations
1265bd8deadSopenharmony_ci    (non-ES), <target> can also be GL_TEXTURE_1D or GL_TEXTURE_1D_ARRAY.
1275bd8deadSopenharmony_ci    If the implementation supports OES_EGL_image_external, <target> can be
1285bd8deadSopenharmony_ci    GL_TEXTURE_EXTERNAL_OES.  <target> must match the type of image data stored
1295bd8deadSopenharmony_ci    in <image>.  For instance, if the <image> was created from a GL texture,
1305bd8deadSopenharmony_ci    <target> must match the texture target of the source texture. <image> must
1315bd8deadSopenharmony_ci    be the handle of a valid EGLImage resource, cast into the type eglImageOES.
1325bd8deadSopenharmony_ci    Assuming no errors are generated in EGLImageTargetTexStorageEXT, the newly
1335bd8deadSopenharmony_ci    specified texture object will be an EGLImage target of the specified
1345bd8deadSopenharmony_ci    eglImageOES. <attrib_list> must be NULL or a pointer to the value GL_NONE.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    If <image> is NULL, the error INVALID_VALUE is generated.  If <image> is
1375bd8deadSopenharmony_ci    neither NULL nor a valid value, the behavior is undefined, up to and
1385bd8deadSopenharmony_ci    including program termination.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    If the GL is unable to specify a texture object using the supplied
1415bd8deadSopenharmony_ci    eglImageOES <image> (if, for example, <image> refers to a multisampled
1425bd8deadSopenharmony_ci    eglImageOES, or <target> is GL_TEXTURE_2D but <image> contains a cube map),
1435bd8deadSopenharmony_ci    the error INVALID_OPERATION is generated.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    If the EGL image was created using EGL_EXT_image_dma_buf_import, then the
1465bd8deadSopenharmony_ci    following applies:
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci        - <target> must be GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES. Otherwise,
1495bd8deadSopenharmony_ci          the error INVALID_OPERATION is generated.
1505bd8deadSopenharmony_ci        - if <target> is GL_TEXTURE_2D, then the resultant texture must have a
1515bd8deadSopenharmony_ci          sized internal format which is colorspace and size compatible with the
1525bd8deadSopenharmony_ci          dma-buf. If the GL is unable to determine such a format, the error
1535bd8deadSopenharmony_ci          INVALID_OPERATION is generated.
1545bd8deadSopenharmony_ci        - if <target> is GL_TEXTURE_EXTERNAL_OES, the internal format of the
1555bd8deadSopenharmony_ci          texture is implementation defined.
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    If <attrib_list> is neither NULL nor a pointer to the value GL_NONE, the
1585bd8deadSopenharmony_ci    error INVALID_VALUE is generated.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    <If EXT_direct_state_access or an equivalent mechanism is supported:>
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    The command
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci        void EGLImageTargetTextureStorageEXT(uint texture, eglImageOES image,
1655bd8deadSopenharmony_ci                                             const int* attrib_list);
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci    is equivalent to EGLImageTargetTexStorageEXT, but the target texture object
1685bd8deadSopenharmony_ci    is directly specified using the <texture> parameter instead of being taken
1695bd8deadSopenharmony_ci    from the active texture unit.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    - (8.18, p. 210)  Replace "After a successful call to any TexStorage*
1725bd8deadSopenharmony_ci    command" with "After a successful call to any TexStorage* or
1735bd8deadSopenharmony_ci    EGLImageTarget*StorageEXT command"
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci    - (8.18, p. 210)  Add the following to the list following the sentence
1765bd8deadSopenharmony_ci    "Using any of the following commands with the same texture will result in
1775bd8deadSopenharmony_ci    an INVALID_OPERATION error being generated, even if it does not affect the
1785bd8deadSopenharmony_ci    dimensions or format:"
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    EGLImageTarget*StorageEXT
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ciIssues
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    1.  Should this extension provide support for renderbuffers?
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci        RESOLVED:  This seems of limited use, and renderbuffer support specified
1875bd8deadSopenharmony_ci        by OES_EGL_image already uses the immutable storage model, so that would
1885bd8deadSopenharmony_ci        be redundant.
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    2.  Should OES_EGL_image be a prerequisite?
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci        RESOLVED:  Supporting both OES_EGL_image and this extension requires
1935bd8deadSopenharmony_ci        more complexity than supporting only this extension and we did not want
1945bd8deadSopenharmony_ci        to rule out such implementations.  Therefore, this extension does not
1955bd8deadSopenharmony_ci        require OES_EGL_image.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    3.  Should multisampled texture targets be supported?
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci        RESOLVED:  We are not aware of any EGLImage implementations that support
2005bd8deadSopenharmony_ci        multisampling, so this is omitted.
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    4.  What is the interaction with GenerateMipmap?
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci        RESOLVED:  Since immutable textures do not allow respecification,
2055bd8deadSopenharmony_ci        calling GenerateMipmap on a texture created with
2065bd8deadSopenharmony_ci        EGLImageTarget*StorageEXT never causes orphaning.
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    5.  What is the purpose of the attrib_list parameter?
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci        RESOLVED:  It allows layered extensions to pass additional data.  It is
2115bd8deadSopenharmony_ci        intended to be used similarly to the attrib_list parameter on the
2125bd8deadSopenharmony_ci        EGL functions eglCreateContext and eglCreateImageKHR.  Since the new
2135bd8deadSopenharmony_ci        entry points define immutable textures, setting additional values
2145bd8deadSopenharmony_ci        through texture parameters would require more complex validation.
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ciRevision History
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    #8 (August 22, 2019) - Clarify interaction with EGL_EXT_image_dma_buf_import.
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    #7 (February 7, 2018) - Amend the explanation of the attrib_list parameter.
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    #6 (February 2, 2018) - Add attrib_list parameter to both entry points.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    #5 (January 10, 2018) - Minor wording changes and clean-ups.  Moved the
2255bd8deadSopenharmony_ci        discussion of interaction with GenerateMipmap to an issue.
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci    #4 (December 6, 2017) - Rewritten against the OpenGL ES 3.2 specification.
2285bd8deadSopenharmony_ci        Renamed from KHR to EXT.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    #3 (November 20, 2017) - Added direct state access entry point and corrected
2315bd8deadSopenharmony_ci        references to the OpenGL ES 3.0 specification.
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    #2 (November 13, 2017) - Specified the allowed texture targets.  Clarified
2345bd8deadSopenharmony_ci        requirements.  Clarified interactions with mipmaps.
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    #1 (November 1, 2017) - Initial version.
2375bd8deadSopenharmony_ci
238