1Name 2 3 EXT_texture_view 4 5Name Strings 6 7 GL_EXT_texture_view 8 9Contact 10 11 Jon Leech (oddhack 'at' sonic.net) 12 Daniel Koch, NVIDIA (dkoch 'at' nvidia.com) 13 14Contributors 15 16 Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com) 17 Pat Brown, NVIDIA 18 Slawomir Grajewski, Intel 19 Jon Leech 20 21Notice 22 23 Copyright (c) 2012-2013 The Khronos Group Inc. Copyright terms at 24 http://www.khronos.org/registry/speccopyright.html 25 26 Portions Copyright (c) 2013-2014 NVIDIA Corporation. 27 28Status 29 30 Complete. 31 32Version 33 34 Last Modified Date: April 1, 2014 35 Revision: 8 36 37Number 38 39 OpenGL ES Extension #185 40 41Dependencies 42 43 OpenGL ES 3.1 and OpenGL ES Shading Language 3.10 are required. 44 45 This specification is written against the OpenGL ES 3.1 (March 17, 46 2014) and OpenGL ES 3.10 Shading Language (March 17, 2014) 47 Specifications. 48 49 EXT_texture_buffer affects the definition of this extension. 50 51 EXT_texture_cube_map_array affects the definition of this extension. 52 53 EXT_texture_compression_s3tc interacts with this extension. 54 55 EXT_texture_compression_rgtc interacts with this extension. 56 57 EXT_texture_compression_bptc interacts with this extension. 58 59 KHR_texture_compression_astc_ldr interacts with this extension. 60 61 KHR_texture_compression_astc_hdr interacts with this extension. 62 63 OES_texture_compression_astc interacts with this extension. 64 65Overview 66 67 This extension allows a texture's data store to be "viewed" in multiple 68 ways, either reinterpreting the data format/type as a different format/ 69 type with the same element size, or by clamping the mipmap level range 70 or array slice range. 71 72 The goals of this extension are to avoid having these alternate views 73 become shared mutable containers of shared mutable objects, and to add 74 the views to the API in a minimally invasive way. 75 76 No new object types are added. Conceptually, a texture object is split 77 into the following parts: 78 79 - A data store holding texel data. 80 - State describing which portions of the data store to use, and how 81 to interpret the data elements. 82 - An embedded sampler object. 83 - Various other texture parameters. 84 85 With this extension, multiple textures can share a data store and have 86 different state describing which portions of the data store to use and 87 how to interpret the data elements. The data store is refcounted and not 88 destroyed until the last texture sharing it is deleted. 89 90 This extension leverages the concept of an "immutable texture". 91 Views can only be created of textures created with TexStorage*. 92 93 94New Procedures and Functions 95 96 void TextureViewEXT(uint texture, enum target, uint origtexture, 97 enum internalformat, 98 uint minlevel, uint numlevels, 99 uint minlayer, uint numlayers); 100 101New Tokens 102 103 Accepted by the <pname> parameters of GetTexParameterfv and 104 GetTexParameteriv: 105 106 TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB 107 TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC 108 TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD 109 TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE 110 TEXTURE_IMMUTABLE_LEVELS 0x82DF 111 112 Used as compatibility class names in table 8.X.2: 113 114 VIEW_CLASS_128_BITS 115 VIEW_CLASS_96_BITS 116 VIEW_CLASS_64_BITS 117 VIEW_CLASS_48_BITS 118 VIEW_CLASS_32_BITS 119 VIEW_CLASS_24_BITS 120 VIEW_CLASS_16_BITS 121 VIEW_CLASS_8_BITS 122 VIEW_CLASS_RGTC1_RED 123 VIEW_CLASS_RGTC2_RG 124 VIEW_CLASS_BPTC_UNORM 125 VIEW_CLASS_BPTC_FLOAT 126 VIEW_CLASS_S3TC_DXT1_RGB 127 VIEW_CLASS_S3TC_DXT1_RGBA 128 VIEW_CLASS_S3TC_DXT3_RGBA 129 VIEW_CLASS_S3TC_DXT5_RGBA 130 VIEW_CLASS_EAC_R11 131 VIEW_CLASS_EAC_RG11 132 VIEW_CLASS_ETC2_RGB 133 VIEW_CLASS_ETC2_RGBA 134 VIEW_CLASS_ETC2_EAC_RGBA 135 VIEW_CLASS_ASTC_4x4_RGBA 136 VIEW_CLASS_ASTC_5x4_RGBA 137 VIEW_CLASS_ASTC_5x5_RGBA 138 VIEW_CLASS_ASTC_6x5_RGBA 139 VIEW_CLASS_ASTC_6x6_RGBA 140 VIEW_CLASS_ASTC_8x5_RGBA 141 VIEW_CLASS_ASTC_8x6_RGBA 142 VIEW_CLASS_ASTC_8x8_RGBA 143 VIEW_CLASS_ASTC_10x5_RGBA 144 VIEW_CLASS_ASTC_10x6_RGBA 145 VIEW_CLASS_ASTC_10x8_RGBA 146 VIEW_CLASS_ASTC_10x10_RGBA 147 VIEW_CLASS_ASTC_12x10_RGBA 148 VIEW_CLASS_ASTC_12x12_RGBA 149 VIEW_CLASS_ASTC_3x3x3_RGBA 150 VIEW_CLASS_ASTC_4x3x3_RGBA 151 VIEW_CLASS_ASTC_4x4x3_RGBA 152 VIEW_CLASS_ASTC_4x4x4_RGBA 153 VIEW_CLASS_ASTC_5x4x4_RGBA 154 VIEW_CLASS_ASTC_5x5x4_RGBA 155 VIEW_CLASS_ASTC_5x5x5_RGBA 156 VIEW_CLASS_ASTC_6x5x5_RGBA 157 VIEW_CLASS_ASTC_6x6x5_RGBA 158 VIEW_CLASS_ASTC_6x6x6_RGBA 159 (The VIEW_CLASS_* tokens used as compatibility class names in table 160 8.X.2 are the same tokens returned by the VIEW_COMPATIBILITY_CLASS query 161 in ARB_internalformat_query2. In this extension they are simply a 162 labelling mechanism and serve no functional purpose in the API, so their 163 numeric values are not specified.) 164 165Additions to the OpenGL ES 3.1 Specification 166 167 Modify section 5.3, "Propagating Changes to Objects" 168 169 Add to the paragraph starting "When <T> is a texture, the contents ..." 170 on p. 44: 171 172 When <T> is a texture, the contents of <T> are construed to include the 173 contents of the data store of <T>, even if <T>'s data store was modified 174 via a different view of the data store. 175 176 177 Modify subsection 8.9, "Texture Parameters" 178 179 Add the following to the end of the paragraph on p. 171 starting 180 "In the remainder of chapter 8, denote by lod_min...": 181 182 If the texture was created with TextureViewEXT, then the 183 TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL parameters are interpreted 184 relative to the view and not relative to the original data store. 185 186 187 Modify section 8.10.2, "Texture Parameter Queries" 188 189 Add to the list of legal <pname>s in the description of GetTexParameter 190 on p. 172: 191 192 ... <pname> must be IMAGE_FORMAT_COMPATIBILITY_TYPE, 193 TEXTURE_IMMUTABLE_FORMAT, TEXTURE_IMMUTABLE_LEVELS, 194 TEXTURE_VIEW_MIN_LEVEL_EXT, TEXTURE_VIEW_NUM_LEVELS_EXT, 195 TEXTURE_VIEW_MIN_LAYER_EXT, TEXTURE_VIEW_NUM_LAYERS_EXT, or one of the 196 symbolic values in table 8.20. 197 198 199 Add a new subsection 8.16view following section 8.16, "Texture Completeness" 200 201 8.16view Texture Views 202 203 A texture can be created which references the data store of another 204 texture and interprets the data with a different format, and/or selects 205 a subset of the levels and/or layers of the other texture. The data 206 store for such a texture is shared with the data store of the original 207 texture. Updating the shared data store using the original texture 208 affects texture values read using the new texture, and vice versa. A 209 texture data store remains in existence until all textures that 210 reference it are deleted. 211 212 The command: 213 214 void TextureViewEXT(uint texture, enum target, uint origtexture, 215 enum internalformat, 216 uint minlevel, uint numlevels, 217 uint minlayer, uint numlayers); 218 219 initializes the texture named <texture> to the target specified by 220 <target>. <texture>'s data store is inherited from the texture named 221 <origtexture>, but elements of the data store are interpreted according 222 to the internal format specified by <internalformat>. Additionally, if the 223 original texture is an array or has multiple mipmap levels, the parameters 224 <minlayer>, <numlayers>, <minlevel>, and <numlevels> control which of those 225 slices and levels are considered part of the texture. 226 227 The <minlevel> and <minlayer> parameters are relative to the view of the 228 original texture. If <numlayers> or <numlevels> extend beyond the 229 original texture, they are clamped to the max extent of the original 230 texture. 231 232 If the command is successful, the texture parameters in <texture> are 233 updated as follows: 234 235 - TEXTURE_IMMUTABLE_FORMAT is set to TRUE. 236 237 - TEXTURE_IMMUTABLE_LEVELS is set to the value of 238 TEXTURE_IMMUTABLE_LEVELS for <origtexture>. 239 240 - TEXTURE_VIEW_MIN_LEVEL_EXT is set to <minlevel> plus the value of 241 TEXTURE_VIEW_MIN_LEVEL_EXT for <origtexture>. 242 243 - TEXTURE_VIEW_MIN_LAYER_EXT is set to <minlayer> plus the value of 244 TEXTURE_VIEW_MIN_LAYER_EXT for <origtexture>. 245 246 - TEXTURE_VIEW_NUM_LEVELS_EXT is set to the lesser of <numlevels> and 247 the value of TEXTURE_VIEW_NUM_LEVELS_EXT for <origtexture> minus 248 <minlevels>. 249 250 - TEXTURE_VIEW_NUM_LAYERS_EXT is set to the lesser of <numlayers> and 251 the value of TEXTURE_VIEW_NUM_LAYERS_EXT for <origtexture> minus 252 <minlayer>. 253 254 The new texture's target must be <compatible> with the target of 255 <origtexture>, as defined by table 8.X.1. 256 257 Numerous constraints on <numlayers> and the texture dimensions depend on 258 <target> and the target of <origtexture>. These constraints are 259 summarized below in the errors section. 260 261 -------------------------------------------------------------------------------------------- 262 | Original target | Valid new targets | 263 |------------------------------------------------------------------------------------------| 264 | TEXTURE_2D | TEXTURE_2D, TEXTURE_2D_ARRAY | 265 |------------------------------------------------------------------------------------------| 266 | TEXTURE_3D | TEXTURE_3D | 267 |------------------------------------------------------------------------------------------| 268 | TEXTURE_CUBE_MAP | TEXTURE_CUBE_MAP, TEXTURE_2D, TEXTURE_2D_ARRAY, | 269 | | TEXTURE_CUBE_MAP_ARRAY_EXT | 270 |------------------------------------------------------------------------------------------| 271 | TEXTURE_BUFFER_EXT | <none> | 272 |------------------------------------------------------------------------------------------| 273 | TEXTURE_2D_ARRAY | TEXTURE_2D_ARRAY, TEXTURE_2D, TEXTURE_CUBE_MAP, | 274 | | TEXTURE_CUBE_MAP_ARRAY_EXT | 275 |------------------------------------------------------------------------------------------| 276 | TEXTURE_CUBE_MAP_ARRAY | TEXTURE_CUBE_MAP_ARRAY_EXT, TEXTURE_2D_ARRAY, TEXTURE_2D, | 277 | | TEXTURE_CUBE_MAP | 278 |------------------------------------------------------------------------------------------| 279 | TEXTURE_2D_MULTISAMPLE | TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY | 280 |------------------------------------------------------------------------------------------| 281 | TEXTURE_2D_MULTISAMPLE_ARRAY| TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY | 282 -------------------------------------------------------------------------------------------- 283 284 Table 8.X.1: Legal texture targets for TextureViewEXT. 285 286 When <origtexture>'s target is TEXTURE_CUBE_MAP, the layer parameters 287 are interpreted in the same order as if it were a 288 TEXTURE_CUBE_MAP_ARRAY_EXT with 6 layer-faces. 289 290 The two textures' internal formats must be compatible according to Table 291 8.X.2 (Compatible internal formats for TextureViewEXT) if the internal 292 format exists in that table. The internal formats must be identical if 293 not in that table. 294 295 -------------------------------------------------------------------------- 296 | Class | Internal formats | 297 -------------------------------------------------------------------------- 298 | VIEW_CLASS_128_BITS | RGBA32F, RGBA32UI, RGBA32I | 299 -------------------------------------------------------------------------- 300 | VIEW_CLASS_96_BITS | RGB32F, RGB32UI, RGB32I | 301 -------------------------------------------------------------------------- 302 | VIEW_CLASS_64_BITS | RGBA16F, RG32F, RGBA16UI, RG32UI, | 303 | | RGBA16I, RG32I | 304 -------------------------------------------------------------------------- 305 | VIEW_CLASS_48_BITS | RGB16F, RGB16UI, RGB16I | 306 -------------------------------------------------------------------------- 307 | VIEW_CLASS_32_BITS | RG16F, R11F_G11F_B10F, R32F, | 308 | | RGB10_A2UI, RGBA8UI, RG16UI, R32UI, | 309 | | RGBA8I, RG16I, R32I, RGB10_A2, RGBA8, | 310 | | RGBA8_SNORM, SRGB8_ALPHA8, RGB9_E5 | 311 ------------------------------------------------------------------------- 312 | VIEW_CLASS_24_BITS | RGB8, RGB8_SNORM, SRGB8, RGB8UI, RGB8I | 313 -------------------------------------------------------------------------- 314 | VIEW_CLASS_16_BITS | R16F, RG8UI, R16UI, RG8I, R16I, RG8, | 315 | | RG8_SNORM | 316 -------------------------------------------------------------------------- 317 | VIEW_CLASS_8_BITS | R8UI, R8I, R8, R8_SNORM | 318 -------------------------------------------------------------------------- 319 | VIEW_CLASS_RGTC1_RED | COMPRESSED_RED_RGTC1_EXT, | 320 | | COMPRESSED_SIGNED_RED_RGTC1_EXT | 321 -------------------------------------------------------------------------- 322 | VIEW_CLASS_RGTC2_RG | COMPRESSED_RG_RGTC2_EXT, | 323 | | COMPRESSED_SIGNED_RG_RGTC2_EXT | 324 -------------------------------------------------------------------------- 325 | VIEW_CLASS_BPTC_UNORM | COMPRESSED_RGBA_BPTC_UNORM_EXT, | 326 | | COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT | 327 -------------------------------------------------------------------------- 328 | VIEW_CLASS_BPTC_FLOAT | COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, | 329 | | COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT | 330 -------------------------------------------------------------------------- 331 | VIEW_CLASS_S3TC_DXT1_RGB | COMPRESSED_RGB_S3TC_DXT1_EXT, | 332 | | COMPRESSED_SRGB_S3TC_DXT1_EXT | 333 -------------------------------------------------------------------------- 334 | VIEW_CLASS_S3TC_DXT1_RGBA | COMPRESSED_RGBA_S3TC_DXT1_EXT, | 335 | | COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT | 336 -------------------------------------------------------------------------- 337 | VIEW_CLASS_S3TC_DXT3_RGBA | COMPRESSED_RGBA_S3TC_DXT3_EXT, | 338 | | COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT | 339 -------------------------------------------------------------------------- 340 | VIEW_CLASS_S3TC_DXT5_RGBA | COMPRESSED_RGBA_S3TC_DXT5_EXT, | 341 | | COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT | 342 -------------------------------------------------------------------------- 343 | VIEW_CLASS_EAC_R11 | COMPRESSED_R11_EAC, | 344 | | COMPRESSED_SIGNED_R11_EAC | 345 -------------------------------------------------------------------------- 346 | VIEW_CLASS_EAC_RG11 | COMPRESSED_RG11_EAC, | 347 | | COMPRESSED_SIGNED_RG11_EAC | 348 -------------------------------------------------------------------------- 349 | VIEW_CLASS_ETC2_RGB | COMPRESSED_RGB8_ETC2, | 350 | | COMPRESSED_SRGB8_ETC2 | 351 -------------------------------------------------------------------------- 352 | VIEW_CLASS_ETC2_RGBA | COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, | 353 | | COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 | 354 -------------------------------------------------------------------------- 355 | VIEW_CLASS_ETC2_EAC_RGBA | COMPRESSED_RGBA8_ETC2_EAC, | 356 | | COMPRESSED_SRGB8_ALPHA8_ETC2_EAC | 357 -------------------------------------------------------------------------- 358 | VIEW_CLASS_ASTC_4x4_RGBA | COMPRESSED_RGBA_ASTC_4x4_KHR, | 359 | | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR | 360 -------------------------------------------------------------------------- 361 | VIEW_CLASS_ASTC_5x4_RGBA | COMPRESSED_RGBA_ASTC_5x4_KHR, | 362 | | COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR | 363 -------------------------------------------------------------------------- 364 | VIEW_CLASS_ASTC_5x5_RGBA | COMPRESSED_RGBA_ASTC_5x5_KHR, | 365 | | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR | 366 -------------------------------------------------------------------------- 367 | VIEW_CLASS_ASTC_6x5_RGBA | COMPRESSED_RGBA_ASTC_6x5_KHR, | 368 | | COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR | 369 -------------------------------------------------------------------------- 370 | VIEW_CLASS_ASTC_6x6_RGBA | COMPRESSED_RGBA_ASTC_6x6_KHR, | 371 | | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR | 372 -------------------------------------------------------------------------- 373 | VIEW_CLASS_ASTC_8x5_RGBA | COMPRESSED_RGBA_ASTC_8x5_KHR, | 374 | | COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR | 375 -------------------------------------------------------------------------- 376 | VIEW_CLASS_ASTC_8x6_RGBA | COMPRESSED_RGBA_ASTC_8x6_KHR, | 377 | | COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR | 378 -------------------------------------------------------------------------- 379 | VIEW_CLASS_ASTC_8x8_RGBA | COMPRESSED_RGBA_ASTC_8x8_KHR, | 380 | | COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR | 381 -------------------------------------------------------------------------- 382 | VIEW_CLASS_ASTC_10x5_RGBA | COMPRESSED_RGBA_ASTC_10x5_KHR, | 383 | | COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR | 384 -------------------------------------------------------------------------- 385 | VIEW_CLASS_ASTC_10x6_RGBA | COMPRESSED_RGBA_ASTC_10x6_KHR, | 386 | | COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR | 387 -------------------------------------------------------------------------- 388 | VIEW_CLASS_ASTC_10x8_RGBA | COMPRESSED_RGBA_ASTC_10x8_KHR, | 389 | | COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR | 390 -------------------------------------------------------------------------- 391 | VIEW_CLASS_ASTC_10x10_RGBA | COMPRESSED_RGBA_ASTC_10x10_KHR, | 392 | | COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR | 393 -------------------------------------------------------------------------- 394 | VIEW_CLASS_ASTC_12x10_RGBA | COMPRESSED_RGBA_ASTC_12x10_KHR, | 395 | | COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR | 396 -------------------------------------------------------------------------- 397 | VIEW_CLASS_ASTC_12x12_RGBA | COMPRESSED_RGBA_ASTC_12x12_KHR, | 398 | | COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR | 399 -------------------------------------------------------------------------- 400 | VIEW_CLASS_ASTC_3x3x3_RGBA | COMPRESSED_RGBA_ASTC_3x3x3_OES, | 401 | | COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES | 402 -------------------------------------------------------------------------- 403 | VIEW_CLASS_ASTC_4x3x3_RGBA | COMPRESSED_RGBA_ASTC_4x3x3_OES, | 404 | | COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES | 405 -------------------------------------------------------------------------- 406 | VIEW_CLASS_ASTC_4x4x3_RGBA | COMPRESSED_RGBA_ASTC_4x4x3_OES, | 407 | | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES | 408 -------------------------------------------------------------------------- 409 | VIEW_CLASS_ASTC_4x4x4_RGBA | COMPRESSED_RGBA_ASTC_4x4x4_OES, | 410 | | COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES | 411 -------------------------------------------------------------------------- 412 | VIEW_CLASS_ASTC_5x4x4_RGBA | COMPRESSED_RGBA_ASTC_5x4x4_OES, | 413 | | COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES | 414 -------------------------------------------------------------------------- 415 | VIEW_CLASS_ASTC_5x5x4_RGBA | COMPRESSED_RGBA_ASTC_5x5x4_OES, | 416 | | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES | 417 -------------------------------------------------------------------------- 418 | VIEW_CLASS_ASTC_5x5x5_RGBA | COMPRESSED_RGBA_ASTC_5x5x5_OES, | 419 | | COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES | 420 -------------------------------------------------------------------------- 421 | VIEW_CLASS_ASTC_6x5x5_RGBA | COMPRESSED_RGBA_ASTC_6x5x5_OES, | 422 | | COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES | 423 -------------------------------------------------------------------------- 424 | VIEW_CLASS_ASTC_6x6x5_RGBA | COMPRESSED_RGBA_ASTC_6x6x5_OES, | 425 | | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES | 426 -------------------------------------------------------------------------- 427 | VIEW_CLASS_ASTC_6x6x6_RGBA | COMPRESSED_RGBA_ASTC_6x6x6_OES, | 428 | | COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES | 429 -------------------------------------------------------------------------- 430 431 Table 8.X.2: Compatible internal formats for TextureViewEXT. Formats 432 in the same entry may be cast to each other. 433 434 If the internal format does not exactly match the internal format of the 435 original texture, the contents of the memory are reinterpreted in the 436 same manner as for image bindings described in section 8.22. 437 438 Texture commands that take a <level> or <layer> parameter, such as 439 TexSubImage2D, interpret that parameter to be relative to the view of 440 the texture. i.e. the mipmap level of the data store that would be 441 updated via TexSubImage2D would be the sum of <level> and the value of 442 TEXTURE_VIEW_MIN_LEVEL_EXT. 443 444 445 Errors 446 447 An INVALID_VALUE error is generated if <texture> is zero. 448 449 An INVALID_OPERATION error is generated by TextureViewEXT if <texture> 450 is not a valid name returned by GenTextures, or if <texture> has already 451 been bound and given a target. 452 453 An INVALID_VALUE error is generated if <origtexture> is not the name of 454 a texture. 455 456 An INVALID_OPERATION error is generated if the value of 457 TEXTURE_IMMUTABLE_FORMAT for <origtexture> is not TRUE. 458 459 An INVALID_OPERATION error is generated if <target> is not compatible 460 with the target of <origtexture>, as defined by table 8.X.1. 461 462 An INVALID_OPERATION error is generated if the internal format of 463 <origtexture> exists in table 8.X.2 and is not compatible with 464 <internalformat>, as described in that table. 465 466 An INVALID_OPERATION error is generated if the internal format of 467 <origtexture> does not exist in table 8.X.2, and is not identical to 468 <internalformat>. 469 470 An INVALID_VALUE error is generated if <minlevel> or <minlayer> are 471 larger than the greatest level or layer, respectively, of <origtexture>. 472 473 An INVALID_VALUE error is generated if <target> is TEXTURE_CUBE_MAP and 474 the clamped <numlayers> is not 6. 475 476 An INVALID_VALUE error is generated if <target> is 477 TEXTURE_CUBE_MAP_ARRAY_EXT and the clamped <numlayers> is not a multiple 478 of 6. In this case <numlayers> counts layer-faces rather than layers. 479 480 An INVALID_VALUE error is generated if <target> is TEXTURE_2D, 481 TEXTURE_3D, or TEXTURE_2D_MULTISAMPLE and <numlayers> does not equal 1. 482 483 An INVALID_OPERATION error is generated if <target> is 484 TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY_EXT, and the width and height 485 of <origtexture>'s levels are not equal. 486 487 An INVALID_OPERATION error is generated if any dimension of 488 <origtexture> is larger than the maximum supported corresponding 489 dimension of the new target. For example, if <origtexture> has a 490 TEXTURE_2D_ARRAY target and <target> is TEXTURE_CUBE_MAP, its width must 491 be no greater than the value of MAX_CUBE_MAP_TEXTURE_SIZE. 492 493 494 Modify section 8.17, "Immutable-Format Texture Images" 495 496 Modify the third bullet on p. 188, starting "If the command is 497 successful, TEXTURE_IMMUTABLE_FORMAT...": 498 499 If the command is successful, TEXTURE_IMMUTABLE_FORMAT becomes TRUE, 500 TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS_EXT become 501 <levels>. If the texture target is TEXTURE_2D_ARRAY, 502 TEXTURE_CUBE_MAP_ARRAY, or TEXTURE_2D_MULTISAMPLE_ARRAY then 503 TEXTURE_VIEW_NUM_LAYERS_EXT becomes <depth>. If the texture target is 504 TEXTURE_CUBE_MAP, then TEXTURE_VIEW_NUM_LAYERS_EXT becomes 6. For any 505 other texture target, TEXTURE_VIEW_NUM_LAYERS_EXT becomes 1. 506 507 508 Modify section 8.18, "Texture State" 509 510 Add to the fourth paragraph on the section on p. 191, starting "Next, 511 there are the": 512 513 "... swizzle modes (see section 14.2.1), and four integers describing 514 the texture view base level, number of levels, minimum array layer, and 515 number of layers." 516 517 Add to the following paragraph starting "In the initial state": 518 519 "... and ALPHA, respectively. The values of TEXTURE_VIEW_MIN_LEVEL_EXT, 520 TEXTURE_VIEW_NUM_LEVELS_EXT, TEXTURE_VIEW_MIN_LAYER_EXT, 521 TEXTURE_VIEW_NUM_LAYERS_EXT are each zero." 522 523 524Dependencies on EXT_texture_buffer 525 526 If EXT_texture_buffer is not supported, remove 527 TEXTURE_BUFFER_EXT from the list of targets in table 8.X.1. 528 529Dependencies on EXT_texture_cube_map_array 530 531 If EXT_texture_cube_map_array is not supported, remove all 532 references to TEXTURE_CUBE_MAP_ARRAY_EXT. 533 534Dependencies on EXT_texture_compression_s3tc 535 536 If EXT_texture_compression_s3tc is not supported, remove any 537 references to S3TC compressed texture formats. 538 539Dependencies on EXT_texture_compression_rgtc 540 541 If EXT_texture_compression_rgtc is not supported, remove any 542 references to the RGTC compressed texture formats. 543 544Dependencies on EXT_texture_compression_bptc 545 546 If EXT_texture_compression_bptc is not supported, remove any 547 references to the BPTC compressed texture formats. 548 549Dependencies on KHR_texture_compression_astc_ldr 550 551 If KHR_texture_compression_astc_ldr is not supported, remove any 552 references to the ASTC LDR compressed texture formats. 553 554Dependencies on KHR_texture_compression_astc_hdr 555 556 If KHR_texture_compression_astc_hdr is not supported, remove any 557 references to the ASTC HDR compressed texture formats. 558 559Dependencies on OES_texture_compression_astc 560 561 If OES_texture_compression_astc is not supported, remove any 562 references to the ASTC 3D compressed texture formats. 563 564New State 565 566 Add to table 20.9, Textures (state per texture object) 567 568 Initial 569 Get Value Type Get Command Value Description Sec. 570 --------------------------- ---- ----------- ------- ----------------------------- ------ 571 TEXTURE_VIEW_MIN_LEVEL_EXT Z+ GetTexParameter 0 view base texture level 8.16view 572 TEXTURE_VIEW_NUM_LEVELS_EXT Z+ GetTexParameter 0 view number of texture levels 8.16view 573 TEXTURE_VIEW_MIN_LAYER_EXT Z+ GetTexParameter 0 view min array layer 8.16view 574 TEXTURE_VIEW_NUM_LAYERS_EXT Z+ GetTexParameter 0 view number of array layers 8.16view 575 576New Implementation Dependent State 577 578 None. 579 580Examples 581 582 TODO 583 584Issues 585 586 Note: These issues apply specifically to the definition of the 587 EXT_texture_view specification, which is based on the OpenGL 588 extension ARB_texture_view. Resolved issues from ARB_texture_view 589 have been removed, but remain largely applicable to this extension. 590 ARB_texture_view can be found in the OpenGL Registry. 591 592 (1) What functionality was removed from ARB_texture_view? 593 594 - Texture targets TEXTURE_1D_ARRAY and TEXTURE_RECTANGLE. 595 - View classes VIEW_CLASS_RGTC1_RED, VIEW_CLASS_RGTC2_RG, 596 VIEW_CLASS_BPTC_UNORM, and VIEW_CLASS_BPTC_FLOAT, corresponding 597 to GL-only RGTC and BPTC compressed texture formats. 598 - Base and internal formats R16, R16_SNORM, RG16, RG16_SNORM, RGB16, 599 RGB16_SNORM, RGBA16, and RGBA16_SNORM (see bug 11366). 600 601 (2) Should there be ETC2/EAC view classes added corresponding to 602 those texture formats? 603 604 RESOLVED. Yes. These view classes don't exist in OpenGL 4.4 or any GL 605 extension, even though ETC2/EAC compressed formats are part of 4.4. 606 However as these formats are likely to be more important in an 607 OpenGL ES environment and thus support is added. Support is also 608 included for ASTC and RGTC and BPTC in case those texture formats 609 are also supported. 610 611Revision History 612 613 Rev. Date Author Changes 614 ---- -------- -------- ------------------------------------------- 615 1 10/07/13 Jon Leech Initial version based on ARB_texture_view 616 2 11/12/13 Jon Leech Add dependency on EXT_texture_buffer 617 and fix enum name. 618 3 11/20/13 Jon Leech Refer to ES 3.1 instead of 3plus. 619 4 11/21/13 dkoch Add dependency on EXT_texture_cube_map_array 620 and restore related language. 621 5 12/18/13 dkoch Add view classes for ETC2/EAC and ASTC formats 622 Add interactions with RGTC and BPTC extensions. 623 Resolve issue 3, add issue 5. 624 Remove ARB_internalformat_query2 interaction. 625 Added errors section based on GL 4.4. 626 6 03/10/14 Jon Leech Rebase on OpenGL ES 3.1, change extension suffix 627 to EXT, and remove R{GBA}16{,_SNORM} formats. 628 7 03/26/14 Jon Leech Sync with released ES 3.1 specs. Reflow text. 629 8 04/01/15 dkoch Update contributors. 630