1Name 2 3 NV_texture_array 4 5Name Strings 6 7 GL_NV_texture_array 8 9Contributors 10 11 Contributors to the OpenGL EXT_texture_array extension 12 Mathias Heyer, NVIDIA 13 Greg Roth, NVIDIA 14 Ian Stewart, NVIDIA 15 Nuno Subtil, NVIDIA 16 17Contact 18 19 Ian Stewart, NVIDIA Corporation (istewart 'at' nvidia.com) 20 21Status 22 23 Complete. 24 25Version 26 27 Last Modifed Date: Sep 25, 2012 28 NVIDIA Revision: 4 29 30Number 31 32 OpenGL ES Extension #133 33 34Dependencies 35 36 This extension is written against the OpenGL ES 2.0.25 37 Specification. 38 39 This extension depends on EXT_unpack_subimage. 40 41 This extension interacts with OES_texture_3D. 42 This extension interacts with OES_depth_texture. 43 This extension interacts with OES_packed_depth_stencil. 44 This extension interacts with OES_texture_npot. 45 This extension interacts with NV_pixel_buffer_object. 46 This extension interacts with NV_texture_npot_2D_mipmap. 47 This extension interacts with NV_framebuffer_blit. 48 49Overview 50 51 This extension introduces the notion of two-dimensional array 52 textures. An array texture is a collection of two-dimensional 53 images of identical size and format, arranged in layers. Array 54 textures are specified using TexImage3DNV, where the depth is 55 used to indicate the number of layers in the image. 56 57 An array texture is accessed as a single unit in a programmable 58 shader, using a single coordinate vector. A single layer is 59 selected, using the "p" texture coordinate, and that layer is then 60 accessed as though it were a two-dimensional texture. The layer 61 coordinate is provided as an unnormalized floating-point value in 62 the range [0,<n>-1], where <n> is the number of layers in the 63 array texture. Texture lookups do not filter between layers, 64 though such filtering can be achieved using programmable shaders. 65 When mipmapping is used, each level of an array texture has the 66 same number of layers as the base level; the number of layers is 67 not reduced as the image size decreases. 68 69 Single layers of array textures can be rendered to by binding them 70 to a framebuffer object using the FramebufferTextureLayerNV 71 function. 72 73New Procedures and Functions 74 75 void TexImage3DNV(enum target, int level, enum internalFormat, 76 sizei width, sizei height, sizei depth, int border, 77 enum format, enum type, const void *pixels) 78 79 void TexSubImage3DNV(enum target, int level, 80 int xoffset, int yoffset, int zoffset, 81 sizei width, sizei height, sizei depth, 82 enum format, enum type, const void *pixels) 83 84 void CopyTexSubImage3DNV(enum target, int level, 85 int xoffset, int yoffset, int zoffset, 86 int x, int y, sizei width, sizei height) 87 88 void CompressedTexImage3DNV(enum target, int level, enum internalformat, 89 sizei width, sizei height, sizei depth, 90 int border, sizei imageSize, const void *data) 91 92 void CompressedTexSubImage3DNV(enum target, int level, 93 int xoffset, int yoffset, int zoffset, 94 sizei width, sizei height, sizei depth, 95 enum format, sizei imageSize, 96 const void *data) 97 98 void FramebufferTextureLayerNV(enum target, enum attachment, 99 uint texture, int level, int layer); 100 101New Tokens 102 103 Accepted by the <target> parameter of TexImage3DNV, 104 TexSubImage3DNV, CopyTexSubImage3DNV, CompressedTexImage3DNV, 105 CompressedTexSubImage3DNV, TexParameteri, TexParameteriv, 106 TexParameterf, TexParameterfv, GenerateMipmap, and BindTexture: 107 108 TEXTURE_2D_ARRAY_NV 0x8C1A 109 110 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv and 111 GetFloatv: 112 113 TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D 114 MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF 115 116 Accepted by the <pname> parameter of 117 GetFramebufferAttachmentParameteriv: 118 119 FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 120 121 Returned by the <type> parameter of GetActiveUniform: 122 123 SAMPLER_2D_ARRAY_NV 0x8DC1 124 125 Accepted by the <pname> parameter of PixelStorei, GetBooleanv, 126 GetIntegerv and GetFloatv: 127 128 UNPACK_SKIP_IMAGES_NV 0x806D 129 UNPACK_IMAGE_HEIGHT_NV 0x806E 130 131New GLSL defines 132 133 #define GL_NV_texture_array 1 134 135New GLSL sampler types 136 137 sampler2DArrayNV 138 139GLSL Grammar Changes 140 141 The token SAMPLER2DARRAYNV is added to the list of tokens returned 142 from lexical analysis and the type_specifier_no_prec production. 143 144New GLSL functions 145 146 texture2DArrayNV() 147 texture2DArrayLodNV() 148 149Additions to Chapter 2 of the OpenGL ES 2.0.25 Specification 150 151 Modify section 2.10.4, "Shader Variables" 152 153 (add the following new return type to the description of 154 GetActiveUniform) 155 156 SAMPLER_2D_ARRAY_NV 157 158Additions to Chapter 3 of the OpenGL ES 2.0.25 Specification 159 160 Modify Section 3.6.1, "Pixel Storage Modes" 161 162 Replace the first sentence: 163 164 Pixel storage modes affect the operation of TexImage*D, 165 TexSubImage*D, and ReadPixels when one of these commands is issued. 166 167 Add to table 3.1 168 169 Parameter Name Type Initial Value Valid Range 170 ---------------------- ------- ------------- ------------ 171 UNPACK_SKIP_IMAGES_NV integer 0 [0,Infinity) 172 UNPACK_IMAGE_HEIGHT_NV integer 0 [0,Infinity) 173 174 Modify Section 3.7.1, "Texture Image Specification" 175 176 Replace the entire section with: 177 178 The command 179 180 void TexImage3DNV(enum target, int level, int internalformat, 181 sizei width, sizei height, sizei depth, int border, 182 enum format, enum type, void *data); 183 184 is used to specify a three-dimensional image for a two-dimensional 185 array texture. <target> must be TEXTURE_2D_ARRAY_NV. <format>, 186 <type>, and <data> specify the format of the image data, the type of 187 those data, and a reference to the image data in the currently bound 188 pixel unpack buffer or client memory, as described in section 3.6.2. 189 190 The groups in memory are treated as being arranged in a sequence of 191 adjacent rectangles. Each rectangle is a two-dimensional image, 192 whose size and organization are specified by the <width> and 193 <height> parameters to TexImage3DNV. The values of UNPACK_ROW_- 194 LENGTH_EXT and UNPACK_ALIGNMENT control the row-to-row spacing in 195 these images as described in section 3.6.2. If the value of the 196 integer parameter UNPACK_IMAGE_HEIGHT_NV is zero, then the number of 197 rows in each two-dimensional image is height; otherwise the number 198 of rows is UNPACK_IMAGE_HEIGHT_NV. Each two-dimensional image 199 comprises an integral number of rows, and is exactly adjacent to its 200 neighbor images. 201 202 The mechanism for selecting a sub-volume of a three-dimensional 203 image relies on the integer parameter UNPACK_SKIP_IMAGES_NV. If 204 UNPACK_SKIP_IMAGES_NV is positive, the pointer is advanced by 205 UNPACK_SKIP_IMAGES_NV times the number of elements in one two- 206 dimensional image before obtaining the first group from memory. 207 Then <depth> two-dimensional images are processed, each having a 208 subimage extracted as described in section 3.6.2. 209 210 The selected groups are transferred to the GL as described in 211 section 3.6.2 and then clamped to the representable range of the 212 internal format. For color component groups, if the <internalformat> 213 of the texture is signed or unsigned normalized fixed-point, 214 components are clamped to [-1, 1] or [0, 1], respectively. For depth 215 component groups, the depth value is clamped to [0, 1]. Otherwise, 216 values are not modified. 217 218 Components are then selected from the resulting R, G, B, A, depth, 219 or stencil values to obtain a texture with the base internal format 220 specified by <internalformat>. Table 3.8 summarizes the mapping of 221 R, G, B, A, depth, or stencil values to texture components, as a 222 function of the base internal format of the texture image. 223 <internalformat> may be one of the five internal format symbolic 224 constants listed in table 3.8. Specifying a value for 225 <internalformat> that is not one of the above values generates the 226 error INVALID_VALUE. If internalformat does not match format, the 227 error INVALID_OPERATION is generated. 228 229 The GL stores the resulting texture with internal component 230 resolutions of its own choosing. The allocation of internal 231 component resolution may vary based on any TexImage3DNV or 232 TexImage2D (see below) parameter (except target), but the allocation 233 must not be a function of any other state and cannot be changed once 234 established. Allocations must be invariant; the same allocation must 235 be chosen each time a texture image is specified with the same 236 parameter values. 237 238 The image itself (referred to by data) is a sequence of groups of 239 values. The first group is the lower left back corner of the texture 240 image. Subsequent groups fill out rows of width width from left to 241 right; height rows are stacked from bottom to top forming a single 242 two-dimensional image slice; and depth slices are stacked from back 243 to front. When the final R, G, B, and A components have been 244 computed for a group, they are assigned to components of a texel as 245 described by table 3.8. Counting from zero, each resulting Nth texel 246 is assigned internal integer coordinates (i, j, k), where 247 248 i = (N mod width) 249 250 j = (floor(N/width) mod height) 251 252 k = (floor(N/(width * height) mod depth) 253 254 Thus the last two-dimensional image slice of the three-dimensional 255 image is indexed with the highest value of k. 256 257 If the internal data type of the image array is signed or unsigned 258 normalized fixed-point, each color component is converted as 259 described in section 2.1.2. If the internal type is floating-point, 260 components are clamped to the representable range of the 261 corresponding internal component, but are not converted. 262 263 The <level> argument to TexImage3DNV is an integer level-of-detail 264 number. Levels of detail are discussed below, under Mipmapping. The 265 main texture image has a level of detail number of 0. If a level-of- 266 detail less than zero is specified, the error INVALID_VALUE is 267 generated. If <level> is greater than zero, and either width or 268 height is not a power of two, the error INVALID_VALUE is generated. 269 270 If <border> is not zero, then the error INVALID_VALUE is generated. 271 272 If <width>, <height>, or <depth> are less than zero, then the error 273 INVALID_VALUE is generated. 274 275 The maximum allowable width and height of a texel array for a two- 276 dimensional texture or two-dimensional array texture is an 277 implementation-dependent function of the level-of-detail and 278 internal format of the resulting image array. It must be at least 279 2^(k-lod) for image arrays of level-of-detail 0 through k, where k 280 is the log base 2 of MAX_TEXTURE_SIZE and lod is the level-of-detail 281 of the image array. The maximum allowable width and height of a cube 282 map texture must be the same, and must be at least 2^(k-lod) for 283 image arrays level 0 through k, where k is the log base 2 of 284 MAX_CUBE_MAP_TEXTURE_SIZE. The maximum number of layers for two- 285 dimensional array textures (depth) must be at least MAX_ARRAY_- 286 TEXTURE_LAYERS_NV for for image arrays level 0 through k. The 287 maximum width, height, and depth may be zero for image arrays of any 288 level-of-detail greater than k. The error INVALID_VALUE is generated 289 if the specified image is too large to be stored under any 290 conditions. 291 292 An implementation may allow an image of level zero to be created 293 only if that single image can be supported. Additional constraints 294 on the creation of images of level one or greater are described in 295 more detail in section 3.7.10. 296 297 If a pixel unpack buffer object is bound and storing texture data 298 would access memory beyond the end of the pixel unpack buffer, an 299 INVALID_OPERATION error results. 300 301 The command 302 303 void TexImage2D(enum target, int level, int internalformat, 304 sizei width, sizei height, int border, enum format, 305 enum type, const void *data); 306 307 is used to specify a two-dimensional texture image. target must be 308 one of TEXTURE_2D for a two-dimensional texture, or one of TEXTURE_- 309 CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_- 310 POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, 311 or TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube map texture. The other 312 parameters match the corresponding parameters of TexImage3DNV. 313 314 For the purposes of decoding the texture image, TexImage2D is 315 equivalent to calling TexImage3DNV with corresponding arguments and 316 depth of 1, except that UNPACK_SKIP_IMAGES_NV is ignored. 317 318 A two-dimensional texture consists of a single two-dimensional 319 texture image. A cube map texture is a set of six two-dimensional 320 texture images. The six cube map texture targets form a single cube 321 map texture though each target names a distinct face of the cube 322 map. The TEXTURE_CUBE_MAP_* targets listed above update their 323 appropriate cube map face 2D texture image. Note that the six cube 324 map two-dimensional image tokens such as TEXTURE_CUBE_MAP_POSITIVE_X 325 are used when specifying, updating, or querying one of a cube map's 326 six two-dimensional images, but when binding to a cube map texture 327 object (that is when the cube map is accessed as a whole as opposed 328 to a particular two-dimensional image), the TEXTURE_CUBE_MAP target 329 is specified. 330 331 When the target parameter to TexImage2D is one of the six cube map 332 two-dimensional image targets, the error INVALID_VALUE is generated 333 if the width and height parameters are not equal. 334 335 An INVALID_VALUE error is generated if border is non-zero. 336 337 The image indicated to the GL by the image pointer is decoded and 338 copied into the GL's internal memory. 339 340 We shall refer to the decoded image as the texel array. A three- 341 dimensional texel array has width, height, and depth <wt>, <ht>, and 342 <dt>. A two-dimensional texel array has depth <dt> = 1, with height 343 <ht> and width <wt> as above. 344 345 An element (i, j, k) of the texel array is called a texel (for a 346 non-array two-dimensional texture, k is irrelevant). The texture 347 value used in texturing a fragment is determined by sampling the 348 texture in a shader, but may not correspond to any actual texel. See 349 figure 3.6. 350 351 If the <data> argument of TexImage2D or TexImage3DNV is a NULL 352 pointer, and the pixel unpack buffer object is zero, a two- or 353 three-dimensional texel array is created with the specified target, 354 level, internalformat, border, width, height, and depth, but with 355 unspecified image contents. In this case no pixel values are 356 accessed in client memory, and no pixel processing is performed. 357 Errors are generated, however, exactly as though the data pointer 358 were valid. Otherwise if the pixel unpack buffer object is non-zero, 359 the data argument is treatedly normally to refer to the beginning of 360 the pixel unpack buffer object's data. 361 362 Modify Section 3.7.2, "Alternate Texture Image Specification 363 Commands" 364 365 Replace paragraphs 4 through 6 starting with the description of 366 additional commands: 367 368 Four additional commands, 369 370 void TexSubImage3DNV(enum target, int level, int xoffset, 371 int yoffset, int zoffset, sizei width, 372 sizei height, sizei depth, enum format, 373 enum type, const void *data); 374 void TexSubImage2D(enum target, int level, int xoffset, 375 int yoffset, sizei width, sizei height, 376 enum format, enum type, const void *data); 377 void CopyTexSubImage3DNV(enum target, int level, int xoffset, 378 int yoffset, int zoffset, int x, int y, 379 sizei width, sizei height); 380 void CopyTexSubImage2D(enum target, int level, int xoffset, 381 int yoffset, int x, int y, sizei width, 382 sizei height); 383 384 respecify only a rectangular subregion of an existing texel array. 385 No change is made to the <internalformat>, <width>, <height>, 386 <depth>, or <border> parameters of the specified texel array, nor is 387 any change made to texel values outside the specified subregion. 388 The <target> arguments of TexSubImage2D and CopyTexSubImage2D must 389 be one of TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_- 390 MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_- 391 NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_- 392 NEGATIVE_Z, and the <target> arguments of TexSubImage3DNV and 393 CopyTexSubImage3DNV must be TEXTURE_2D_ARRAY_NV. The 394 <level> parameter of each command specifies the level of the texel 395 array that is modified. If level is less than zero or greater than 396 the base 2 logarithm of the maximum texture width, height, or depth, 397 the error INVALID_VALUE is generated. 398 399 TexSubImage3DNV arguments <width>, <height>, <depth>, <format>, 400 <type>, and <data> match the corresponding arguments to 401 TexImage3DNV, meaning that they are specified using the same values, 402 and have the same meanings. Likewise, TexSubImage2D arguments 403 <width>, <height>, <format>, <type>, and <data> match the 404 corresponding arguments to TexImage2D. 405 406 CopyTexSubImage3DNV and CopyTexSubImage2D arguments <x>, <y>, 407 <width>, and <height> match the corresponding arguments to 408 CopyTexImage2D. Each of the TexSubImage commands interprets and 409 processes pixel groups in exactly the manner of its TexImage 410 counterpart, except that the assignment of R, G, B, A, depth, and 411 stencil pixel group values to the texture components is controlled 412 by the <internalformat> of the texel array, not by an argument to 413 the command. The same constraints and errors apply to the 414 TexSubImage commands' argument <format> and the <internalformat> of 415 the texel array being respecified as apply to the <format> and 416 <internalformat> arguments of its TexImage counterparts. 417 418 Arguments <xoffset>, <yoffset>, and <zoffset> of TexSubImage3DNV and 419 CopyTexSubImage3DNV specify the lower left texel coordinates of a 420 <width>-wide by <height>-high by <depth>-deep rectangular subregion 421 of the texel array. The <depth> argument associated with 422 CopyTexSubImage3DNV is always 1, because framebuffer memory is two- 423 dimensional - only a portion of a single <s>, <t> slice of a three- 424 dimensional texture is replaced by CopyTexSubImage3DNV. 425 426 Taking <wt>, <ht>, and <dt> to be the specified width, height, and 427 depth of the texel array, and taking <x>, <y>, <z>, <w>, <h>, and 428 <d> to be the <xoffset>, <yoffset>, <zoffset>, <width>, <height>, 429 and <depth> argument values, any of the following relationships 430 generates the error INVALID_VALUE: 431 432 x < 0 433 x + w > wt 434 y < 0 435 y + h > ht 436 z < 0 437 z + d > dt 438 439 Counting from zero, the <n>th pixel group is assigned to the texel 440 with internal integer coordinates [i, j, k], where 441 442 i = x + (n mod w) 443 j = y + (floor(n/w) mod h) 444 k = z + (floor (n/(width*height)) mod d) 445 446 Replace the last two paragraphs of 3.7.2: 447 448 Calling CopyTexSubImage3DNV, CopyTexImage2D, or CopyTexSubImage2D 449 will result in an INVALID_FRAMEBUFFER_OPERATION error if the object 450 bound to READ_FRAMEBUFFER_BINDING_NV is not framebuffer complete 451 (see section 4.4.5). 452 453 "Texture Copying Feedback Loops" 454 455 Calling CopyTexSubImage3DNV, CopyTexImage2D, or CopyTexSubImage2D 456 will result in undefined behavior if the destination texture image 457 level is also bound to the selected read buffer (see section 4.3.1) 458 of the read framebuffer. This situation is discussed in more detail 459 in the description of feedback loops in section 4.4.4. 460 461 Modify Section 3.7.3, "Compressed Texture Images" 462 463 Replace the second paragraph: 464 465 The commands 466 467 void CompressedTexImage2D(enum target, int level, 468 enum internalformat, sizei width, 469 sizei height, int border, 470 sizei imageSize, const void *data); 471 void CompressedTexImage3DNV(enum target, int level, 472 enum internalformat, sizei width, 473 sizei height, sizei depth, 474 int border, sizei imageSize, 475 const void *data); 476 477 define two- and three-dimensional texture images, respectively, with 478 incoming data stored in a compressed image format. The <target>, 479 <level>, <internalformat>, <width>, <height>, <depth>, and <border> 480 parameters have the same meaning as in TexImage2D and TexImage3DNV. 481 <data> refers to compressed image data stored in the compressed 482 image format corresponding to <internalformat>. If a pixel unpack 483 buffer is bound (as indicated by a non-zero value of PIXEL_UNPACK_- 484 BUFFER_BINDING), <data> is an offset into the pixel unpack buffer 485 and the compressed data is read from the buffer relative to this 486 offset; otherwise, data is a pointer to client memory and the 487 compressed data is read from client memory relative to the pointer. 488 489 490 Replace fifth through the seventh paragraph of 3.7.3: 491 492 Any restrictions imposed by specific compressed internal formats 493 will be invariant with respect to image contents, meaning that if 494 the GL accepts and stores a texture image in compressed form, 495 CompressedTexImage2D or CompressedTexImage3DNV will accept any 496 properly encoded compressed texture image of the same width, height, 497 compressed image size, and compressed internal format for storage at 498 the same texture level. 499 500 Respecifying Subimages of Compressed Textures 501 502 The commands 503 504 void CompressedTexSubImage2D(enum target, int level, int xoffset, 505 int yoffset, sizei width, sizei height, 506 enum format, sizei imageSize, void *data); 507 void CompressedTexSubImage3DNV(enum target, int level, int xoffset, 508 int yoffset, int zoffset, sizei width, 509 sizei height, sizei depth, 510 enum format, sizei imageSize, 511 const void *data); 512 513 respecify only a rectangular region of an existing texel array, with 514 incoming data stored in a known compressed image format. The 515 <target>, <level>, <xoffset>, <yoffset>, <zoffset>, <width>, 516 <height>, <depth>, and <format> parameters have the same meaning as 517 in TexSubImage2D and TexSubImage3DNV. data points to compressed 518 image data stored in the compressed image format corresponding to 519 <format>. 520 521 The image pointed to by <data> and the <imageSize> parameter are 522 interpreted as though they were provided to CompressedTexImage2D and 523 CompressedTexImage3DNV. These commands do not provide for image 524 format conversion, so an INVALID_OPERATION error results if <format> 525 does not match the internal format of the texture image being 526 modified. If the <imageSize> parameter is not consistent with the 527 format, dimensions, and contents of the compressed image (too little 528 or too much data), an INVALID_VALUE error results. 529 530 531 Replace the last two paragraphs of section 3.7.3: 532 533 Any restrictions imposed by specific compressed internal formats 534 will be invariant with respect to image contents, meaning that if GL 535 accepts and stores a texture image in compressed form, Compressed- 536 TexSubImage2D or CompressedTexSubImage3DNV will accept any properly 537 encoded compressed texture image of the same width, height, 538 compressed image size, and compressed internal format for storage at 539 the same texture level. 540 541 Calling CompressedTexSubImage2D or CompressedTexSubImage3DNV will 542 result in an INVALID_OPERATION error if <xoffset>, <yoffset>, or 543 <zoffset> are not equal to zero, or if <width>, <height>, and 544 <depth> do not match the dimensions of the texture level. These 545 restrictions may be relaxed for specific compressed internal formats 546 whose images are easily modified. 547 548 Modify Section 3.7.10, "Texture Completeness and Non-Power-Of-Two 549 Textures" 550 551 (modify second paragraph) 552 553 A two-dimensional texture or two-dimensional texture array is 554 complete if the following conditions all hold true: 555 556 Modify Section 3.7.11, "Mipmap Generation" 557 558 (modify first paragraph) 559 560 Mipmaps can be generated with the command 561 562 void GenerateMipmap(enum target); 563 564 where <target> is the target, which muct be TEXTURE_2D, 565 TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP. 566 567 Modify Section 3.7.13, "Texture Objects" 568 569 In addition to the default textures TEXTURE_2D, 570 TEXTURE_2D_ARRAY_NV, and TEXTURE_CUBE_MAP, named two-dimensional, 571 two-dimensional array, and cube map texture objects can be created 572 and operated upon. The name space for texture objects is the 573 unsigned integers, with zero reserved by the GL. 574 575 A texture object is created by binding an unused name to 576 TEXTURE_2D, TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP. The binding 577 is effected by calling 578 579 void BindTexture(enum target, uint texture); 580 581 with <target> set to the desired texture target and <texture> set 582 to the unused name. The resulting texture object is a new state 583 vector, comprising all the state values listed in section 3.7.12, 584 set to the same initial values. If the new texture object is bound 585 to TEXTURE_2D, TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP, it is and 586 remains a two-dimensional, two-dimensional array, or cube map 587 texture respectively until it is deleted. 588 589 BindTexture may also be used to bind an existing texture object to 590 TEXTURE_2D, TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP. The error 591 INVALID_OPERATION is generated if an attempt is made to bind a 592 texture object of different dimensionality than the specified 593 target. If the bind is successful no change is made to the state 594 of the bound texture object, and any previous binding to target is 595 broken. While a texture object is bound, GL operations on the 596 target to which it is bound affect the bound object, and queries 597 of the target to which it is bound return state from the bound 598 object. 599 600 In the initial state, TEXTURE_2D, TEXTURE_2D_ARRAY_NV, and 601 TEXTURE_CUBE_MAP have two-dimensional, two-dimensional array, and 602 cube map texture state vectors respectively associated with them. 603 In order that access to these initial textures not be lost, they 604 are treated as texture objects all of whose names are 0. The 605 initial two-dimensional, two-dimensional array, and cube map 606 texture are therefore operated upon, queried, and applied as 607 TEXTURE_2D, TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP respectively 608 while 0 is bound to the corresponding targets. 609 610 Texture objects are deleted by calling 611 612 void DeleteTextures(sizei n, uint *textures); 613 614 <textures> contains <n> names of texture objects to be deleted. 615 After a texture object is deleted, it has no contents or 616 dimensionality, and its name is again unused. If a texture that is 617 currently bound to one of the targets TEXTURE_2D, 618 TEXTURE_2D_ARRAY_NV, or TEXTURE_CUBE_MAP is deleted, it is as 619 though BindTexture had been executed with the same target and 620 texture zero. Unused names in textures are silently ignored, as is 621 the value zero. 622 623Additions to Chapter 4 of the OpenGL ES 2.0.25 Specification 624 625 Modify Section 4.3, "Reading Pixels" 626 627 Pixels may be read from the framebuffer to client memory using the 628 ReadPixels commands, as described below. Pixels may also be copied 629 from client memory or the framebuffer to texture images in the GL 630 using the CopyTexImage2D, CopyTexSubImage2D, and 631 CopyTexSubImage3DNV commands, as described in section 3.7.2. 632 633 Modify Section 4.4.3, "Renderbuffer Objects" 634 635 (modify paragraph following "Attaching Texture Images to a 636 Framebuffer") 637 638 OpenGL ES supports copying the rendered contents of the 639 framebuffer into the images of a texture object through the use of 640 the routines CopyTexImage2D, CopyTexSubImage2D, and 641 CopyTexSubImage3DNV. Additionally, OpenGL ES supports rendering 642 directly into the images of a texture object. 643 644 (add the following to the end of the section) 645 646 The command 647 648 void FramebufferTextureLayerNV(enum target, enum attachment, 649 uint texture, int level, int layer); 650 651 operates similarly to FramebufferTexture2D, except that it 652 attaches a single layer of a two-dimensional array texture level. 653 654 <layer> specifies the layer of the two-dimensional image within 655 <texture>. An INVALID_VALUE error is generated if <layer> is 656 larger than the value of MAX_ARRAY_TEXTURE_LAYERS_NV minus one. 657 The error INVALID_VALUE is generated if <texture> is non-zero and 658 <layer> is negative. 659 660 <level> must be greater than or equal to zero and no larger than 661 log2 of the value of MAX_TEXTURE_SIZE. Otherwise, an INVALID_VALUE 662 error is generated. 663 664 The error INVALID_OPERATION is generated if <texture> is non-zero 665 and is not the name of a two-dimensional array texture. Unlike 666 FramebufferTexture2D, no <textarget> parameter is accepted. 667 668 If <texture> is non-zero and the command does not result in an 669 error, the framebuffer attachment state corresponding to 670 <attachment> is updated as in FramebufferTexture2D, except that 671 the value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV is set to 672 <layer>. 673 674 Modify Section 4.4.5, "Framebuffer Completeness" 675 676 (modify fourth bullet of actions that may change the framebuffer 677 completeness) 678 679 * Changing the width, height, or internal format of a texture 680 image that is attached to the framebuffer by calling 681 TexImage2D, CopyTexImage2D, CompressedTexImage2D, 682 TexImage3DNV, or CompressedTexImage3DNV. 683 684Additions to Chapter 6 of the OpenGL ES 2.0.25 Specification 685 686 Modify Section 6.1.3, "Enumerated Queries" 687 688 (modify first paragraph) 689 690 The command 691 692 void GetTexParameter{if}v(enum target, enum value, T data); 693 694 returns information about <target>, which may be 695 one of TEXTURE_2D, TEXTURE_2D_ARRAY, or TEXTURE_CUBE_MAP, 696 indicating the currently bound two-dimensional, two-dimensional 697 array, or cube map texture object. 698 699 (add the following item after "If the value of 700 FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE, then") 701 702 * If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV and the 703 texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a 704 two-dimensional array texture, then <params> will contain the 705 number of texture layer attached to the attachment point. 706 Otherwise, <params> will contain the value zero. 707 708Additions to Chapter 4 of the OpenGL ES Shading Language Specification 709 710 Add the following to the table of basic types in section 4.1: 711 712 sampler2DArrayNV a handle for accessing a 2D array texture 713 714Additions to Chapter 8 of the OpenGL ES Shading Language Specification 715 716 The built-in texture lookup functions texture2DArrayNV and 717 texture2DArrayLodNV are optional, and must be enabled by 718 719 #extension GL_NV_texture_array : enable 720 721 before being used. 722 723 Syntax: 724 725 vec4 texture2DArrayNV(sampler2DArrayNV sampler, vec3 coord [, float bias]) 726 vec4 texture2DArrayLodNV(sampler2DArrayNV sampler, vec3 coord, float lod) 727 728 Description: 729 730 Use the first two elements (coord.s, coord.t) of texture 731 coordinate coord to do a texture lookup in the layer indicated by 732 the third coordinate (coord.p) of the 2D texture array currently 733 bound to sampler. The layer to access is computed by layer = 734 max (0, min(d - 1, floor (coord.p + 0.5)) where 'd' is the depth 735 of the texture array. 736 737Interactions with OES_texture_3D 738 739 FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV is an alias for the 740 FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES token provided in 741 OES_texture_3D. This extension generalizes the notion of 742 "<zoffset>" to include layers of an array texture. 743 744 If OES_texture_3D is supported, descriptions of TexImage3DNV, 745 TexSubImage3DNV, CopyTexSubImage3DNV, CompressedTexImage3DNV, and 746 CompressedTexSubImage3DNV should be merged with the *OES 747 counterparts added by that extension and should be considered 748 equivalents to the OES counterparts. 749 750Interactions with OES_depth_texture 751 752 If OES_depth_texture is not supported, all references to depth 753 texture data should be ignored. 754 755Interactions with OES_packed_depth_stencil 756 757 If OES_packed_depth_stencil is not supported, all references to 758 stencil texture data should be ignored. 759 760Interactions with OES_texture_npot and NV_texture_npot_2D_mipmap 761 762 If either OES_texture_npot or NV_texture_npot_2D_mipmap are 763 supported, ignore INVALID_VALUE error generation by TexImage3DNV 764 when level is greater than zero and width or height are non-power- 765 of-two. 766 767Interactions with NV_pixel_buffer_object 768 769 If NV_pixel_buffer_object is not supported, ignore all references to 770 non-zero unpack buffer objects and corresponding behavior. 771 772Interactions with NV_framebuffer_blit 773 774 If NV_framebuffer_blit is not supported, replace the reference to 775 READ_FRAMEBUFFER_BINDING_NV in section 3.7.2 to FRAMEBUFFER_BINDING. 776 777Errors 778 779 None. 780 781New State 782 783 Initial 784 Get Value Type Get Command Value Description 785 --------------------------- ---- ----------- ----- ------------------------------------------- 786 TEXTURE_BINDING_2D_ARRAY_NV Z+ GetIntegerv 0 texture object bound to TEXTURE_2D_ARRAY_NV 787 788New Implementation Dependent State 789 790 791 Minimum 792 Get Value Type Get Command Value Description 793 --------------------------- ---- ----------- ----- ------------------------------------------ 794 MAX_ARRAY_TEXTURE_LAYERS_NV Z+ GetIntegerv 64 maximum number of layers for texture array 795 796Issues 797 798 None 799 800Revision History 801 802 Rev. Date Author Changes 803 ---- -------- --------- ------------------------------------- 804 4 25 Sep 2012 groth Minor typographical fixes. fbo_blit interaction 805 3 13 Sep 2012 groth Added missing suffixes. Removed tex_3d 806 language. Added more interactions. 807 Clarified enumerated additions. 808 2 05 Sep 2012 groth Addition of lots of detail in chapter 3 809 and interactions with other extensions 810 1 30 Aug 2012 istewart First revision, based of the 811 EXT_texture_array specification. 812 813