15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci IMG_texture_compression_pvrtc2 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_IMG_texture_compression_pvrtc2 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciNotice 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Copyright Imagination Technologies Limited, 2011. 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContact 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Ben Bowman, Imagination Technologies (benji 'dot' bowman 'at' 165bd8deadSopenharmony_ci imgtec 'dot' com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci 1.0, 19th December 2012 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciNumber 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci OpenGL ES Extension #140 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ciDependencies 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci This extension is written against the OpenGL ES 2.0 Specification. 335bd8deadSopenharmony_ci OpenGL ES 2.0 with OES_texture_npot is required. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciOverview 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci This extension provides additional texture compression functionality 385bd8deadSopenharmony_ci specific to Imagination Technologies PowerVR Texture compression format 395bd8deadSopenharmony_ci (called PVRTC2) subject to all the requirements and limitations 405bd8deadSopenharmony_ci described by the OpenGL ES 2.0 specification. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci This extension supports 4 and 2 bit per pixel texture compression 435bd8deadSopenharmony_ci formats. Because the compression of PVRTC2 is CPU intensive, 445bd8deadSopenharmony_ci it is not appropriate to carry out compression on the target 455bd8deadSopenharmony_ci platform. Therefore this extension only supports the loading of 465bd8deadSopenharmony_ci compressed texture data. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciIP Status 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci Imagination Technologies Proprietary 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciIssues 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci 1) If this extension does not support driver compression of data, 555bd8deadSopenharmony_ci how is data compressed? 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci Resolution: Textures should be compressed using the 585bd8deadSopenharmony_ci PVRTexTool available from PowerVR Developer Technology 595bd8deadSopenharmony_ci (devtech 'at' imgtec 'dot' com) 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci 2) Is sub-texturing supported? 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci Resolution: Yes, at block boundaries. This is 4x4 texels for 645bd8deadSopenharmony_ci the 4bpp format and 8x4 for the 2bpp format. Note it is up to 655bd8deadSopenharmony_ci the user to ensure the compressor tool is used in the mode which 665bd8deadSopenharmony_ci removes block edge artefacts if subdata is going to be used for 675bd8deadSopenharmony_ci eg. a texture atlas. 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci 3) Are non-power of two textures supported? 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci Resolution: Yes. 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci 4) How is the imageSize argument calculated for the CompressedTexImage2D 745bd8deadSopenharmony_ci and CompressedTexSubImage2D functions. 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci Resolution: For PVRTC2 4BPP format the imageSize is calculated as: 775bd8deadSopenharmony_ci ceil(width/4.0) * ceil(height/4.0) * 8.0 785bd8deadSopenharmony_ci For PVRTC2 2BPP format the imageSize is calculated as: 795bd8deadSopenharmony_ci ceil(width/8.0) * ceil(height/4.0) * 8.0 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci 5) Note some early 1.9 SGX drivers will return INVALID_VALUE if the width 825bd8deadSopenharmony_ci or height is not a multiple of the block size. 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ciNew Procedures and Functions 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci None. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ciNew Tokens 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of CompressedTexImage2D 915bd8deadSopenharmony_ci and the <format> parameter of CompressedTexSubImage2D: 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 945bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation) 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci None. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci Add Table 3.8.1: Specific Compressed Internal Formats 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Compressed Internal Format Base Internal Format 1055bd8deadSopenharmony_ci ========================== ==================== 1065bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV2_IMG RGBA 1075bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV2_IMG RGBA 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci Modify Section 3.7.3, Compressed Texture Images 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Add to Section 3.7.3, Compressed Texture Images (adding to the end of 1135bd8deadSopenharmony_ci the CompressedTexImage section) 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci If <internalformat> is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or 1165bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, the compressed texture is stored using 1175bd8deadSopenharmony_ci one of the PVRTC2 compressed texture image formats. The PVRTC2 1185bd8deadSopenharmony_ci texture compression algorithm supports only 2D images without borders. 1195bd8deadSopenharmony_ci CompressedTexImage2DARB will produce an INVALID_OPERATION if <border> is 1205bd8deadSopenharmony_ci non-zero. 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci Add to Section 3.7.3, Compressed Texture Images (adding to the end of 1235bd8deadSopenharmony_ci the CompressedTexSubImage section) 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci If the internal format of the texture image being modified is 1265bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, the 1275bd8deadSopenharmony_ci texture is stored using one of the PVRTC2 compressed texture image 1285bd8deadSopenharmony_ci formats. CompressedTexSubImage2D results in an INVALID_OPERATION error 1295bd8deadSopenharmony_ci if internal format is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG and one of the 1305bd8deadSopenharmony_ci following conditions occurs: 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci * <xoffset> is not a multiple of eight. 1335bd8deadSopenharmony_ci * <yoffset> is not a multiple of four. 1345bd8deadSopenharmony_ci * <width> is not a multiple of eight, except when the sum of <width> 1355bd8deadSopenharmony_ci and <xoffset> is equal to TEXTURE_WIDTH. 1365bd8deadSopenharmony_ci * <height> is not a multiple of four, except when the sum of <height> 1375bd8deadSopenharmony_ci and <yoffset> is equal to TEXTURE_HEIGHT. 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci or if internal format is COMPRESSED_RGBA_PVRTC_4BPPV2_IMG and one of the 1405bd8deadSopenharmony_ci following conditions occurs: 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci * <xoffset> is not a multiple of four. 1435bd8deadSopenharmony_ci * <yoffset> is not a multiple of four. 1445bd8deadSopenharmony_ci * <width> is not a multiple of four, except when the sum of <width> 1455bd8deadSopenharmony_ci and <xoffset> is equal to TEXTURE_WIDTH. 1465bd8deadSopenharmony_ci * <height> is not a multiple of four, except when the sum of <height> 1475bd8deadSopenharmony_ci and <yoffset> is equal to TEXTURE_HEIGHT. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 1505bd8deadSopenharmony_ciOperations and the Frame Buffer) 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci None. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions) 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci None. 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 2.0 Specification (State and 1595bd8deadSopenharmony_ciState Requests) 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci The queries for NUM_COMPRESSED_TEXTURE_FORMATS and 1625bd8deadSopenharmony_ci COMPRESSED_TEXTURE_FORMATS include COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 1635bd8deadSopenharmony_ci and COMPRESSED_RGBA_PVRTC_4BPPV2_IMG. 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ciErrors 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexImage2D if 1685bd8deadSopenharmony_ci <internalformat> is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or 1695bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, and <border> is not equal to zero. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage2D if 1725bd8deadSopenharmony_ci INTERNAL_FORMAT is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG and 1735bd8deadSopenharmony_ci any of the following apply: 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci * <xoffset> is not a multiple of eight. 1765bd8deadSopenharmony_ci * <yoffset> is not a multiple of four. 1775bd8deadSopenharmony_ci * <width> is not a multiple of eight, except when the sum of <width> 1785bd8deadSopenharmony_ci and <xoffset> is equal to TEXTURE_WIDTH. 1795bd8deadSopenharmony_ci * <height> is not a multiple of four, except when the sum of <height> 1805bd8deadSopenharmony_ci and <yoffset> is equal to TEXTURE_HEIGHT. 1815bd8deadSopenharmony_ci * <format> does not match the internal format of the texture image 1825bd8deadSopenharmony_ci being modified. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage2D if 1855bd8deadSopenharmony_ci INTERNAL_FORMAT is COMPRESSED_RGBA_PVRTC_4BPPV2_IMG and 1865bd8deadSopenharmony_ci any of the following apply: 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci * <xoffset> is not a multiple of four. 1895bd8deadSopenharmony_ci * <yoffset> is not a multiple of four. 1905bd8deadSopenharmony_ci * <width> is not a multiple of four, except when the sum of <width> 1915bd8deadSopenharmony_ci and <xoffset> is equal to TEXTURE_WIDTH. 1925bd8deadSopenharmony_ci * <height> is not a multiple of four, except when the sum of <height> 1935bd8deadSopenharmony_ci and <yoffset> is equal to TEXTURE_HEIGHT. 1945bd8deadSopenharmony_ci * <format> does not match the internal format of the texture image 1955bd8deadSopenharmony_ci being modified. 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ciNew State 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci None. 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ciRevision History 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci 0.9, 19/12/2012 tjh: Updated error conditions for subtexturing at the 2045bd8deadSopenharmony_ci edge of an NPOT texture. 2055bd8deadSopenharmony_ci 0.8, 08/08/2012 bcb: Final tidy up 2065bd8deadSopenharmony_ci 0.7, 24/11/2011 bcb: Added NPOT back. 2075bd8deadSopenharmony_ci 0.6, 03/08/2011 bcb: Added enumerants + further issues 2085bd8deadSopenharmony_ci 0.5, 03/08/2011 bcb: Update from DevTech feedback. 2095bd8deadSopenharmony_ci 0.4, 03/08/2011 bcb: Update issues list from GeorgK feedback. 2105bd8deadSopenharmony_ci 0.3, 02/08/2011 bcb: Update issues list from GrahamC feedback. 2115bd8deadSopenharmony_ci 0.2, 01/07/2011 bcb: Remove NPOT support. 2125bd8deadSopenharmony_ci 0.1, 30/06/2011 bcb: Initial revision. 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci 215