15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci IMG_texture_compression_pvrtc 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_IMG_texture_compression_pvrtc 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciNotice 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Copyright Imagination Technologies Limited, 2005. 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContact 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Graham Connor, Imagination Technologies (graham 'dot' connor 'at' 165bd8deadSopenharmony_ci imgtec 'dot' com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci 1.3, 20 September 2012 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciNumber 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci OpenGL ES Extension #54 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ciDependencies 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci This extension is written against the OpenGL ES 1.0 Specification, (which in turn 335bd8deadSopenharmony_ci is derived from OpenGL 1.3). Thus this spec is effectively written against OpenGL 345bd8deadSopenharmony_ci 1.3 but does not address sections explicitly removed or reduced by OpenGL ES 1.0. 355bd8deadSopenharmony_ci It can be implemented against OpenGL ES 2.0. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci OpenGL ES 2.0 affects the definition of this extension. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci APPLE_texture_2D_limited_npot affects the definition of this extension. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciOverview 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci This extension provides additional texture compression functionality 445bd8deadSopenharmony_ci specific to Imagination Technologies PowerVR Texture compression format 455bd8deadSopenharmony_ci (called PVRTC) subject to all the requirements and limitations described 465bd8deadSopenharmony_ci by the OpenGL 1.3 specifications. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension supports 4 and 2 bit per pixel texture compression 495bd8deadSopenharmony_ci formats. Because the compression of PVRTC is very CPU intensive, 505bd8deadSopenharmony_ci it is not appropriate to carry out compression on the target 515bd8deadSopenharmony_ci platform. Therefore this extension only supports the loading of 525bd8deadSopenharmony_ci compressed texture data. 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ciIP Status 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci Imagination Technologies Proprietary 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciIssues 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci 1) Different versions of PowerVR hardware may interpret the 615bd8deadSopenharmony_ci compression formats differently. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci Resolution: If this situation arises, or could potentially arise 645bd8deadSopenharmony_ci in the field, then further extensions would be defined to add tokens 655bd8deadSopenharmony_ci for these compression formats. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci 2) Future revisions of PowerVR hardware might allow custom 685bd8deadSopenharmony_ci texture dimensions to be used. How will this be dealt with? 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci Resolution: As with Issue 1, further extensions would be defined to 715bd8deadSopenharmony_ci add tokens for extra compression formats. 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci 3) PVRTC can encode alpha and opaque data in the same image and 745bd8deadSopenharmony_ci this is handled seamlessly by the hardware decode. Why then are 755bd8deadSopenharmony_ci there separate tokens for RGB and RGBA compressed textures? 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci Resolution: OpenGL needs to know whether a texture contains 785bd8deadSopenharmony_ci alpha data so that the blend modes can be set up correctly. If 795bd8deadSopenharmony_ci this information is not encoded in the image format token then 805bd8deadSopenharmony_ci some blends will be unobtainable. Note that the driver scanning 815bd8deadSopenharmony_ci the data is not a viable solution as it would restrict a 825bd8deadSopenharmony_ci texture to being used in one mode only. 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci 4) If this extension does not support driver compression of data, 855bd8deadSopenharmony_ci how is data compressed? 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci Resolution: Textures should be compressed using the 885bd8deadSopenharmony_ci PVRTextureTool available from PowerVR Developer Relations 895bd8deadSopenharmony_ci (devrel 'at' powervr 'dot' com) 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci 5) Is sub-texturing supported? 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci Resolution: Only for the reloading of complete 945bd8deadSopenharmony_ci images. Sub-images are not supportable because the PVRTC 955bd8deadSopenharmony_ci algorithm uses significant adjacency information, so there is 965bd8deadSopenharmony_ci no discrete block of texels that can be decoded as a standalone 975bd8deadSopenharmony_ci sub-unit, and so it follows that no stand alone sub-unit of 985bd8deadSopenharmony_ci data can be loaded without changing the decoding of surrounding 995bd8deadSopenharmony_ci texels. 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci 6) How is the imageSize argument calculated for the CompressedTexImage2D 1025bd8deadSopenharmony_ci and CompressedTexSubImage2D functions. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Resolution: For PVRTC 4BPP formats the imageSize is calculated as: 1055bd8deadSopenharmony_ci ( max(width, 8) * max(height, 8) * 4 + 7) / 8 1065bd8deadSopenharmony_ci For PVRTC 2BPP formats the imageSize is calculated as: 1075bd8deadSopenharmony_ci ( max(width, 16) * max(height, 8) * 2 + 7) / 8 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ciNew Procedures and Functions 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci None. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciNew Tokens 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of CompressedTexImage2D 1165bd8deadSopenharmony_ci and the <format> parameter of CompressedTexSubImage2D: 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 1195bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 1205bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 1215bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.3 Specification (OpenGL Operation) 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci None. 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.3 Specification (Rasterization) 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci Add to Table 3.16.1: Specific Compressed Internal Formats 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci Compressed Internal Format Base Internal Format 1325bd8deadSopenharmony_ci ========================== ==================== 1335bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_4BPPV1_IMG RGB 1345bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_2BPPV1_IMG RGB 1355bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV1_IMG RGBA 1365bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV1_IMG RGBA 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci Modify Section 3.8.3, Compressed Texture Images 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci Add to Section 3.8.3, Compressed Texture Images (adding to the end of 1425bd8deadSopenharmony_ci the CompressedTexImage section) 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci If <internalformat> is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 1455bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_2BPPV1_IMG, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or 1465bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, the compressed texture is stored using one 1475bd8deadSopenharmony_ci of several PVRTC compressed texture image formats. The PVRTC texture 1485bd8deadSopenharmony_ci compression algorithm supports only 2D images without borders. 1495bd8deadSopenharmony_ci CompressedTexImage2D will produce an INVALID_VALUE if <border> is non-zero. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Add to Section 3.8.3, Compressed Texture Images (adding to the end of 1525bd8deadSopenharmony_ci the CompressedTexSubImage section) 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci If the internal format of the texture image being modified is 1555bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_4BPPV1_IMG, COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 1565bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or COMPRESSED_RGBA_PVRTC_2BPPV1_IMG the 1575bd8deadSopenharmony_ci texture is stored using one of the several PVRTC compressed texture image 1585bd8deadSopenharmony_ci formats. CompressedTexSubImage2D result in an INVALID_OPERATION error only 1595bd8deadSopenharmony_ci if one of the following conditions occurs: 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci * <width> is not equal to TEXTURE_WIDTH. 1625bd8deadSopenharmony_ci * <height> is not equal to TEXTURE_HEIGHT. 1635bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not zero. 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.3 Specification (Per-Fragment 1675bd8deadSopenharmony_ciOperations and the Frame Buffer) 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci None. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.3 Specification (Special Functions) 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci None. 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.3 Specification (State and 1765bd8deadSopenharmony_ciState Requests) 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci None. 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.3 Specification (Invariance) 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci None. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci None. 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ciGLX Protocol 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci None. 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ciInteractions with OpenGL ES 2.0 and APPLE_texture_2D_limited_npot 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci If the GL is OpenGL ES 2.0 or if APPLE_texture_2D_limited_npot is 1955bd8deadSopenharmony_ci supported, either of which introduces general support for non-power-of-two 1965bd8deadSopenharmony_ci texture dimensions, the error condition from OpenGL ES 1.1 restricting 1975bd8deadSopenharmony_ci NPOT dimensions is reintroduced specifically for CompressedTexImage2D when 1985bd8deadSopenharmony_ci <internalformat> is one of the PVRTC formats: 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci "For non-zero <width> and <height>, it must be the case that 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci w_s = 2^n (3.12) 2035bd8deadSopenharmony_ci h_s = 2^m (3.13) 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci for some integers n and m, where w_s and h_s are the specified image width 2065bd8deadSopenharmony_ci and height. If any one of these relationships cannot be satisfied, then 2075bd8deadSopenharmony_ci the error INVALID_VALUE is generated." 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ciErrors 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage2D if 2125bd8deadSopenharmony_ci <internalformat> is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 2135bd8deadSopenharmony_ci COMPRESSED_RGB_PVRTC_2BPPV1_IMG, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or 2145bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_2BPPV1_IMG and <border> is not equal to zero. 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage2D if INTERNAL_FORMAT 2175bd8deadSopenharmony_ci is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 2185bd8deadSopenharmony_ci COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 2195bd8deadSopenharmony_ci and any of the following apply: <width> is not equal to TEXTURE_WIDTH; 2205bd8deadSopenharmony_ci <height> is not equal to TEXTURE_HEIGHT; <xoffset> and <yoffset> are not zero. 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ciNew State 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci None. 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ciRevision History 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci 0.1, 18/12/2003 gdc: Initial revision. 2295bd8deadSopenharmony_ci 0.2, 13/01/2004 gdc: Formatting changes. 2305bd8deadSopenharmony_ci 0.3, 24/08/2004 gdc: Mini-mip behaviour. 2315bd8deadSopenharmony_ci 0.4, 25/01/2005 nt: Removed sections about CompressedTex[Sub]Image[1|3]D 2325bd8deadSopenharmony_ci and rewrote specs based on OpenGL 1.3. 2335bd8deadSopenharmony_ci 1.0, 30/04/2009 bcb: Final cleanup for publish to the registry 2345bd8deadSopenharmony_ci 1.1, 01/11/2011 bcb: Fix some incorrect error conditions (not matching 2355bd8deadSopenharmony_ci reality) 2365bd8deadSopenharmony_ci 1.2, 08/05/2012 bnl: Fix missing error for NPOT dimensions and remove 2375bd8deadSopenharmony_ci occasional use of ARB suffixes 2385bd8deadSopenharmony_ci 1.3, 20/09/2012 bcb: Remove 1:1 language to match error conditions 2395bd8deadSopenharmony_ci 240