1Name 2 3 IMG_texture_compression_pvrtc2 4 5Name Strings 6 7 GL_IMG_texture_compression_pvrtc2 8 9Notice 10 11 Copyright Imagination Technologies Limited, 2011. 12 13Contact 14 15 Ben Bowman, Imagination Technologies (benji 'dot' bowman 'at' 16 imgtec 'dot' com) 17 18Status 19 20 Complete 21 22Version 23 24 1.0, 19th December 2012 25 26Number 27 28 OpenGL ES Extension #140 29 30Dependencies 31 32 This extension is written against the OpenGL ES 2.0 Specification. 33 OpenGL ES 2.0 with OES_texture_npot is required. 34 35Overview 36 37 This extension provides additional texture compression functionality 38 specific to Imagination Technologies PowerVR Texture compression format 39 (called PVRTC2) subject to all the requirements and limitations 40 described by the OpenGL ES 2.0 specification. 41 42 This extension supports 4 and 2 bit per pixel texture compression 43 formats. Because the compression of PVRTC2 is CPU intensive, 44 it is not appropriate to carry out compression on the target 45 platform. Therefore this extension only supports the loading of 46 compressed texture data. 47 48IP Status 49 50 Imagination Technologies Proprietary 51 52Issues 53 54 1) If this extension does not support driver compression of data, 55 how is data compressed? 56 57 Resolution: Textures should be compressed using the 58 PVRTexTool available from PowerVR Developer Technology 59 (devtech 'at' imgtec 'dot' com) 60 61 2) Is sub-texturing supported? 62 63 Resolution: Yes, at block boundaries. This is 4x4 texels for 64 the 4bpp format and 8x4 for the 2bpp format. Note it is up to 65 the user to ensure the compressor tool is used in the mode which 66 removes block edge artefacts if subdata is going to be used for 67 eg. a texture atlas. 68 69 3) Are non-power of two textures supported? 70 71 Resolution: Yes. 72 73 4) How is the imageSize argument calculated for the CompressedTexImage2D 74 and CompressedTexSubImage2D functions. 75 76 Resolution: For PVRTC2 4BPP format the imageSize is calculated as: 77 ceil(width/4.0) * ceil(height/4.0) * 8.0 78 For PVRTC2 2BPP format the imageSize is calculated as: 79 ceil(width/8.0) * ceil(height/4.0) * 8.0 80 81 5) Note some early 1.9 SGX drivers will return INVALID_VALUE if the width 82 or height is not a multiple of the block size. 83 84New Procedures and Functions 85 86 None. 87 88New Tokens 89 90 Accepted by the <internalformat> parameter of CompressedTexImage2D 91 and the <format> parameter of CompressedTexSubImage2D: 92 93 COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 94 COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 95 96Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation) 97 98 None. 99 100Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 101 102 Add Table 3.8.1: Specific Compressed Internal Formats 103 104 Compressed Internal Format Base Internal Format 105 ========================== ==================== 106 COMPRESSED_RGBA_PVRTC_2BPPV2_IMG RGBA 107 COMPRESSED_RGBA_PVRTC_4BPPV2_IMG RGBA 108 109 110 Modify Section 3.7.3, Compressed Texture Images 111 112 Add to Section 3.7.3, Compressed Texture Images (adding to the end of 113 the CompressedTexImage section) 114 115 If <internalformat> is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or 116 COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, the compressed texture is stored using 117 one of the PVRTC2 compressed texture image formats. The PVRTC2 118 texture compression algorithm supports only 2D images without borders. 119 CompressedTexImage2DARB will produce an INVALID_OPERATION if <border> is 120 non-zero. 121 122 Add to Section 3.7.3, Compressed Texture Images (adding to the end of 123 the CompressedTexSubImage section) 124 125 If the internal format of the texture image being modified is 126 COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, the 127 texture is stored using one of the PVRTC2 compressed texture image 128 formats. CompressedTexSubImage2D results in an INVALID_OPERATION error 129 if internal format is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG and one of the 130 following conditions occurs: 131 132 * <xoffset> is not a multiple of eight. 133 * <yoffset> is not a multiple of four. 134 * <width> is not a multiple of eight, except when the sum of <width> 135 and <xoffset> is equal to TEXTURE_WIDTH. 136 * <height> is not a multiple of four, except when the sum of <height> 137 and <yoffset> is equal to TEXTURE_HEIGHT. 138 139 or if internal format is COMPRESSED_RGBA_PVRTC_4BPPV2_IMG and one of the 140 following conditions occurs: 141 142 * <xoffset> is not a multiple of four. 143 * <yoffset> is not a multiple of four. 144 * <width> is not a multiple of four, except when the sum of <width> 145 and <xoffset> is equal to TEXTURE_WIDTH. 146 * <height> is not a multiple of four, except when the sum of <height> 147 and <yoffset> is equal to TEXTURE_HEIGHT. 148 149Additions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 150Operations and the Frame Buffer) 151 152 None. 153 154Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions) 155 156 None. 157 158Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and 159State Requests) 160 161 The queries for NUM_COMPRESSED_TEXTURE_FORMATS and 162 COMPRESSED_TEXTURE_FORMATS include COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 163 and COMPRESSED_RGBA_PVRTC_4BPPV2_IMG. 164 165Errors 166 167 INVALID_OPERATION is generated by CompressedTexImage2D if 168 <internalformat> is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG or 169 COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, and <border> is not equal to zero. 170 171 INVALID_OPERATION is generated by CompressedTexSubImage2D if 172 INTERNAL_FORMAT is COMPRESSED_RGBA_PVRTC_2BPPV2_IMG and 173 any of the following apply: 174 175 * <xoffset> is not a multiple of eight. 176 * <yoffset> is not a multiple of four. 177 * <width> is not a multiple of eight, except when the sum of <width> 178 and <xoffset> is equal to TEXTURE_WIDTH. 179 * <height> is not a multiple of four, except when the sum of <height> 180 and <yoffset> is equal to TEXTURE_HEIGHT. 181 * <format> does not match the internal format of the texture image 182 being modified. 183 184 INVALID_OPERATION is generated by CompressedTexSubImage2D if 185 INTERNAL_FORMAT is COMPRESSED_RGBA_PVRTC_4BPPV2_IMG and 186 any of the following apply: 187 188 * <xoffset> is not a multiple of four. 189 * <yoffset> is not a multiple of four. 190 * <width> is not a multiple of four, except when the sum of <width> 191 and <xoffset> is equal to TEXTURE_WIDTH. 192 * <height> is not a multiple of four, except when the sum of <height> 193 and <yoffset> is equal to TEXTURE_HEIGHT. 194 * <format> does not match the internal format of the texture image 195 being modified. 196 197New State 198 199 None. 200 201Revision History 202 203 0.9, 19/12/2012 tjh: Updated error conditions for subtexturing at the 204 edge of an NPOT texture. 205 0.8, 08/08/2012 bcb: Final tidy up 206 0.7, 24/11/2011 bcb: Added NPOT back. 207 0.6, 03/08/2011 bcb: Added enumerants + further issues 208 0.5, 03/08/2011 bcb: Update from DevTech feedback. 209 0.4, 03/08/2011 bcb: Update issues list from GeorgK feedback. 210 0.3, 02/08/2011 bcb: Update issues list from GrahamC feedback. 211 0.2, 01/07/2011 bcb: Remove NPOT support. 212 0.1, 30/06/2011 bcb: Initial revision. 213 214 215