15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci APPLE_copy_texture_levels 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_APPLE_copy_texture_levels 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Eric Sunalp, Apple Inc., (esunalp 'at' apple.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Alex Eddy, Apple 165bd8deadSopenharmony_ci Richard Schreyer, Apple 175bd8deadSopenharmony_ci Eric Sunalp, Apple 185bd8deadSopenharmony_ci Michael Swift, Apple 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ciStatus 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci Complete 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ciVersion 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci Last Modified Date: November 29, 2011 275bd8deadSopenharmony_ci Revision: 2 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciNumber 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci OpenGL ES Extension #123 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciDependencies 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci OpenGL ES 1.1 or OpenGL ES 2.0 is required. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci EXT_texture_storage is required. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci This specification is written against the OpenGL ES 2.0.25 (Full Specification). 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciOverview 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci This extension provides an efficient path for copying a contiguous subset of mipmap 445bd8deadSopenharmony_ci levels from one texture to the matching subset of mipmap levels of another texture, 455bd8deadSopenharmony_ci where matches are determined by the equality of a level's dimensions. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci This extension is dependent on the existence of the extension EXT_texture_storage. 485bd8deadSopenharmony_ci Immutable textures are used to guarantee that storage is allocated up front for the 495bd8deadSopenharmony_ci source and destination textures and that the internal formats of those textures are 505bd8deadSopenharmony_ci sized the same. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci An efficient copy can be achieved by implementations because the internal storage 535bd8deadSopenharmony_ci requirements are the same between textures and will remain unchanged when moving data. 545bd8deadSopenharmony_ci It is expected that in all cases, moving levels from one texture to another is a 555bd8deadSopenharmony_ci simple copy operation without any necessary conversion. This extension can be used as 565bd8deadSopenharmony_ci an alternative to TEXTURE_BASE_LEVEL. In some implementations, changing the value of 575bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL can incur a costly re-allocation at runtime. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci Texture streaming is an expected use case for this extension. For example, a developer 605bd8deadSopenharmony_ci may want to stream in a larger base level for a given texture from a storage device. 615bd8deadSopenharmony_ci To achieve this, a copy of the current mipmap levels are made into a destination 625bd8deadSopenharmony_ci whose storage was specified to accommodate the source levels and the larger base 635bd8deadSopenharmony_ci level. The efficiency of the copy without conversion allows for the smaller mipmap 645bd8deadSopenharmony_ci levels to be in place while the larger base level is being read from the storage 655bd8deadSopenharmony_ci device and uploaded. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciNew Tokens 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci None 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ciNew Procedures and Functions 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci void CopyTextureLevelsAPPLE(uint destinationTexture, uint sourceTexture, 745bd8deadSopenharmony_ci int sourceBaseLevel, sizei sourceLevelCount); 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ciNew State 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci None 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ciNew Implementation Dependent State 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci None 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ciAdditions to Chapter 3 of the 2.0.25 Specification (Rasterization) 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci -- Restate the first paragraph of section 3.7.2, Alternate Texture Image Specification 875bd8deadSopenharmony_ci Commands 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Texture images may also be specified using image data taken directly from the 905bd8deadSopenharmony_ci framebuffer or from a subset of levels of a given texture. Rectangular subregions of 915bd8deadSopenharmony_ci existing texture images may also be respecified. 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci -- Append to section 3.7.2, Alternate Texture Image Specification Commands 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci The command 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci void CopyTextureLevelsAPPLE(uint destinationTexture, uint sourceTexture, 985bd8deadSopenharmony_ci int sourceBaseLevel, sizei sourceLevelCount); 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci is used to specify a texture image by copying a contiguous subset of mipmap levels 1015bd8deadSopenharmony_ci from one texture to the matching subset of mipmap levels of another texture, where 1025bd8deadSopenharmony_ci matches are determined by the equality of a level's dimensions. An INVALID_OPERATION 1035bd8deadSopenharmony_ci is generated when the count and dimensions of the source texture levels don't exactly 1045bd8deadSopenharmony_ci match the count and dimensions of a subset of corresponding destination texture 1055bd8deadSopenharmony_ci levels. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Both <sourceTexture> and <destinationTexture> specify the texture object names to act 1085bd8deadSopenharmony_ci as the source and destination of the copy as apposed to operating on the currently 1095bd8deadSopenharmony_ci bound textures for a given set of texture units. 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci It is a requirement that both <sourceTexture> and <destinationTexture> are immutable 1125bd8deadSopenharmony_ci textures and that they are both specified with the same sized internal format 1135bd8deadSopenharmony_ci enumeration. An INVALID_OPERATION is generated if either texture's 1145bd8deadSopenharmony_ci TEXTURE_IMMUTABLE_FORMAT_EXT is FALSE or if the sized internal formats don't match. 1155bd8deadSopenharmony_ci It is a requirement that the <sourceTexture>'s target specification is the same as 1165bd8deadSopenharmony_ci the <destinationTexture>'s target specification. If not, then an INVALID_OPERATION 1175bd8deadSopenharmony_ci is generated. 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci <sourceBaseLevel> and <sourceLevelCount> are used to specify the inclusive range of 1205bd8deadSopenharmony_ci mipmap levels to be copied from the source texture to the destination texture. 1215bd8deadSopenharmony_ci <sourceBaseLevel> can assume a value from zero to n-1, where n is the number of levels 1225bd8deadSopenharmony_ci for which the source texture was specified. Anything outside of this range will result 1235bd8deadSopenharmony_ci in the generation of an INVALID_VALUE error. <sourceLevelCount> is added to 1245bd8deadSopenharmony_ci <sourceBaseLevel> to specify the range of levels to be copied to the destination. An 1255bd8deadSopenharmony_ci INVALID_VALUE is generated if that value is greater than the number of levels for 1265bd8deadSopenharmony_ci which the source texture was specified. Additionally, <sourceLevelCount> must be 1275bd8deadSopenharmony_ci equal to or greater than one, or an INVALID_VALUE will be generated. 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ciErrors 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by CopyTextureLevelsAPPLE when the count and 1325bd8deadSopenharmony_ci dimensions of the source texture levels, from source base level to source base level 1335bd8deadSopenharmony_ci plus source level count, don't exactly match the count and dimensions of a subset of 1345bd8deadSopenharmony_ci matching destination texture levels. 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by CopyTextureLevelsAPPLE if either the 1375bd8deadSopenharmony_ci source texture or destination texture is a texture for which 1385bd8deadSopenharmony_ci TEXTURE_IMMUTABLE_FORMAT_EXT is FALSE. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by CopyTextureLevelsAPPLE if the internal format 1415bd8deadSopenharmony_ci of the source texture is different than that of the destination texture. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by CopyTextureLevelsAPPLE if the source and 1445bd8deadSopenharmony_ci the destination target specification differ. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci The error INVALID_VALUE is generated by CopyTextureLevelsAPPLE if the value passed to 1475bd8deadSopenharmony_ci the parameter <sourceTexture> or <destinationTexture> is zero. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci The error INVALID_VALUE is generated by CopyTextureLevelsAPPLE if the value passed to 1505bd8deadSopenharmony_ci the parameter <sourceBaseLevel> is less than zero. 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci The error INVALID_VALUE is generated by CopyTextureLevelsAPPLE if the value passed to 1535bd8deadSopenharmony_ci the parameter <sourceBaseLevel> is greater than n-1, where n is the number of levels 1545bd8deadSopenharmony_ci for which the source texture was specified. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci The error INVALID_VALUE is generated by CopyTextureLevelsAPPLE if the value passed to 1575bd8deadSopenharmony_ci the parameter <sourceLevelCount>, is less than one, or when added to the parameter 1585bd8deadSopenharmony_ci <sourceBaseLevel>, is greater than n-1, where n is the number of levels for which the 1595bd8deadSopenharmony_ci source texture was specified. 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ciIssues 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci None 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ciRevision History 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci Revision 2, 2011/11/29 (Eric Sunalp) 1685bd8deadSopenharmony_ci - Incorporate initial feedback. 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Revision 1, 2011/11/10 (Eric Sunalp) 1715bd8deadSopenharmony_ci - Draft proposal. 172