Name CHROMIUM_copy_texture Name Strings GL_CHROMIUM_copy_texture Version Last Modifed Date: March 24, 2017 Dependencies OpenGL ES 2.0 or OpenGL ES 3.0 is required. EXT_texture_format_BGRA8888 affects the definition of this extension. ARB_texture_rg affects the definition of this extension. CHROMIUM_ycbcr_422_image affects the definition of this extension. Overview This extension expands on the functionality provided by the glCopyTexImage2D command. A new function is exported, glCopyTextureCHROMIUM, that performs the same copy operation as glCopyTexImage2D. The extension also supports copying BGRA textures and copying EXTERNAL_OES texture to BGRA texture, which is not explicitly granted by EXT_texture_format_BGRA8888. New Procedures and Functions void CopyTextureCHROMIUM(uint sourceId, int sourceLevel, enum destTarget, uint destId, int destLevel, int internalFormat, enum destType, boolean unpackFlipY, boolean unpackPremultiplyAlpha, boolean unpackUnmultiplyAlpha) void CopySubTextureCHROMIUM(uint sourceId, int sourceLevel, enum destTarget, uint destId, int destLevel, int xoffset, int yoffset, int x, int y, sizei width, sizei height, boolean unpackFlipY, boolean unpackPremultiplyAlpha, boolean unpackUnmultiplyAlpha) Additions to the OpenGL ES 2.0 Specification The command CopyTextureCHROMIUM Copies the contents of level of texture to level and target of texture. must be TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z, TEXTURE_RECTANGLE_ARB. The internal format of the destination texture is converted to that specified by . When source texture doens't contain a superset of the component required by , fill the components by following rules. source format color components ---------------------------------------- ALPHA (0, 0, 0, A) RED (R, 0, 0, 1) LUMINANCE (L, L, L, 1) LUMINANCE_ALPHA (L, L, L, A) RGB (R, G, B, 1) RGB8 (R, G, B, 1) RGBA (R, G, B, A) RGBA8 (R, G, B, A) BGRA_EXT (R, G, B, A) BGRA8_EXT (R, G, B, A) RGB_YCBCR_420V_CHROMIUM (R, G, B, 1) RGB_YCBCR_422_CHROMIUM (R, G, B, 1) The format type of the destination texture is converted to that specified by . If is true, vertically flip texture image data. If and are true, no alpha processing occurs. This is the equivalent of having neither flag set. When refers to a stream texture, the texture matrix will be applied as part of the copy operation. INVALID_OPERATION is generated if is not one of the formats in Table 1.0. INVALID_OPERATION is generated if the internal format of is not one of formats in Table 1.1. INVALID_VALUE is generated if or are not valid texture objects. INVALID_ENUM is generated if is not one of the valid targets described above. INVALID_OPERATION is generated if the bound target of destination texture does not match . INVALID_VALUE is generated if textures corresponding to have not been bound as TEXTURE_2D, TEXTURE_CUBE_MAP, or TEXTURE_RECTANGLE_ARB objects. INVALID_VALUE is generated if textures corresponding to have not been bound as TEXTURE_2D, TEXTURE_RECTANGLE_ARB or TEXTURE_EXTERNAL_OES objects. INVALID_VALUE is generated if is not 0 for ES 2.0, or if or is less than 0 for ES 3.0. INVALID_VALUE is generated if of the source texture is not defined. The command CopySubTextureCHROMIUM Copies the sub contents of texture referred to by to texture without redefining texture. See CopyTextureCHROMIUM for the interpretation of the , , , , , and arguments. and specify a texel offset in the x and y direction respectively within the destination texture. and specify specify a texel offset in the x and y direction respectively within the source texture. specifies the width of the texture subimage. specifies the width of the texture subimage. INVALID_VALUE is generated if either texture or texture is not defined. INVALID_OPERATION is generated if the internal format of or is not one of formats in Table 1.1. INVALID_OPERATION is generated if the destination texture array has not been defined. INVALID_VALUE is generated if texture is not bound as TEXTURE_2D or TEXTURE_RECTANGLE_ARB. INVALID_VALUE is generated if level 0 of the source texture or the destination texture is not defined. INVALID_VALUE is generated if ( + ) > destWidth, or ( + ) > destHeight. Table 1.0 Valid internal formats for CopyTextureCHROMIUM: --------------- RGB RGBA RGB8 RGBA8 BGRA_EXT BGRA8_EXT SRGB_EXT SRGB_ALPHA_EXT R8 R8UI RG8 RG8UI SRGB8 RGB565 RGB8UI SRGB8_ALPHA8 RGB5_A1 RGBA4 RGBA8UI RGB9_E5 R16F R32F RG16F RG32F RGB16F RGB32F RGBA16F RGBA32F R11F_G11F_B10F Table 1.1 Valid source texture internal formats for CopyTextureCHROMIUM and source and destination formats for CopySubTextureCHROMIUM: internal format --------------- RED ALPHA LUMINANCE LUMINANCE_ALPHA RGB RGBA RGB8 RGBA8 BGRA_EXT BGRA8_EXT RGB_YCBCR_420V_CHROMIUM RGB_YCBCR_422_CHROMIUM Dependencies on ARB_texture_rg If ARB_texture_rg is not supported: * delete any reference to the R8 format. Dependencies on CHROMIUM_ycbcr_422_image If CHROMIUM_ycbcr_422_image is not supported: * delete any reference to the RGB_YCBCR_422_CHROMIUM format. Errors None. New Tokens None. New State None. Revision History 8/1/2011 Documented the extension 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM() 16/7/2014 Add TEXTURE_RECTANGLE_ARB as valid source_id target 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and unpack_unmultiply_alpha to both commands. 4/1/2016 Removed the argument target. 4/1/2016 Added TEXTURE_RECTANGLE_ARB as valid dest_id target. 19/12/2016 Supported more ES 3.0 formats. 18/1/2017 Supported source_level and dest_level. 19/1/2017 Added TEXTURE_CUBE_MAP as valid dest_id target. 24/3/2017 Clean up naming and move formats into tables.