Name KHR_gl_texture_2D_image KHR_gl_texture_cubemap_image KHR_gl_texture_3D_image KHR_gl_renderbuffer_image Name Strings EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_renderbuffer_image Contributors Aaftab Munshi Barthold Lichtenbelt Gary King Jeff Juliano Jon Leech Jonathan Grant Acorn Pooley Contacts Gary King, NVIDIA Corporation (gking 'at' nvidia.com) Status Complete. Approved by the Khronos Board of Promoters on February 11, 2008. Version Version 8, February 4, 2009 Number EGL Extension #5 Dependencies All extensions require EGL 1.2 and the EGL_KHR_image extension These extensions are written against the wording of the EGL 1.2 Specification. KHR_gl_texture_2D_image requires the presence of an OpenGL ES implementation (1.0 or later and/or 2.0 or later). KHR_gl_texture_cubemap_image requires an OpenGL ES 1.0 implementation with the KHR_texture_cubemap extension or an OpenGL ES 2.0 implementation; KHR_gl_texture_2D_image must be supported by the EGL implementation. KHR_gl_texture_3D_image requires an OpenGL ES implementation with the OES_texture_3D extension; KHR_gl_texture_2D_image must be supported by the EGL implementation. KHR_gl_renderbuffer_image requires an OpenGL ES implementation with the OES_framebuffer_object extension, or an OpenGL ES 2.0 implementation; KHR_gl_texture_2D_image must be supported by the EGL implementation. Overview The extensions specified in this document provide a mechanism for creating EGLImage objects from OpenGL ES API resources, such as two- and three- dimensional textures, cube maps and render buffers. For an overview of EGLImage operation, please see the EGL_KHR_image specification. Due to the number of available extensions for the OpenGL ES 1.1 and OpenGL ES 2.0 APIs, this document is organized as 4 separate extensions, described collectively. These extensions are separated based on the required underlying GL functionality (described in the dependencies section). New Types None New Procedures and Functions None New Tokens Accepted in the parameter of eglCreateImageKHR: EGL_GL_TEXTURE_2D_KHR 0x30B1 Accepted as an attribute in the parameter of eglCreateImageKHR: EGL_GL_TEXTURE_LEVEL_KHR 0x30BC Added by KHR_gl_texture_cubemap_image: Accepted in the parameter of eglCreateImageKHR: EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 Added by KHR_gl_texture_3D_image: Accepted in the parameter of eglCreateImageKHR: EGL_GL_TEXTURE_3D_KHR 0x30B2 Accepted as an attribute in the parameter of eglCreateImageKHR: EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD Added by KHR_gl_renderbuffer_image: Accepted in the parameter of eglCreateImageKHR: EGL_GL_RENDERBUFFER_KHR 0x30B9 Additions to the EGL Image (EGL_KHR_image) Specification: Add the following to Table aaa (Legal values for eglCreateImageKHR parameter), Section 2.5.1 (EGLImage Specification) +-------------------------------------+---------------------------------+ | | Notes | +-------------------------------------+---------------------------------+ | EGL_GL_TEXTURE_2D_KHR | Used for OpenGL ES | | | 2D texture images. | +-------------------------------------+---------------------------------+ If KHR_gl_texture_cubemap_image is supported: +-----------------------------------------+-----------------------------+ | | Notes | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_POSITIVE_X_KHR | Used for the +X face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_X_KHR | Used for the -X face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_POSITIVE_Y_KHR | Used for the +Y face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_Y_KHR | Used for the -Y face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_POSITIVE_Z_KHR | Used for the +Z face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ | EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_Z_KHR | Used for the -Z face of | | | OpenGL-ES cubemap texture | | | images | +-----------------------------------------+-----------------------------+ If KHR_gl_texture_3D_image is supported: +-------------------------------------+---------------------------------+ | | Notes | +-------------------------------------+---------------------------------+ | EGL_GL_TEXTURE_3D_KHR | Used for OpenGL ES | | | 3D texture images. | +-------------------------------------+---------------------------------+ If KHR_gl_renderbuffer_image is supported: +-------------------------------------+---------------------------------+ | | Notes | +-------------------------------------+---------------------------------+ | EGL_GL_RENDERBUFFER_KHR | Used for OpenGL ES | | | renderbuffer images | +-------------------------------------+---------------------------------+ Add the following to Table bbb (Legal attributes for eglCreateImageKHR parameter), Section 2.5.1 (EGLImage Specification) +----------------------------+--------------------------------+---------+ | | | Default | | Attribute | Description | Value | +----------------------------+--------------------------------+---------+ | EGL_GL_TEXTURE_LEVEL_KHR | Specifies the mipmap level | 0 | | | used as the EGLImage source. | | | | Must be part of the complete | | | | texture object | | +----------------------------+--------------------------------+---------+ If KHR_gl_texture_3D_image is supported: +-----------------------------+-------------------------------+---------+ | | | Default | | Attribute | Description | Value | +-----------------------------+-------------------------------+---------+ | EGL_GL_TEXTURE_ZOFFSET_KHR | Specifies the depth offset | 0 | | | of the image to use as the | | | | EGLImage source. Must be | | | | part of the complete texture | | | | object | | +-----------------------------+-------------------------------+---------+ Insert the following text after paragraph 3 ("If is NATIVE_PIXMAP_KHR...") of Section 2.5.1 (EGLImage Specification) "If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_3D_KHR, EGL_GL_RENDERBUFFER_KHR, EGL_GL_TEXTURE_CUBEMAP_POSITIVE_X_KHR, EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_X_KHR, EGL_GL_TEXTURE_CUBEMAP_POSITIVE_Y_KHR, EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_Y_KHR, EGL_GL_TEXTURE_CUBEMAP_POSITIVE_Z_KHR, or EGL_GL_TEXTURE_CUBEMAP_NEGATIVE_Z_KHR, must be a valid EGLDisplay, and must be a valid OpenGL ES API context on that display. If is EGL_GL_TEXTURE_2D_KHR, must be the name of a nonzero, EGL_GL_TEXTURE_2D target texture object, cast into the type EGLClientBuffer. should specify the mipmap level which will be used as the EGLImage source (EGL_GL_TEXTURE_LEVEL_KHR); the specified mipmap level must be part of . If not specified, the default value listed in Table bbb will be used, instead. Additional values specified in are ignored. The texture must be complete unless the mipmap level to be used is 0, the texture has mipmap level 0 specified, and no other mipmap levels are specified. If is one of the EGL_GL_TEXTURE_CUBEMAP_* enumerants, must be the name of a cube-complete, nonzero, EGL_GL_TEXTURE_CUBEMAP_OES target texture object, cast into the type EGLClientBuffer. should specify the mipmap level which will be used as the EGLImage source (EGL_GL_TEXTURE_LEVEL_KHR); the specified mipmap level must be part of . If not specified, the default value listed in Table bbb will be used, instead. Additional values specified in are ignored. The texture must be cube-complete unless the mipmap level to be used is 0, the texture has mipmap level 0 specified for all faces, and no other mipmap levels are specified for any faces. If is EGL_GL_TEXTURE_3D_KHR, must be the name of a complete, nonzero, EGL_GL_TEXTURE_3D_OES target texture object, cast into the type EGLClientBuffer. should specify the mipmap level (EGL_GL_TEXTURE_LEVEL_KHR) and z-offset (EGL_GL_TEXTURE_ZOFFSET_KHR) which will be used as the EGLImage source; the specified mipmap level must be part of , and the specified z-offset must be smaller than the depth of the specified mipmap level. If a value is not specified, the default value listed in Table bbb will be used, instead. Additional values specified in are ignored. The texture must be complete unless the mipmap level to be used is 0, the texture has mipmap level 0 specified, and no other mipmap levels are specified. If is EGL_GL_RENDERBUFFER_KHR, must be the name of a complete, nonzero, EGL_GL_RENDERBUFFER_OES object, cast into the type EGLClientBuffer. Values specified in are ignored." Add the following errors to the end of the list in Section 2.5.1 (EGLImage Specification): " * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR, EGL_GL_RENDERBUFFER_KHR or EGL_GL_TEXTURE_3D_KHR, and is not a valid EGLDisplay, the error EGL_BAD_DISPLAY is generated. * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR, EGL_GL_RENDERBUFFER_KHR or EGL_GL_TEXTURE_3D_KHR, and is not a valid EGLContext, the error EGL_BAD_CONTEXT is generated. * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR, EGL_GL_RENDERBUFFER_KHR or EGL_GL_TEXTURE_3D_KHR, and is not a valid OpenGL ES context, or does not match the , the error EGL_BAD_MATCH is generated. * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR or EGL_GL_TEXTURE_3D_KHR and is not the name of a texture object of type , the error EGL_BAD_PARAMETER is generated. * If EGL_GL_TEXTURE_LEVEL_KHR is nonzero, and is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR or EGL_GL_TEXTURE_3D_KHR and is not the name of a complete texture object, the error EGL_BAD_PARAMETER is generated. * If EGL_GL_TEXTURE_LEVEL_KHR is 0, and is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR or EGL_GL_TEXTURE_3D_KHR and is the name of an incomplete texture object, and any mipmap levels other than mipmap level 0 are specified, the error EGL_BAD_PARAMETER is generated. * If EGL_GL_TEXTURE_LEVEL_KHR is 0, and is EGL_GL_TEXTURE_2D_KHR or EGL_GL_TEXTURE_3D_KHR and is not the name of a complete texture object, and mipmap level 0 is not specified, the error EGL_BAD_PARAMETER is generated. * If EGL_GL_TEXTURE_LEVEL_KHR is 0, and is EGL_GL_TEXTURE_CUBEMAP_*_KHR, and is not the name of a complete texture object, and one or more faces do not have mipmap level 0 specified, the error EGL_BAD_PARAMETER is generated. * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR, EGL_GL_RENDERBUFFER_KHR or EGL_GL_TEXTURE_3D_KHR and refers to the default object (0), the error EGL_BAD_PARAMETER is generated. * If is EGL_GL_TEXTURE_2D_KHR, EGL_GL_TEXTURE_CUBEMAP_*_KHR, or EGL_GL_TEXTURE_3D_KHR, and the value specified in for EGL_GL_TEXTURE_LEVEL_KHR is not a valid mipmap level for the specified texture object , the error EGL_BAD_MATCH is generated. * If is EGL_GL_TEXTURE_3D_KHR, and the value specified in for EGL_GL_TEXTURE_ZOFFSET_KHR exceeds the depth of the specified mipmap level-of-detail in , the error EGL_BAD_PARAMETER is generated." Issues 1. What should happen if an application attempts to create an EGLImage from a default OpenGL object (i.e., objects with a name of 0)? SUGGESTION: Disallow this operation, and generate an error. 2. What happens when one of glTexImage2D glCopyTexImage2D glCompressedTexImage2D glTexImage3D glCopyTexImage3D glCompressedTexImage3D is called on a texture which has a mipmap level which is an EGLImage sibling? RESOLVED: the EGLImage sibling is orphaned. The mipmap level and the EGLImage no longer have any connection. 3. What happens when one of glTexSubImage2D glCopyTexSubImage2D glCompressedTexSubImage2D glTexSubImage3D glCopyTexSubImage3D glCompressedTexSubImage3D is called on a texture which has a mipmap level which is an EGLImage sibling? RESOLVED: the EGLImage sibling is NOT orphaned. The mipmap level remains an EGLImage sibling. 4. What happens when glGenerateMipmaps is called on a texture which has a mipmap level which is an EGLImage sibling? RESOLVED: If the texture is already complete, then the EGLImage sibling is not orphaned, and the mipmap level remains an EGLImage sibling. However, if the texture was not complete then the EGLImage sibling IS orphaned. This is because the implementation will implicitly alter the structure of the mipmap levels. 5. What happens when the GL_GENERATE_MIPMAP bit causes a texture to be respecified. RESOLVED: If the texture is already complete, then the EGLImage sibling is not orphaned, and the mipmap level remains an EGLImage sibling. However, if the texture was not complete then the EGLImage sibling IS orphaned. This is because the implementation will implicitly alter the structure of the mipmap levels. Revision History #8 (Jon Leech, February 4, 2009) - Change "non-default ... texture object" to "nonzero". #7 (Bruce Merry, January 20, 2009) - Minor wording improvements on issues 4 and 5. #6 (Acorn Pooley, January 13, 2009) - Modify completion requirement so textures with only mipmap level 0 can be EGLImage source siblings. Add issues 2-5. #5 (Jon Leech, October 8, 2008) - Updated status (approved as part of OpenKODE 1.0) #4 (Jon Leech, April 7, 2007) - Assigned enumerant values - Added OpenKODE 1.0 Provisional disclaimer #3 (December 14, 2006) - Changed requirement to egl 1.2 to include EGLClientBuffer type. - formatting to keep within 80 columns - added error condition descriptions for and - changed error condition for EGL_GL_TEXTURE_ZOFFSET_KHR too big to be EGL_BAD_PARAMETER #2 (November 27, 2006) - Changed OES token to KHR