1Name 2 3 ANGLE_texture_multisample 4 5Name Strings 6 7 GL_ANGLE_texture_multisample 8 9Contributors 10 11 Yunchao He, Intel Corporation 12 Yizhou Jiang, Intel Corporation 13 Contributors to the OpenGL ES 3.1, GLSL ES 3.1, and ARB_texture_multisample 14 15Contact 16 17 Yunchao He (yunchao.he 'at' intel.com) 18 19Status 20 21 Incomplete 22 23Version 24 25 Last Modified Date: August 27, 2018 26 Author Revision: 1 27 28Number 29 30 OpenGL ES Extension XX 31 32Dependencies 33 34 OpenGL ES 3.0 is required. 35 36 This extension is written against the OpenGL ES 3.0.5 and OpenGL ES 37 Shading Language 3.0 (Document Revision 6) specifications. 38 39 KHR_robustness affects the behavior of this specification. 40 41Overview 42 43 This extension provides support for a new type of texture - 44 two-dimensional multisample textures - as well as mechanisms to 45 allocate storage and attach such textures to FBOs for rendering. 46 It also add supports using such textures in a shader, fetching specific 47 samples from such textures in a shader, and querying the dimensions of 48 such textures in a shader. 49 50 This extension also includes the following functionality, some of which 51 was first described in NV_explicit_multisample: 52 53 * An API to query the location of samples within the pixel 54 55 * An explicit control for the multisample sample mask to augment the 56 control provided by SampleCoverage 57 58 * An API to query the texture's level-of-detail information for various 59 parameters 60 61 * A mechanism to support the SAMPLE_MASK capability 62 63 * A mechanism to return corresponding types for multisample textures when 64 the uniform type is queried by getActiveUniform 65 66 This extension does not expose multisampled 2D array textures, because they 67 are not supported in OpenGL ES 3.1. 68 69IP Status 70 71 No known IP claims. 72 73New Procedures and Functions 74 75 void TexStorage2DMultisampleANGLE(enum target, 76 sizei samples, 77 enum sizedinternalformat, 78 sizei width, 79 sizei height, 80 boolean fixedsamplelocations); 81 82 void GetMultisamplefvANGLE(enum pname, uint index, float *val); 83 84 void SampleMaskiANGLE(uint maskNumber, bitfield mask); 85 86 void GetTexLevelParameter{if}vANGLE(enum target, int level, 87 enum pname, T *params ); 88 89New Tokens 90 91 Accepted by the <target> parameter of BindTexture, 92 TexStorage2DMultisampleANGLE, GetInternalformativ, TexParameter{if}*, 93 GetTexParameter{if}v, GetTexLevelParameter{if}vANGLE and 94 by the <textarget> parameter of FramebufferTexture2D: 95 96 TEXTURE_2D_MULTISAMPLE_ANGLE 0x9100 97 98 Accepted by the <pname> parameter of GetMultisamplefvANGLE: 99 100 SAMPLE_POSITION_ANGLE 0x8E50 101 102 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled: 103 104 SAMPLE_MASK_ANGLE 0x8E51 105 106 Accepted by the <target> parameter of GetIntegeri_v: 107 108 SAMPLE_MASK_VALUE_ANGLE 0x8E52 109 110 Accepted by the <pname> parameter of GetIntegerv: 111 112 MAX_SAMPLE_MASK_WORDS_ANGLE 0x8E59 113 MAX_COLOR_TEXTURE_SAMPLES_ANGLE 0x910E 114 MAX_DEPTH_TEXTURE_SAMPLES_ANGLE 0x910F 115 MAX_INTEGER_SAMPLES_ANGLE 0x9110 116 TEXTURE_BINDING_2D_MULTISAMPLE_ANGLE 0x9104 117 118 Accepted by the <pname> parameter of GetTexLevelParameter{if}vANGLE: 119 120 TEXTURE_SAMPLES_ANGLE 0x9106 121 TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE 0x9107 122 TEXTURE_WIDTH 0x1000 123 TEXTURE_HEIGHT 0x1001 124 TEXTURE_DEPTH 0x8071 125 TEXTURE_INTERNAL_FORMAT 0x1003 126 TEXTURE_RED_SIZE 0x805C 127 TEXTURE_GREEN_SIZE 0x805D 128 TEXTURE_BLUE_SIZE 0x805E 129 TEXTURE_ALPHA_SIZE 0x805F 130 TEXTURE_DEPTH_SIZE 0x884A 131 TEXTURE_STENCIL_SIZE 0x88F1 132 TEXTURE_SHARED_SIZE 0x8C3F 133 TEXTURE_RED_TYPE 0x8C10 134 TEXTURE_GREEN_TYPE 0x8C11 135 TEXTURE_BLUE_TYPE 0x8C12 136 TEXTURE_ALPHA_TYPE 0x8C13 137 TEXTURE_DEPTH_TYPE 0x8C16 138 TEXTURE_COMPRESSED 0x86A1 139 140 Returned by the <type> parameter of GetActiveUniform: 141 142 SAMPLER_2D_MULTISAMPLE_ANGLE 0x9108 143 INT_SAMPLER_2D_MULTISAMPLE_ANGLE 0x9109 144 UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ANGLE 0x910A 145 146Additions to Chapter 2 of the OpenGL ES 3.0.5 Specification (OpenGL ES 147Operation) 148 149 Add to table 2.10 "OpenGL ES Shading Language type tokens" page 64: 150 151 Type Name Token Keyword 152 ----------------------------------------- ------------ 153 SAMPLER_2D_MULTISAMPLE_ANGLE sampler2DMS 154 INT_SAMPLER_2D_MULTISAMPLE_ANGLE isampler2DMS 155 UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ANGLE usampler2DMS 156 157 Add to section 2.12.9, after subsection "Texel Fetches": 158 159 Multisample Texel Fetches 160 161 Multisample buffers do not have mipmaps, and there is no level of 162 detail parameter for multisample texel fetches. Instead, an integer 163 parameter selects the sample number to be fetched from the buffer. 164 The number identifying the sample is the same as the value used to 165 query the sample location using GetMultisamplefvANGLE. Multisample 166 textures are not filtered when samples are fetched, and filter state 167 is ignored. 168 169 If the context was created with robust buffer access enabled, the result 170 of the texel fetch in the following cases is zero. If robust buffer 171 access is not enabled, the result of the texel fetch is undefined if 172 any of the following conditions hold: 173 174 * the texel coordinate (i, j) refer to a texel outside the extents 175 of the multisample texture image, where any of 176 i < 0 i >= W 177 j < 0 j >= H 178 and the size parameter W and H refer to the width and height of 179 the image. 180 181 * the specified sample number does not exist (is negative, or greater 182 than or equal to the number of samples in the texture). 183 184 Additionally, these fetches may only be performed on a multisample 185 texture sampler. No other sample or fetch commands may be performed 186 on a multisample texture sampler. 187 188Additions to Chapter 3 of the OpenGL ES 3.0.5 Specification (Rasterization) 189 190 Insert into section 3.3, "Multisampling" after the discussion of 191 the query for SAMPLES: 192 193 (..., and is queried by calling GetIntegerv with pname set to SAMPLES.) 194 195 The location at which shading is performed for a given sample (the 196 shading sample location) is queried with the command 197 198 void GetMultisamplefvANGLE(enum pname, uint index, float *val); 199 200 <pname> must be SAMPLE_POSITION_ANGLE, and <index> corresponds to the 201 sample for which the location should be returned. The shading sample 202 location (x, y) is returned as two floating-point values in (val[0], 203 val[1]) respectively. x and y each lie in the range [0, 1] and 204 represent a location in pixel space at which depth and associated 205 data for that sample are evaluated for a fragment (e.g. where sample 206 shading is performed). (0.5, 0.5) thus corresponds to the pixel center. 207 If the multisample mode does not have fixed sample locations, the returned 208 values may only reflect the locations of samples within some pixels. 209 210 An INVALID_ENUM error is generated if <pname> is not SAMPLE_LOCATION. 211 An INVALID_VALUE error is generated if <index> is greater than or equal to 212 the value of SAMPLES. 213 214 Modify Section 3.8.1, "Texture Objects": 215 216 (modify first paragraph of section, p. 122, simply adding 217 references to multisample textures) 218 219 Textures in GL are represented by named objects. The name space for texture 220 objects is the unsigned integers, with zero reserved by the GL to represent 221 the default texture object. The default texture object is bound to each of 222 the TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP, and 223 TEXTURE_2D_MULTISAMPLE_ANGLE targets during context initialization. 224 225 (modify the last paragraph, p. 123) 226 227 The texture object name space, including the initial two- and 228 three-dimensional, two-dimensional array, cube map, and two-dimensional 229 multisample texture objects, is shared among all texture units. A texture 230 object may be bound to more than one texture unit simultaneously. After a 231 texture object is bound, any GL operations on that target object affect 232 any other texture units to which the same texture object is bound. 233 234 Modify Section 3.8.3, "Texture Image Specification" (p. 134): 235 236 (add the new target to MAX_TEXTURE_SIZE description) 237 238 In a similar fashion, the maximum allowable width of a texel array 239 for a two-dimensional texture, two-dimensional array texture, 240 or two-dimensional multisample texture, and the maximum allowable 241 height of a two-dimensional texture, two-dimensional array texture, 242 or two-dimensional multisample texture, must be at least 2^(k-lod) 243 for image arrays of level 0 through k, where k is the log base 2 of 244 MAX_TEXTURE_SIZE. 245 246 Insert new Section 3.8.5, "Multisample Textures". Renumber subsequent 247 sections: 248 249 In addition to the texture types described in previous sections, an 250 additional type of texture is supported. A multisample texture is 251 similar to a two-dimensional texture, except it contains multiple 252 samples per texel. Multisample textures do not have multiple image 253 levels, and are immutable. 254 255 The command 256 257 void TexStorage2DMultisampleANGLE(enum target, sizei samples, 258 int sizedinternalformat, 259 sizei width, sizei height, 260 boolean fixedsamplelocations); 261 262 establishes the data storage, format, dimensions, and number of samples 263 of a multisample texture's image. <target> must be 264 TEXTURE_2D_MULTISAMPLE_ANGLE. <width> and <height> are the dimensions 265 in texels of the texture. 266 267 <samples> represents a request for a desired minimum number of samples. 268 Since different implementations may support different sample counts for 269 multisampled textures, the actual number of samples allocated for the 270 texture image is implementation-dependent. However, the resulting value 271 for TEXTURE_SAMPLES_ANGLE is guaranteed to be greater than or equal to 272 <samples> and no more than the next larger sample count supported by the 273 implementation. 274 275 If <fixedsamplelocations> is TRUE, the image will use identical sample 276 locations and the same number of samples for all texels in the image, 277 and the sample locations will not depend on the sizedinternalformat or 278 size of the image. 279 280 Upon success, TexStorage2DMultisampleANGLE deletes any existing image 281 for <target> and the contents of texels are undefined. The values of 282 TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_SAMPLES_ANGLE, 283 TEXTURE_INTERNAL_FORMAT and TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE are 284 set to <width>, <height>, the actual number of samples allocated, 285 <sizedinternalformat>, and <fixedsamplelocations> respectively. 286 287 When a multisample texture is accessed in a shader, the access takes one 288 vector of integers describing which texel to fetch and an integer 289 corresponding to the sample numbers described in section 3.3 describing 290 which sample within the texel to fetch. No standard sampling instructions 291 are allowed on the multisample texture targets, and no filtering is 292 performed by the fetch. Fetching a sample number less than zero, or 293 greater than or equal to the number of samples in the texture, produces 294 undefined results. 295 296 An INVALID_ENUM error is generated if target is not 297 TEXTURE_2D_MULTISAMPLE_ANGLE. 298 An INVALID_OPERATION error is generated if zero is bound to <target>. 299 An INVALID_VALUE is generated if <width> or <height> is less than 1. 300 An INVALID_VALUE is generated if <width> or <height> is greater than 301 the value of MAX_TEXTURE_SIZE. 302 An INVALID_VALUE is generated if samples is zero. 303 An INVALID_ENUM error is generated if <sizedinternalformat> is not 304 color-renderable, depth-renderable, or stencil-renderable (as defined 305 in section 4.4.4). 306 An INVALID_ENUM error is generated if <sizedinternalformat> is one of the 307 unsized base internal formats listed in table 3.11. 308 An INVALID_OPERATION is generated if <samples> is greater than the maximum 309 number of samples supported for this <target> and <sizedinternalformat>, 310 The maximum number of samples supported can be determined by calling 311 GetInternalformativ with a <pname> of SAMPLES (see section 6.1.15). 312 An INVALID_OPERATION is generated if the value of TEXTURE_IMMUTABLE_FORMAT 313 for the texture currently bound to <target> on the active texture unit is 314 TRUE. 315 An OUT_OF_MEMORY error is generated if the GL is unable to create a texture 316 image of the requested size. 317 318 Modify Section 3.8.7, "Texture Parameters": 319 320 (add TEXTURE_2D_MULTISAMPLE_ANGLE to the texture targets accepted by 321 TexParameter*) 322 323 <target> is the target, either TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, 324 TEXTURE_CUBE_MAP, or TEXTURE_2D_MULTISAMPLE_ANGLE. 325 326 Add the following paragraph to the end of Section 3.8.7: 327 328 An INVALID_ENUM is generated if <target> is TEXTURE_2D_MULTISAMPLE_ANGLE 329 and <pname> is any sampler state from table 6.10. An INVALID_OPERATION 330 error is generated if <target> is TEXTURE_2D_MULTISAMPLE_ANGLE, and 331 <pname> TEXTURE_BASE_LEVEL is set to any value other than zero. 332 333 Modify Section 3.8.14, "Texture State" (p. 162): 334 335 (... the compressed flag set to FALSE, and a zero compressed size). 336 337 Multisample textures also contain an integer identifying the number of 338 samples in each texel, and a boolean indicating whether identical sample 339 locations and number of samples will be used for all texels in the image. 340 341Additions to Chapter 4 of the OpenGL ES 3.0.5 Specification (Per-Fragment 342Operations and the Framebuffer) 343 344 Modify Section 4.1.3, "Multisample Fragment Operations" (p. 174): 345 346 (modify the first paragraph to include SAMPLE_MASK_ANGLE and 347 SAMPLE_MASK_VALUE_ANGLE on the list of values the coverage value is 348 modified based on.) 349 350 This step modifies fragment alpha and coverage values based on the values 351 of SAMPLE_ALPHA_TO_COVERAGE, SAMPLE_COVERAGE, SAMPLE_COVERAGE_VALUE, 352 SAMPLE_COVERAGE_INVERT, SAMPLE_MASK_ANGLE, and SAMPLE_MASK_VALUE_ANGLE. 353 354 Add to the end of Section 4.1.3, after the discussion of SAMPLE_COVERAGE: 355 356 If SAMPLE_MASK_ANGLE is enabled, the fragment coverage is ANDed 357 with the coverage value SAMPLE_MASK_VALUE_ANGLE. 358 359 The value of SAMPLE_MASK_VALUE_ANGLE is specified using 360 361 void SampleMaskiANGLE(GLuint maskNumber, GLbitfield mask); 362 363 with <mask> set to the desired mask for mask word <maskNumber>. Bit B of 364 mask word M corresponds to sample 32*M+B as described in Section 3.3. The 365 sample mask value is queried by calling GetIntegeri_v with <target> set to 366 SAMPLE_MASK_VALUE_ANGLE and the index set to <maskNumber>. 367 368 An INVALID_VALUE error is generated if <maskNumber> is greater than or 369 equal to the value of MAX_SAMPLE_MASK_WORDS_ANGLE. 370 371 Modify Section 4.4.2, "Attaching Images to Framebuffer Objects": 372 373 (the first paragraph of RenderbufferStorageMultisample p. 204) 374 375 ... If either <width> or <height> is greater than the value of 376 MAX_RENDERBUFFER_SIZE, then the error INVALID_VALUE is generated. If 377 <samples> is greater than the maximum number of samples supported for 378 <sizedinternalformat>, then the error INVALID_OPERATION is generated (see 379 GetInternalformativ in section 6.1.15). If the GL is unable to create 380 a data store of the requested size, the error OUT_OF_MEMORY is generated. 381 382 (the third paragraph of "Required Renderbuffer Formats" p. 205): 383 384 Implementations must support creation of renderbuffers in these 385 required formats with up to the value of MAX_SAMPLES multisamples, 386 with the exception that the signed and unsigned integer formats are 387 required only to support creation of renderbuffers with up to the 388 value of MAX_INTEGER_SAMPLES_ANGLE multisamples, which must be at 389 least one. 390 391 (modify section 4.4.2.4 "Attaching Texture Images to a Framebuffer", 392 describing FrameBufferTexture2D p. 207) 393 394 If texture is not zero, then texture must either name an existing 395 two-dimensional texture object and textarget must be TEXTURE_2D, texture 396 must name an existing cube map texture and textarget must be one of the 397 cube map face targets from table 3.21, or texture must name an existing 398 multisample texture and textarget must be TEXTURE_2D_MULTISAMPLE_ANGLE. 399 Otherwise, an INVALID_OPERATION error is generated. 400 401 <level> specifies ... 402 403 If <textarget> is TEXTURE_2D_MULTISAMPLE_ANGLE, then <level> must be zero. 404 Otherwise, an INVALID_VALUE error is generated. If textarget is one of ... 405 406 407 Modify Section 4.4.4.2, "Whole Framebuffer Completeness": 408 409 (modify the last bullet at the top of p. 215) 410 411 - The value of RENDERBUFFER_SAMPLES is the same for all attached 412 renderbuffers; the value of TEXTURE_SAMPLES_ANGLE is the same for all 413 attached textures; and, if the attached images are a mix of 414 renderbuffers and textures, the value of RENDERBUFFER_SAMPLES 415 matches the value of TEXTURE_SAMPLES_ANGLE. 416 417 { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE } 418 419 (add one more bullet after the last bullet, p. 215) 420 421 - The value of TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE is the same for all 422 attached textures; and, if the attached images are a mix of renderbuffers 423 and textures, the value of TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE must be 424 TRUE for all attached textures. 425 426 { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE } 427 428Additions to Chapter 6 of the OpenGL ES 3.0.5 Specification (State and State 429Requests) 430 431 Modify Section 6.1.3, "Enumerated Queries": 432 433 (modify the paragraph describing the <target> parameter of 434 GetTexParameter*) 435 436 <target> may be one of TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, 437 TEXTURE_CUBE_MAP, or TEXTURE_2D_MULTISAMPLE_ANGLE, indicating the 438 currently bound two-dimensional, three-dimensional, two-dimensional 439 array, cube map, or two-dimensional multisample texture object, 440 respectively. 441 442 An INVALID_ENUM is generated if <target> is not one of the texture 443 targets described above. 444 An INVALID_ENUM is generated if <pname> is not one of the texture 445 parameters described above. 446 447 Modify Section 6.1.4 "Texture Queries": 448 449 (Add the following text to the end of the section) 450 451 The commands 452 453 void GetTexLevelParameter{if}vANGLE(enum target, int level, 454 enum pname, T *params ); 455 456 place information about texture image parameter <pname> for level-of-detail 457 <level> of the specified target into <params>. <pname> must be one of the 458 symbolic values in table 6.11. 459 460 <target> may be one of TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, one of 461 the cube map face targets from table 3.18, or TEXTURE_2D_MULTISAMPLE_ANGLE, 462 indicating the two- or three-dimensional texture, two-dimensional array 463 texture, one of the six distinct 2D images making up the cube map texture 464 object, or two-dimensional multisample texture. Otherwise an INVALID_ENUM is 465 generated. 466 467 <level> determines which level-of-detail's state is returned. If <level> 468 is negative or larger than the maximum allowable level-of-detail, then an 469 INVALID_VALUE error is generated. 470 471 Note that TEXTURE_CUBE_MAP is not a valid <target> parameter for 472 GetTexLevelParameter{if}vANGLE, because it does not specify a particular 473 cube map face. 474 475 For texture images with uncompressed internal formats, queries of 476 <pname> TEXTURE_RED_TYPE, TEXTURE_GREEN_TYPE, TEXTURE_BLUE_TYPE, 477 TEXTURE_ALPHA_TYPE, and TEXTURE_DEPTH_TYPE return the data type used 478 to store the component. Types NONE, SIGNED_NORMALIZED, UNSIGNED_- 479 NORMALIZED, FLOAT, INT, and UNSIGNED_INT respectively indicate missing, 480 signed normalized fixed-point, unsigned normalized fixed-point, 481 floating-point, signed unnormalized integer, and unsigned unnormalized 482 integer components. Queries of <pname> TEXTURE_RED_SIZE, TEXTURE_GREEN_SIZE, 483 TEXTURE_BLUE_SIZE, TEXTURE_ALPHA_SIZE, TEXTURE_DEPTH_SIZE, 484 TEXTURE_STENCIL_SIZE, and TEXTURE_SHARED_SIZE return the actual resolutions 485 of the stored image components, not the resolutions specified when the image 486 was defined. Invalid <pname> generate an INVALID_ENUM error. 487 488 For texture images with compressed internal formats, the types returned 489 specify how components are interpreted after decompression, while the 490 resolutions returned specify the component resolution of an uncompressed 491 internal format that produces an image of roughly the same quality as the 492 compressed image in question. Since the quality of the implementation's 493 compression algorithm is likely data-dependent, the returned component sizes 494 should be treated only as rough approximations. 495 496 Queries of <pname> TEXTURE_INTERNAL_FORMAT, TEXTURE_WIDTH, TEXTURE_HEIGHT, 497 and TEXTURE_DEPTH return the internal format, width, height, and depth, 498 respectively, as specified when the image array was created. 499 500 Queries of <pname> TEXTURE_SAMPLES_ANGLE, and 501 TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE on multisample textures return the 502 number of samples and whether texture sample fixed locations are enabled, 503 respectively. For non-multisample texture, the default values 0 and TRUE 504 as in new added table 6.11 are returned respectively. 505 506 Modify Section 6.1.15, "Internal Format Queries": 507 508 (modify the paragraph describing target as follows, p. 244) 509 510 <target> indicates the usage of the internalformat, and must be either 511 RENDERBUFFER or TEXTURE_2D_MULTISAMPLE_ANGLE, indicating the renderbuffer, 512 or two-dimensional multisample texture. Otherwise an INVALID_ENUM error 513 is generated. 514 515 (add the following paragraph after "Querying SAMPLES with a <bufSize> 516 ...") 517 518 The maximum value of SAMPLES is guaranteed to be at least the lowest of 519 the value of MAX_INTEGER_SAMPLES_ANGLE if internal format is a signed or 520 unsigned integer format, the value of MAX_DEPTH_TEXTURE_SAMPLES_ANGLE if 521 internalformat is a depth or stencil-renderable format and target is 522 TEXTURE_2D_MULTISAMPLE_ANGLE, the value of MAX_COLOR_TEXTURE_SAMPLES_ANGLE 523 if internal format is a color-renderable format and target is 524 TEXTURE_2D_MULTISAMPLE_ANGLE, or the value of MAX_SAMPLES. 525 526 (remove the last paragraph on p. 244) 527 "Since multisampling is not supported for signed and unsigned integer 528 internal formats, the value of NUM_SAMPLE_COUNTS will be zero for such 529 formats." 530 531 (modify to the first paragraph on p. 245) 532 When query every accepted <internalformat> on multisample renderbuffer or 533 texture, the value of NUM_SAMPLE_COUNTS is guaranteed to be at least 534 one, and the maximum value in SAMPLES is guaranteed to be at least the 535 value of MAX_SAMPLES. If <target> does not support multisample (is not 536 multisample renderbuffer or texture), the value of NUM_SAMPLE_COUNTS will 537 be zero for any accepted <internalformat>. 538 539Errors 540 541 The error INVALID_VALUE is generated by GetIntegeri_v if <target> is 542 SAMPLE_MASK_VALUE_ANGLE and <index> is greater than or equal to 543 MAX_SAMPLE_MASK_WORDS_ANGLE. 544 545 The error INVALID_VALUE is generated by SampleMaskiANGLE if <index> is 546 greater than or equal to MAX_SAMPLE_MASK_WORDS_ANGLE. 547 548 The error INVALID_ENUM is generated by TexStorage2DMultisampleANGLE if 549 <target> is not TEXTURE_2D_MULTISAMPLE_ANGLE. 550 551 The error INVALID_OPERATION is generated by TexStorage2DMultisampleANGLE 552 if zero is bound to <target>. 553 554 The error INVALID_VALUE is generated by TexStorage2DMultisampleANGLE if 555 <width> or <height> is less than 1 or greater than the value of 556 MAX_TEXTURE_SIZE. 557 558 The error INVALID_VALUE is generated by TexStorage2DMultisampleANGLE if 559 <samples> is zero. 560 561 The error INVALID_ENUM is generated by TexStorage2DMultisampleANGLE if 562 <sizedinternalformat> is not color-renderable, depth-renderable, or 563 stencil-renderable (as defined 564 in section 4.4.4). 565 566 The error INVALID_ENUM is generated by TexStorage2DMultisampleANGLE if 567 <sizedinternalformat> is one of the unsized base internal formats listed 568 in table 3.11. 569 570 The error INVALID_OPERATION is generated by TexStorage2DMultisampleANGLE 571 if <samples> is greater than the maximum number of samples supported for 572 this <target> and <sizedinternalformat>, The maximum number of samples 573 supported can be determined by calling GetInternalformativ with a <pname> 574 of SAMPLES (see section 6.1.15). 575 576 The error INVALID_OPERATION is generated by TexStorage2DMultisampleANGLE 577 if the value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound 578 to <target> on the active texture unit is TRUE. 579 580 The error OUT_OF_MEMORY is generated by TexStorage2DMultisampleANGLE 581 if the GL is unable to create a texture image of the requested size. 582 583 The error INVALID_ENUM is generated by GetMultisamplefvANGLE if <pname> 584 is not SAMPLE_POSITION_ANGLE. 585 586 The error INVALID_VALUE is generated by GetMultisamplefvANGLE if <index> 587 is greater than or equal to the value of SAMPLES. 588 589 The error INVALID_OPERATION is generated by RenderbufferStorageMultisample 590 if <sizedinternalformat> is a signed or unsigned integer format and 591 <samples> is greater than the value of MAX_INTEGER_SAMPLES_ANGLE. 592 593 The error INVALID_OPERATION is generated by TexParameter* if <target> is 594 TEXTURE_2D_MULTISAMPLE_ANGLE, <pname> is TEXTURE_BASE_LEVEL, and <value> 595 is not zero. 596 597 The error INVALID_OPERATION is generated by TexParameter* if <target> is 598 TEXTURE_2D_MULTISAMPLE_ANGLE and <pname> is sampler state value from table 599 6.10. 600 601 The error INVALID_ENUM is generated by GetTexLevelParameter{if}vANGLE 602 if <target> is not one of TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, one of 603 the cube map face targets from table 3.18, or TEXTURE_2D_MULTISAMPLE_ANGLE. 604 605 The error INVALID_VALUE is generated by GetTexLevelParameter{if}vANGLE 606 if <level> is negative or larger than the maximum allowable level-of-detail. 607 608 The error INVALID_ENUM is generated by GetTexLevelParameter{if}vANGLE 609 if <value> is not one of TEXTURE_RED_TYPE, TEXTURE_GREEN_TYPE, 610 TEXTURE_BLUE_TYPE, TEXTURE_ALPHA_TYPE, TEXTURE_DEPTH_TYPE, 611 TEXTURE_DEPTH_SIZE, TEXTURE_STENCIL_SIZE, TEXTURE_SHARED_SIZE, 612 TEXTURE_SAMPLES_ANGLE, TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE, TEXTURE_WIDTH, 613 TEXTURE_HEIGHT, TEXTURE_DEPTH, TEXTURE_INTERNAL_FORMAT, TEXTURE_RED_SIZE, 614 TEXTURE_GREEN_SIZE, TEXTURE_BLUE_SIZE, TEXTURE_ALPHA_SIZE, 615 or TEXTURE_COMPRESSED. 616 617New State 618 619 (add to table 6.7, Multisampling p. 252) 620 621 Initial 622 Get Value Type Get Command Value Description Sec. 623 --------- ---- ----------- ------- ---------------------- ----- 624 SAMPLE_MASK_ANGLE B IsEnabled FALSE Additional sample mask 4.1.3 625 SAMPLE_MASK_VALUE_ANGLE nxZ+ GetIntegeri_v ~0 Additional sample mask value 4.1.3 626 627 Where n is the number of sample mask words (the value of 628 MAX_SAMPLE_MASK_WORDS_ANGLE) the implementation supports. 629 630 (add to table 6.8, Textures (selector, state per texture unit) p. 253) 631 632 Initial 633 Get Value Type Get Command Value Description Sec. 634 ------------------------------------ ---- ----------- ------ --------------------------- ----- 635 TEXTURE_BINDING_2D_MULTISAMPLE_ANGLE 32*xZ+ GetIntegerv 0 Texture object bound to 3.8.1 636 TEXTURE_2D_MULTISAMPLE_ANGLE 637 638 (add new table 6.10, Textures (state per texture image), renumber subsequent tables) 639 640 Initial 641 Get Value Type Get Command Value Description Sec. 642 ---------------------- ---- ------------------- ------ --------------------------- ------ 643 TEXTURE_SAMPLES_ANGLE Z+ GetTexLevelParameterANGLE 0 Number of samples per texel 3.8.5 644 TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE B GetTexLevelParameterANGLE TRUE Whether the image uses a 3.8.5 645 fixed sample pattern 646 647 TEXTURE_WIDTH Z+ GetTexLevelParameterANGLE 0 Specified width 3.8 648 TEXTURE_HEIGHT Z+ GetTexLevelParameterANGLE 0 Specified height (2D/3D) 3.8 649 TEXTURE_DEPTH Z+ GetTexLevelParameterANGLE 0 Specified depth (3D) 3.8 650 TEXTURE_INTERNAL_FORMAT E GetTexLevelParameterANGLE RGBA Internal format 3.8 651 or R8 (see section 3.8.14) 652 TEXTURE_x_SIZE 6xZ+ GetTexLevelParameterANGLE 0 Component resolution (x is 3.8 653 RED, GREEN, BLUE, ALPHA, 654 DEPTH, or STENCIL) 655 TEXTURE_SHARED_SIZE Z+ GetTexLevelParameterANGLE 0 Shared exponent field 3.8 656 resolution 657 TEXTURE_x_TYPE E GetTexLevelParameterANGLE NONE Component type (x is RED, 6.1.4 658 GREEN, BLUE, ALPHA, or 659 DEPTH) 660 TEXTURE_COMPRESSED B GetTexLevelParameterANGLE FALSE True if image has a 3.8.6 661 compressed internal format 662 663 (add to table 6.35, Framebuffer dependent Values, p. 280) 664 665 Initial 666 Get Value Type Get Command Value Description Sec. 667 ------------------ ---------- ------------------ -------------- --------------- ------ 668 SAMPLE_POSITION_ANGLE N*2*R[0,1] GetMultisamplefvANGLE implementation Explicit sample 3.3.1 669 dependent positions 670 671 Where N is the number of samples (the value of SAMPLES) the framebuffer supports. 672 673New Implementation Dependent State 674 675 Minimum 676 Get Value Type Get Command Value Description Sec. 677 --------- ------- ----------- ------- ------------------------ ------ 678 MAX_SAMPLE_MASK_WORDS_ANGLE Z+ GetIntegerv 1 maximum number of sample 4.1.3 679 mask words 680 MAX_COLOR_TEXTURE_SAMPLES_ANGLE Z+ GetIntegerv 1 maximum number of samples 4.1.3 681 in a color multisample 682 texture 683 MAX_DEPTH_TEXTURE_SAMPLES_ANGLE Z+ GetIntegerv 1 maximum number of samples 4.1.3 684 in a depth/stencil 685 multisample texture 686 MAX_INTEGER_SAMPLES_ANGLE Z+ GetIntegerv 1 Maximum number of samples 4.4.2 687 in integer format 688 multisample buffers 689 690Modifications to the OpenGL ES Shading Language Specification, Version 3.00, 691Document Revision 6 692 693 Including the following line in a shader can be used to control the 694 language featured described in this extension: 695 696 #extension GL_ANGLE_texture_multisample : <behavior> 697 698 where <behavior> is as specified in section 3.5. 699 700 A new preprocessor #define is added to the OpenGL ES Shading Language: 701 702 #define GL_ANGLE_texture_multisample 1 703 704 Add to section 3.8 "Keywords": 705 706 The following new sampler types are added: 707 708 sampler2DMS, isampler2DMS, usampler2DMS, 709 710 Add to section 4.1 "Basic Types": 711 712 Add the following sampler type to the "Floating Point Sampler 713 Types (opaque)" table: 714 715 sampler2DMS handle for accessing a 2D multisample texture 716 717 Add the following sampler type to the "Unsigned Integer Sampler 718 Types (opaque)" table: 719 720 usampler2DMS handle for accessing an unsigned integer 2D 721 multisample texture 722 723 Add the following sampler type to the "Integer Sampler Types" table: 724 725 isampler2DMS handle for accessing an integer 2D 726 multisample texture 727 728 Add to section 8.8 "Texture Lookup Functions": 729 730 Add new functions to the set of allowed texture lookup functions: 731 732 Syntax: 733 734 gvec4 texelFetch(gsampler2DMS sampler, ivec2 P, int sample) 735 736 Description: 737 738 Use integer texture coordinate <P> to lookup a single sample 739 <sample> on the texture bound to <sampler> as described in section 740 2.12.9.3 of the OpenGL ES specification "Multisample Texel Fetches". 741 742 Syntax: 743 744 ivec2 textureSize(gsampler2DMS sampler) 745 746 Description: 747 748 Returns the dimensions, width and height of level 0 for the 749 texture bound to <sampler>, as described in section 2.12.9.4 of 750 the OpenGL ES specification section "Texture Size Query". 751 752Examples 753 754Issues 755 None 756 757Revision History 758 759 Rev. Date Author Changes 760 ---- -------- ---------- -------------------------------------------- 761 1 08/27/18 Yunchao He First revision. Adapted from OpenGL ES 762 specification 3.1, OpenGLSL ES specification 763 3.10 at document revision 4, and 764 ARB_texture_multisample at revision 12. 765