Path: blob/main_old/extensions/CHROMIUM_copy_texture.txt
1693 views
Name12CHROMIUM_copy_texture34Name Strings56GL_CHROMIUM_copy_texture78Version910Last Modifed Date: March 24, 20171112Dependencies1314OpenGL ES 2.0 or OpenGL ES 3.0 is required.1516EXT_texture_format_BGRA8888 affects the definition of this extension.17ARB_texture_rg affects the definition of this extension.18CHROMIUM_ycbcr_422_image affects the definition of this extension.1920Overview2122This extension expands on the functionality provided by the23glCopyTexImage2D command. A new function is exported,24glCopyTextureCHROMIUM, that performs the same copy operation as25glCopyTexImage2D.2627The extension also supports copying BGRA textures and copying28EXTERNAL_OES texture to BGRA texture, which is not explicitly29granted by EXT_texture_format_BGRA8888.3031New Procedures and Functions3233void CopyTextureCHROMIUM(uint sourceId,34int sourceLevel,35enum destTarget,36uint destId,37int destLevel,38int internalFormat,39enum destType,40boolean unpackFlipY,41boolean unpackPremultiplyAlpha,42boolean unpackUnmultiplyAlpha)434445void CopySubTextureCHROMIUM(uint sourceId,46int sourceLevel,47enum destTarget,48uint destId,49int destLevel,50int xoffset,51int yoffset,52int x,53int y,54sizei width,55sizei height,56boolean unpackFlipY,57boolean unpackPremultiplyAlpha,58boolean unpackUnmultiplyAlpha)5960Additions to the OpenGL ES 2.0 Specification6162The command6364CopyTextureCHROMIUM6566Copies the contents of <sourceLevel> level of <sourceId> texture to67<destLevel> level and <destTarget> target of <destId> texture.6869<destTarget> must be TEXTURE_2D,70TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,71TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,72TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z,73TEXTURE_RECTANGLE_ARB.7475The internal format of the destination texture is converted to that76specified by <internalFormat>.7778When source texture doens't contain a superset of the component79required by <internalFormat>, fill the components by following rules.8081source format color components82----------------------------------------83ALPHA (0, 0, 0, A)84RED (R, 0, 0, 1)85LUMINANCE (L, L, L, 1)86LUMINANCE_ALPHA (L, L, L, A)87RGB (R, G, B, 1)88RGB8 (R, G, B, 1)89RGBA (R, G, B, A)90RGBA8 (R, G, B, A)91BGRA_EXT (R, G, B, A)92BGRA8_EXT (R, G, B, A)93RGB_YCBCR_420V_CHROMIUM (R, G, B, 1)94RGB_YCBCR_422_CHROMIUM (R, G, B, 1)9596The format type of the destination texture is converted to that specified97by <destType>.9899If <flipY> is true, vertically flip texture image data.100101If <unpackPremultiplyAlpha> and <unpackUnmultiplyAlpha> are true,102no alpha processing occurs. This is the equivalent of having neither flag103set.104105When <sourceId> refers to a stream texture, the texture matrix will be106applied as part of the copy operation.107108INVALID_OPERATION is generated if <internalFormat> is not one of the109formats in Table 1.0.110111INVALID_OPERATION is generated if the internal format of <sourceId> is not112one of formats in Table 1.1.113114INVALID_VALUE is generated if <sourceId> or <destId> are not valid texture115objects.116117INVALID_ENUM is generated if <destTarget> is not one of the valid targets118described above.119120INVALID_OPERATION is generated if the bound target of destination texture121does not match <target>.122123INVALID_VALUE is generated if textures corresponding to <destId> have not124been bound as TEXTURE_2D, TEXTURE_CUBE_MAP, or125TEXTURE_RECTANGLE_ARB objects.126127INVALID_VALUE is generated if textures corresponding to <sourceId> have not128been bound as TEXTURE_2D, TEXTURE_RECTANGLE_ARB or129TEXTURE_EXTERNAL_OES objects.130131INVALID_VALUE is generated if <sourceLevel> is not 0 for ES 2.0, or if132<sourceLevel> or <destLevel> is less than 0 for ES 3.0.133134INVALID_VALUE is generated if <sourceLevel> of the source texture is not135defined.136137The command138139CopySubTextureCHROMIUM140141Copies the sub contents of texture referred to by <sourceId> to <destId>142texture without redefining <destId> texture.143144See CopyTextureCHROMIUM for the interpretation of the <destTarget>,145<sourceLevel>, <destLevel>, <flipY>, <premultiplyAlpha>, and146<unmultiplyAlpha> arguments.147148<xoffset> and <yoffset> specify a texel offset in the x and y direction149respectively within the destination texture.150151<x> and <y> specify specify a texel offset in the x and y direction152respectively within the source texture.153154<width> specifies the width of the texture subimage.155156<height> specifies the width of the texture subimage.157158INVALID_VALUE is generated if either <sourceId> texture or <destId>159texture is not defined.160161INVALID_OPERATION is generated if the internal format of <sourceId> or162<destId> is not one of formats in Table 1.1.163164INVALID_OPERATION is generated if the destination texture array has not165been defined.166167INVALID_VALUE is generated if <destId> texture is not bound as168TEXTURE_2D or TEXTURE_RECTANGLE_ARB.169170INVALID_VALUE is generated if level 0 of the source texture or171the destination texture is not defined.172173INVALID_VALUE is generated if (<xoffset> + <width>) > destWidth,174or (<yoffset> + <height>) > destHeight.175176Table 1.0 Valid internal formats for CopyTextureCHROMIUM:177178<internalFormat>179---------------180RGB181RGBA182RGB8183RGBA8184BGRA_EXT185BGRA8_EXT186SRGB_EXT187SRGB_ALPHA_EXT188R8189R8UI190RG8191RG8UI192SRGB8193RGB565194RGB8UI195SRGB8_ALPHA8196RGB5_A1197RGBA4198RGBA8UI199RGB9_E5200R16F201R32F202RG16F203RG32F204RGB16F205RGB32F206RGBA16F207RGBA32F208R11F_G11F_B10F209210Table 1.1 Valid source texture internal formats for CopyTextureCHROMIUM and211source and destination formats for CopySubTextureCHROMIUM:212213internal format214---------------215RED216ALPHA217LUMINANCE218LUMINANCE_ALPHA219RGB220RGBA221RGB8222RGBA8223BGRA_EXT224BGRA8_EXT225RGB_YCBCR_420V_CHROMIUM226RGB_YCBCR_422_CHROMIUM227228Dependencies on ARB_texture_rg229230If ARB_texture_rg is not supported:231* delete any reference to the R8 format.232233Dependencies on CHROMIUM_ycbcr_422_image234235If CHROMIUM_ycbcr_422_image is not supported:236* delete any reference to the RGB_YCBCR_422_CHROMIUM format.237238Errors239240None.241242New Tokens243244None.245246New State247248None.249250Revision History2512528/1/2011 Documented the extension2537/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()25416/7/2014 Add TEXTURE_RECTANGLE_ARB as valid source_id target25519/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and256unpack_unmultiply_alpha to both commands.2574/1/2016 Removed the argument target.2584/1/2016 Added TEXTURE_RECTANGLE_ARB as valid dest_id target.25919/12/2016 Supported more ES 3.0 formats.26018/1/2017 Supported source_level and dest_level.26119/1/2017 Added TEXTURE_CUBE_MAP as valid dest_id target.26224/3/2017 Clean up naming and move formats into tables.263264265