1Name 2 3 IMG_texture_compression_pvrtc 4 5Name Strings 6 7 GL_IMG_texture_compression_pvrtc 8 9Notice 10 11 Copyright Imagination Technologies Limited, 2005. 12 13Contact 14 15 Graham Connor, Imagination Technologies (graham 'dot' connor 'at' 16 imgtec 'dot' com) 17 18Status 19 20 Complete 21 22Version 23 24 1.3, 20 September 2012 25 26Number 27 28 OpenGL ES Extension #54 29 30Dependencies 31 32 This extension is written against the OpenGL ES 1.0 Specification, (which in turn 33 is derived from OpenGL 1.3). Thus this spec is effectively written against OpenGL 34 1.3 but does not address sections explicitly removed or reduced by OpenGL ES 1.0. 35 It can be implemented against OpenGL ES 2.0. 36 37 OpenGL ES 2.0 affects the definition of this extension. 38 39 APPLE_texture_2D_limited_npot affects the definition of this extension. 40 41Overview 42 43 This extension provides additional texture compression functionality 44 specific to Imagination Technologies PowerVR Texture compression format 45 (called PVRTC) subject to all the requirements and limitations described 46 by the OpenGL 1.3 specifications. 47 48 This extension supports 4 and 2 bit per pixel texture compression 49 formats. Because the compression of PVRTC is very CPU intensive, 50 it is not appropriate to carry out compression on the target 51 platform. Therefore this extension only supports the loading of 52 compressed texture data. 53 54IP Status 55 56 Imagination Technologies Proprietary 57 58Issues 59 60 1) Different versions of PowerVR hardware may interpret the 61 compression formats differently. 62 63 Resolution: If this situation arises, or could potentially arise 64 in the field, then further extensions would be defined to add tokens 65 for these compression formats. 66 67 2) Future revisions of PowerVR hardware might allow custom 68 texture dimensions to be used. How will this be dealt with? 69 70 Resolution: As with Issue 1, further extensions would be defined to 71 add tokens for extra compression formats. 72 73 3) PVRTC can encode alpha and opaque data in the same image and 74 this is handled seamlessly by the hardware decode. Why then are 75 there separate tokens for RGB and RGBA compressed textures? 76 77 Resolution: OpenGL needs to know whether a texture contains 78 alpha data so that the blend modes can be set up correctly. If 79 this information is not encoded in the image format token then 80 some blends will be unobtainable. Note that the driver scanning 81 the data is not a viable solution as it would restrict a 82 texture to being used in one mode only. 83 84 4) If this extension does not support driver compression of data, 85 how is data compressed? 86 87 Resolution: Textures should be compressed using the 88 PVRTextureTool available from PowerVR Developer Relations 89 (devrel 'at' powervr 'dot' com) 90 91 5) Is sub-texturing supported? 92 93 Resolution: Only for the reloading of complete 94 images. Sub-images are not supportable because the PVRTC 95 algorithm uses significant adjacency information, so there is 96 no discrete block of texels that can be decoded as a standalone 97 sub-unit, and so it follows that no stand alone sub-unit of 98 data can be loaded without changing the decoding of surrounding 99 texels. 100 101 6) How is the imageSize argument calculated for the CompressedTexImage2D 102 and CompressedTexSubImage2D functions. 103 104 Resolution: For PVRTC 4BPP formats the imageSize is calculated as: 105 ( max(width, 8) * max(height, 8) * 4 + 7) / 8 106 For PVRTC 2BPP formats the imageSize is calculated as: 107 ( max(width, 16) * max(height, 8) * 2 + 7) / 8 108 109New Procedures and Functions 110 111 None. 112 113New Tokens 114 115 Accepted by the <internalformat> parameter of CompressedTexImage2D 116 and the <format> parameter of CompressedTexSubImage2D: 117 118 COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 119 COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 120 COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 121 COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 122 123Additions to Chapter 2 of the OpenGL 1.3 Specification (OpenGL Operation) 124 125 None. 126 127Additions to Chapter 3 of the OpenGL 1.3 Specification (Rasterization) 128 129 Add to Table 3.16.1: Specific Compressed Internal Formats 130 131 Compressed Internal Format Base Internal Format 132 ========================== ==================== 133 COMPRESSED_RGB_PVRTC_4BPPV1_IMG RGB 134 COMPRESSED_RGB_PVRTC_2BPPV1_IMG RGB 135 COMPRESSED_RGBA_PVRTC_4BPPV1_IMG RGBA 136 COMPRESSED_RGBA_PVRTC_2BPPV1_IMG RGBA 137 138 139 Modify Section 3.8.3, Compressed Texture Images 140 141 Add to Section 3.8.3, Compressed Texture Images (adding to the end of 142 the CompressedTexImage section) 143 144 If <internalformat> is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 145 COMPRESSED_RGB_PVRTC_2BPPV1_IMG, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or 146 COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, the compressed texture is stored using one 147 of several PVRTC compressed texture image formats. The PVRTC texture 148 compression algorithm supports only 2D images without borders. 149 CompressedTexImage2D will produce an INVALID_VALUE if <border> is non-zero. 150 151 Add to Section 3.8.3, Compressed Texture Images (adding to the end of 152 the CompressedTexSubImage section) 153 154 If the internal format of the texture image being modified is 155 COMPRESSED_RGB_PVRTC_4BPPV1_IMG, COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 156 COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or COMPRESSED_RGBA_PVRTC_2BPPV1_IMG the 157 texture is stored using one of the several PVRTC compressed texture image 158 formats. CompressedTexSubImage2D result in an INVALID_OPERATION error only 159 if one of the following conditions occurs: 160 161 * <width> is not equal to TEXTURE_WIDTH. 162 * <height> is not equal to TEXTURE_HEIGHT. 163 * <xoffset> or <yoffset> is not zero. 164 165 166Additions to Chapter 4 of the OpenGL 1.3 Specification (Per-Fragment 167Operations and the Frame Buffer) 168 169 None. 170 171Additions to Chapter 5 of the OpenGL 1.3 Specification (Special Functions) 172 173 None. 174 175Additions to Chapter 6 of the OpenGL 1.3 Specification (State and 176State Requests) 177 178 None. 179 180Additions to Appendix A of the OpenGL 1.3 Specification (Invariance) 181 182 None. 183 184Additions to the AGL/GLX/WGL Specifications 185 186 None. 187 188GLX Protocol 189 190 None. 191 192Interactions with OpenGL ES 2.0 and APPLE_texture_2D_limited_npot 193 194 If the GL is OpenGL ES 2.0 or if APPLE_texture_2D_limited_npot is 195 supported, either of which introduces general support for non-power-of-two 196 texture dimensions, the error condition from OpenGL ES 1.1 restricting 197 NPOT dimensions is reintroduced specifically for CompressedTexImage2D when 198 <internalformat> is one of the PVRTC formats: 199 200 "For non-zero <width> and <height>, it must be the case that 201 202 w_s = 2^n (3.12) 203 h_s = 2^m (3.13) 204 205 for some integers n and m, where w_s and h_s are the specified image width 206 and height. If any one of these relationships cannot be satisfied, then 207 the error INVALID_VALUE is generated." 208 209Errors 210 211 INVALID_VALUE is generated by CompressedTexImage2D if 212 <internalformat> is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 213 COMPRESSED_RGB_PVRTC_2BPPV1_IMG, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or 214 COMPRESSED_RGBA_PVRTC_2BPPV1_IMG and <border> is not equal to zero. 215 216 INVALID_OPERATION is generated by CompressedTexSubImage2D if INTERNAL_FORMAT 217 is COMPRESSED_RGB_PVRTC_4BPPV1_IMG, COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 218 COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, or COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 219 and any of the following apply: <width> is not equal to TEXTURE_WIDTH; 220 <height> is not equal to TEXTURE_HEIGHT; <xoffset> and <yoffset> are not zero. 221 222New State 223 224 None. 225 226Revision History 227 228 0.1, 18/12/2003 gdc: Initial revision. 229 0.2, 13/01/2004 gdc: Formatting changes. 230 0.3, 24/08/2004 gdc: Mini-mip behaviour. 231 0.4, 25/01/2005 nt: Removed sections about CompressedTex[Sub]Image[1|3]D 232 and rewrote specs based on OpenGL 1.3. 233 1.0, 30/04/2009 bcb: Final cleanup for publish to the registry 234 1.1, 01/11/2011 bcb: Fix some incorrect error conditions (not matching 235 reality) 236 1.2, 08/05/2012 bnl: Fix missing error for NPOT dimensions and remove 237 occasional use of ARB suffixes 238 1.3, 20/09/2012 bcb: Remove 1:1 language to match error conditions 239 240