| 1 | <?xml version="1.0"?> |
| 2 | |
| 3 | <extension href="WEBGL_compressed_texture_astc/"> |
| 4 | <name>WEBGL_compressed_texture_astc</name> |
| 5 | <contact> |
| 6 | <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org) |
| 7 | </contact> |
| 8 | <contributors> |
| 9 | <contributor>Christophe Riccio, Unity</contributor> |
| 10 | <contributor>Members of the WebGL working group</contributor> |
| 11 | </contributors> |
| 12 | <number>30</number> |
| 13 | <depends> |
| 14 | <api version="1.0"/> |
| 15 | </depends> |
| 16 | <overview> |
| 17 | <p> |
| 18 | This extension exposes the compressed texture format defined in the |
| 19 | <a href="https://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt"> |
| 20 | KHR_texture_compression_astc_hdr</a> OpenGL ES extension to WebGL. Consult that extension |
| 21 | specification for behavioral definitions, including error behaviors. |
| 22 | </p> |
| 23 | <p> |
| 24 | ASTC textures may be encoded using either high or low dynamic range, corresponding to an "HDR |
| 25 | profile" and "LDR profile". The compression format is designed to be extended, and for new |
| 26 | profiles to be added in the future. For this reason, enabling the WebGL extension enables all |
| 27 | of the profiles supported by the implementation. The supported profiles may be queried by |
| 28 | calling <code>getSupportedProfiles</code> against the extension object. |
| 29 | </p> |
| 30 | <features> |
| 31 | <feature> |
| 32 | Compression format <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>, |
| 33 | <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>, |
| 34 | <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>, |
| 35 | <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>, |
| 36 | <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>, |
| 37 | <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>, |
| 38 | <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>, |
| 39 | <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>, |
| 40 | <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>, |
| 41 | <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>, |
| 42 | <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>, |
| 43 | <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>, |
| 44 | <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>, |
| 45 | <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>, |
| 46 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>, |
| 47 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>, |
| 48 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>, |
| 49 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>, |
| 50 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>, |
| 51 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>, |
| 52 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>, |
| 53 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>, |
| 54 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>, |
| 55 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>, |
| 56 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>, |
| 57 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>, |
| 58 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>, |
| 59 | and <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code> may be passed to |
| 60 | the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points. |
| 61 | </feature> |
| 62 | <feature> |
| 63 | Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code> |
| 64 | will include the format from this specification. |
| 65 | </feature> |
| 66 | <feature> |
| 67 | <p>The following format-specific restrictions must be enforced:</p> |
| 68 | <dl> |
| 69 | <dt>COMPRESSED_RGBA_ASTC_4x4_KHR</dt> |
| 70 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</dt> |
| 71 | <dd> |
| 72 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 73 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 74 | equal to the following number of bytes: |
| 75 | </p> |
| 76 | <blockquote><code> |
| 77 | floor((width + 3) / 4) * floor((height + 3) / 4) * 16 |
| 78 | </code></blockquote> |
| 79 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 80 | </dd> |
| 81 | </dl> |
| 82 | </feature> |
| 83 | <feature> |
| 84 | <p>The following format-specific restrictions must be enforced:</p> |
| 85 | <dl> |
| 86 | <dt>COMPRESSED_RGBA_ASTC_5x4_KHR</dt> |
| 87 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</dt> |
| 88 | <dd> |
| 89 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 90 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 91 | equal to the following number of bytes: |
| 92 | </p> |
| 93 | <blockquote><code> |
| 94 | floor((width + 4) / 5) * floor((height + 3) / 4) * 16 |
| 95 | </code></blockquote> |
| 96 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 97 | </dd> |
| 98 | </dl> |
| 99 | </feature> |
| 100 | <feature> |
| 101 | <p>The following format-specific restrictions must be enforced:</p> |
| 102 | <dl> |
| 103 | <dt>COMPRESSED_RGBA_ASTC_5x5_KHR</dt> |
| 104 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</dt> |
| 105 | <dd> |
| 106 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 107 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 108 | equal to the following number of bytes: |
| 109 | </p> |
| 110 | <blockquote><code> |
| 111 | floor((width + 4) / 5) * floor((height + 4) / 5) * 16 |
| 112 | </code></blockquote> |
| 113 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 114 | </dd> |
| 115 | </dl> |
| 116 | </feature> |
| 117 | <feature> |
| 118 | <p>The following format-specific restrictions must be enforced:</p> |
| 119 | <dl> |
| 120 | <dt>COMPRESSED_RGBA_ASTC_6x5_KHR</dt> |
| 121 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</dt> |
| 122 | <dd> |
| 123 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 124 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 125 | equal to the following number of bytes: |
| 126 | </p> |
| 127 | <blockquote><code> |
| 128 | floor((width + 5) / 6) * floor((height + 4) / 5) * 16 |
| 129 | </code></blockquote> |
| 130 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 131 | </dd> |
| 132 | </dl> |
| 133 | </feature> |
| 134 | <feature> |
| 135 | <p>The following format-specific restrictions must be enforced:</p> |
| 136 | <dl> |
| 137 | <dt>COMPRESSED_RGBA_ASTC_6x6_KHR</dt> |
| 138 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</dt> |
| 139 | <dd> |
| 140 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 141 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 142 | equal to the following number of bytes: |
| 143 | </p> |
| 144 | <blockquote><code> |
| 145 | floor((width + 5) / 6) * floor((height + 5) / 6) * 16 |
| 146 | </code></blockquote> |
| 147 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 148 | </dd> |
| 149 | </dl> |
| 150 | </feature> |
| 151 | <feature> |
| 152 | <p>The following format-specific restrictions must be enforced:</p> |
| 153 | <dl> |
| 154 | <dt>COMPRESSED_RGBA_ASTC_8x5_KHR</dt> |
| 155 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</dt> |
| 156 | <dd> |
| 157 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 158 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 159 | equal to the following number of bytes: |
| 160 | </p> |
| 161 | <blockquote><code> |
| 162 | floor((width + 7) / 8) * floor((height + 4) / 5) * 16 |
| 163 | </code></blockquote> |
| 164 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 165 | </dd> |
| 166 | </dl> |
| 167 | </feature> |
| 168 | <feature> |
| 169 | <p>The following format-specific restrictions must be enforced:</p> |
| 170 | <dl> |
| 171 | <dt>COMPRESSED_RGBA_ASTC_8x6_KHR</dt> |
| 172 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</dt> |
| 173 | <dd> |
| 174 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 175 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 176 | equal to the following number of bytes: |
| 177 | </p> |
| 178 | <blockquote><code> |
| 179 | floor((width + 7) / 8) * floor((height + 5) / 6) * 16 |
| 180 | </code></blockquote> |
| 181 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 182 | </dd> |
| 183 | </dl> |
| 184 | </feature> |
| 185 | <feature> |
| 186 | <p>The following format-specific restrictions must be enforced:</p> |
| 187 | <dl> |
| 188 | <dt>COMPRESSED_RGBA_ASTC_8x8_KHR</dt> |
| 189 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</dt> |
| 190 | <dd> |
| 191 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 192 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 193 | equal to the following number of bytes: |
| 194 | </p> |
| 195 | <blockquote><code> |
| 196 | floor((width + 7) / 8) * floor((height + 7) / 8) * 16 |
| 197 | </code></blockquote> |
| 198 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 199 | </dd> |
| 200 | </dl> |
| 201 | </feature> |
| 202 | <feature> |
| 203 | <p>The following format-specific restrictions must be enforced:</p> |
| 204 | <dl> |
| 205 | <dt>COMPRESSED_RGBA_ASTC_10x5_KHR</dt> |
| 206 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</dt> |
| 207 | <dd> |
| 208 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 209 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 210 | equal to the following number of bytes: |
| 211 | </p> |
| 212 | <blockquote><code> |
| 213 | floor((width + 9) / 10) * floor((height + 4) / 5) * 16 |
| 214 | </code></blockquote> |
| 215 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 216 | </dd> |
| 217 | </dl> |
| 218 | </feature> |
| 219 | <feature> |
| 220 | <p>The following format-specific restrictions must be enforced:</p> |
| 221 | <dl> |
| 222 | <dt>COMPRESSED_RGBA_ASTC_10x6_KHR</dt> |
| 223 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</dt> |
| 224 | <dd> |
| 225 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 226 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 227 | equal to the following number of bytes: |
| 228 | </p> |
| 229 | <blockquote><code> |
| 230 | floor((width + 9) / 10) * floor((height + 5) / 6) * 16 |
| 231 | </code></blockquote> |
| 232 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 233 | </dd> |
| 234 | </dl> |
| 235 | </feature> |
| 236 | <feature> |
| 237 | <p>The following format-specific restrictions must be enforced:</p> |
| 238 | <dl> |
| 239 | <dt>COMPRESSED_RGBA_ASTC_10x8_KHR</dt> |
| 240 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</dt> |
| 241 | <dd> |
| 242 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 243 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 244 | equal to the following number of bytes: |
| 245 | </p> |
| 246 | <blockquote><code> |
| 247 | floor((width + 9) / 10) * floor((height + 7) / 8) * 16 |
| 248 | </code></blockquote> |
| 249 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 250 | </dd> |
| 251 | </dl> |
| 252 | </feature> |
| 253 | <feature> |
| 254 | <p>The following format-specific restrictions must be enforced:</p> |
| 255 | <dl> |
| 256 | <dt>COMPRESSED_RGBA_ASTC_10x10_KHR</dt> |
| 257 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</dt> |
| 258 | <dd> |
| 259 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 260 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 261 | equal to the following number of bytes: |
| 262 | </p> |
| 263 | <blockquote><code> |
| 264 | floor((width + 9) / 10) * floor((height + 9) / 10) * 16 |
| 265 | </code></blockquote> |
| 266 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 267 | </dd> |
| 268 | </dl> |
| 269 | </feature> |
| 270 | <feature> |
| 271 | <p>The following format-specific restrictions must be enforced:</p> |
| 272 | <dl> |
| 273 | <dt>COMPRESSED_RGBA_ASTC_12x10_KHR</dt> |
| 274 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</dt> |
| 275 | <dd> |
| 276 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 277 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 278 | equal to the following number of bytes: |
| 279 | </p> |
| 280 | <blockquote><code> |
| 281 | floor((width + 11) / 12) * floor((height + 9) / 10) * 16 |
| 282 | </code></blockquote> |
| 283 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 284 | </dd> |
| 285 | </dl> |
| 286 | </feature> |
| 287 | <feature> |
| 288 | <p>The following format-specific restrictions must be enforced:</p> |
| 289 | <dl> |
| 290 | <dt>COMPRESSED_RGBA_ASTC_12x12_KHR</dt> |
| 291 | <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</dt> |
| 292 | <dd> |
| 293 | <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to |
| 294 | <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be |
| 295 | equal to the following number of bytes: |
| 296 | </p> |
| 297 | <blockquote><code> |
| 298 | floor((width + 11) / 12) * floor((height + 11) / 12) * 16 |
| 299 | </code></blockquote> |
| 300 | <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p> |
| 301 | </dd> |
| 302 | </dl> |
| 303 | </feature> |
| 304 | </features> |
| 305 | </overview> |
| 306 | <idl xml:space="preserve"> |
| 307 | [NoInterfaceObject] |
| 308 | interface WEBGL_compressed_texture_astc { |
| 309 | /* Compressed Texture Format */ |
| 310 | const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; |
| 311 | const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; |
| 312 | const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; |
| 313 | const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; |
| 314 | const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; |
| 315 | const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; |
| 316 | const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; |
| 317 | const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; |
| 318 | const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; |
| 319 | const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; |
| 320 | const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; |
| 321 | const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; |
| 322 | const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; |
| 323 | const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; |
| 324 | |
| 325 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; |
| 326 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; |
| 327 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; |
| 328 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; |
| 329 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; |
| 330 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; |
| 331 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; |
| 332 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; |
| 333 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; |
| 334 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; |
| 335 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; |
| 336 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; |
| 337 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; |
| 338 | const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; |
| 339 | |
| 340 | // Profile query support. |
| 341 | sequence<DOMString> getSupportedProfiles(); |
| 342 | }; |
| 343 | </idl> |
| 344 | |
| 345 | <newfun> |
| 346 | <function name="getSupportedProfiles" type="sequence<DOMString>"> |
| 347 | Returns the names of the ASTC profiles supported by the implementation. As of this writing, |
| 348 | valid return values will include "ldr", corresponding to the |
| 349 | GL_KHR_texture_compression_astc_ldr extension string; and "hdr", corresponding to the |
| 350 | GL_KHR_texture_compression_astc_hdr extension string. More profiles may be added in the |
| 351 | future. |
| 352 | </function> |
| 353 | <div class="note"> |
| 354 | The intent of the <code>getSupportedProfiles</code> function is to allow easy reconstruction |
| 355 | of the underlying OpenGL or OpenGL ES extension strings for environments like Emscripten, by |
| 356 | prepending the string <code>GL_KHR_texture_compression_astc_</code> to the returned profile |
| 357 | names. |
| 358 | </div> |
| 359 | </newfun> |
| 360 | |
| 361 | <newtok> |
| 362 | <function name="compressedTexImage2D"> |
| 363 | <param name="internalformat" type="GLenum"/> |
| 364 | Accepted by the <code>internalformat</code> parameter: |
| 365 | <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>, |
| 366 | <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>, |
| 367 | <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>, |
| 368 | <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>, |
| 369 | <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>, |
| 370 | <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>, |
| 371 | <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>, |
| 372 | <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>, |
| 373 | <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>, |
| 374 | <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>, |
| 375 | <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>, |
| 376 | <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>, |
| 377 | <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>, |
| 378 | <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>, |
| 379 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>, |
| 380 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>, |
| 381 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>, |
| 382 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>, |
| 383 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>, |
| 384 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>, |
| 385 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>, |
| 386 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>, |
| 387 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>, |
| 388 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>, |
| 389 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>, |
| 390 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>, |
| 391 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>, |
| 392 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code> |
| 393 | <br/> |
| 394 | </function> |
| 395 | |
| 396 | <function name="compressedTexSubImage2D"> |
| 397 | <param name="internalformat" type="GLenum"/> |
| 398 | Accepted by the <code>internalformat</code> parameter: |
| 399 | <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>, |
| 400 | <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>, |
| 401 | <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>, |
| 402 | <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>, |
| 403 | <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>, |
| 404 | <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>, |
| 405 | <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>, |
| 406 | <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>, |
| 407 | <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>, |
| 408 | <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>, |
| 409 | <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>, |
| 410 | <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>, |
| 411 | <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>, |
| 412 | <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>, |
| 413 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>, |
| 414 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>, |
| 415 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>, |
| 416 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>, |
| 417 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>, |
| 418 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>, |
| 419 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>, |
| 420 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>, |
| 421 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>, |
| 422 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>, |
| 423 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>, |
| 424 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>, |
| 425 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>, |
| 426 | <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code> |
| 427 | <br/> |
| 428 | </function> |
| 429 | </newtok> |
| 430 | |
| 431 | <errors> |
| 432 | <error enum="INVALID_VALUE"> |
| 433 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 434 | if the <code>internalformat</code> parameter is |
| 435 | <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code> |
| 436 | and the byteLength of the ArrayBufferView is not: |
| 437 | <blockquote><code> |
| 438 | floor((width + 3) / 4) * floor((height + 3) / 4) * 16 |
| 439 | </code></blockquote> |
| 440 | </error> |
| 441 | <error enum="INVALID_VALUE"> |
| 442 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 443 | if the <code>internalformat</code> parameter is |
| 444 | <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code> |
| 445 | and the byteLength of the ArrayBufferView is not: |
| 446 | <blockquote><code> |
| 447 | floor((width + 4) / 5) * floor((height + 3) / 4) * 16 |
| 448 | </code></blockquote> |
| 449 | </error> |
| 450 | <error enum="INVALID_VALUE"> |
| 451 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 452 | if the <code>internalformat</code> parameter is |
| 453 | <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code> |
| 454 | and the byteLength of the ArrayBufferView is not: |
| 455 | <blockquote><code> |
| 456 | floor((width + 4) / 5) * floor((height + 4) / 5) * 16 |
| 457 | </code></blockquote> |
| 458 | </error> |
| 459 | <error enum="INVALID_VALUE"> |
| 460 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 461 | if the <code>internalformat</code> parameter is |
| 462 | <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code> |
| 463 | and the byteLength of the ArrayBufferView is not: |
| 464 | <blockquote><code> |
| 465 | floor((width + 5) / 6) * floor((height + 4) / 5) * 16 |
| 466 | </code></blockquote> |
| 467 | </error> |
| 468 | <error enum="INVALID_VALUE"> |
| 469 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 470 | if the <code>internalformat</code> parameter is |
| 471 | <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code> |
| 472 | and the byteLength of the ArrayBufferView is not: |
| 473 | <blockquote><code> |
| 474 | floor((width + 5) / 6) * floor((height + 5) / 6) * 16 |
| 475 | </code></blockquote> |
| 476 | </error> |
| 477 | <error enum="INVALID_VALUE"> |
| 478 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 479 | if the <code>internalformat</code> parameter is |
| 480 | <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code> |
| 481 | and the byteLength of the ArrayBufferView is not: |
| 482 | <blockquote><code> |
| 483 | floor((width + 7) / 8) * floor((height + 4) / 5) * 16 |
| 484 | </code></blockquote> |
| 485 | </error> |
| 486 | <error enum="INVALID_VALUE"> |
| 487 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 488 | if the <code>internalformat</code> parameter is |
| 489 | <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code> |
| 490 | and the byteLength of the ArrayBufferView is not: |
| 491 | <blockquote><code> |
| 492 | floor((width + 7) / 8) * floor((height + 5) / 6) * 16 |
| 493 | </code></blockquote> |
| 494 | </error> |
| 495 | <error enum="INVALID_VALUE"> |
| 496 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 497 | if the <code>internalformat</code> parameter is |
| 498 | <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code> |
| 499 | and the byteLength of the ArrayBufferView is not: |
| 500 | <blockquote><code> |
| 501 | floor((width + 7) / 8) * floor((height + 7) / 8) * 16 |
| 502 | </code></blockquote> |
| 503 | </error> |
| 504 | <error enum="INVALID_VALUE"> |
| 505 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 506 | if the <code>internalformat</code> parameter is |
| 507 | <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code> |
| 508 | and the byteLength of the ArrayBufferView is not: |
| 509 | <blockquote><code> |
| 510 | floor((width + 9) / 10) * floor((height + 4) / 5) * 16 |
| 511 | </code></blockquote> |
| 512 | </error> |
| 513 | <error enum="INVALID_VALUE"> |
| 514 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 515 | if the <code>internalformat</code> parameter is |
| 516 | <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code> |
| 517 | and the byteLength of the ArrayBufferView is not: |
| 518 | <blockquote><code> |
| 519 | floor((width + 9) / 10) * floor((height + 5) / 6) * 16 |
| 520 | </code></blockquote> |
| 521 | </error> |
| 522 | <error enum="INVALID_VALUE"> |
| 523 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 524 | if the <code>internalformat</code> parameter is |
| 525 | <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code> |
| 526 | and the byteLength of the ArrayBufferView is not: |
| 527 | <blockquote><code> |
| 528 | floor((width + 9) / 10) * floor((height + 7) / 8) * 16 |
| 529 | </code></blockquote> |
| 530 | </error> |
| 531 | <error enum="INVALID_VALUE"> |
| 532 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 533 | if the <code>internalformat</code> parameter is |
| 534 | <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code> |
| 535 | and the byteLength of the ArrayBufferView is not: |
| 536 | <blockquote><code> |
| 537 | floor((width + 9) / 10) * floor((height + 9) / 10) * 16 |
| 538 | </code></blockquote> |
| 539 | </error> |
| 540 | <error enum="INVALID_VALUE"> |
| 541 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 542 | if the <code>internalformat</code> parameter is |
| 543 | <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code> |
| 544 | and the byteLength of the ArrayBufferView is not: |
| 545 | <blockquote><code> |
| 546 | floor((width + 11) / 12) * floor((height + 9) / 10) * 16 |
| 547 | </code></blockquote> |
| 548 | </error> |
| 549 | <error enum="INVALID_VALUE"> |
| 550 | The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> |
| 551 | if the <code>internalformat</code> parameter is |
| 552 | <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code> |
| 553 | and the byteLength of the ArrayBufferView is not: |
| 554 | <blockquote><code> |
| 555 | floor((width + 11) / 12) * floor((height + 11) / 12) * 16 |
| 556 | </code></blockquote> |
| 557 | </error> |
| 558 | </errors> |
| 559 | |
| 560 | <history> |
| 561 | <revision date="2015/03/10"> |
| 562 | <change>Initial revision.</change> |
| 563 | </revision> |
| 564 | <revision date="2015/08/07"> |
| 565 | <change>Added profile string support. Renamed constants back to _KHR.</change> |
| 566 | </revision> |
| 567 | <revision date="2015/08/10"> |
| 568 | <change>Clarified intent of getSupportedProfiles. Stressed that OpenGL ES extension defines the behavior.</change> |
| 569 | </revision> |
| 570 | <revision date="2015/08/10"> |
| 571 | <change>Moved to draft status.</change> |
| 572 | </revision> |
| 573 | <revision date="2016/12/12"> |
| 574 | <change>Moved to community approved after discussion on public_webgl list.</change> |
| 575 | </revision> |
| 576 | </history> |
| 577 | </extension> |