• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    ARB_texture_multisample
4
5Name Strings
6
7    ARB_texture_multisample
8
9Contact
10
11    Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com)
12
13Notice
14
15    Copyright (c) 2009-2014 The Khronos Group Inc. Copyright terms at
16        http://www.khronos.org/registry/speccopyright.html
17
18Status
19
20    Complete. Approved by the ARB on July 3, 2009.
21
22Version
23
24    Last Modified Date:         February 28, 2014
25    Revision:                   12
26
27Number
28
29    ARB Extension #67
30
31Dependencies
32
33    This extension is written against the OpenGL 3.1 specification.
34
35Overview
36
37    This extension provides support for two new types of "multisample
38    textures" - two-dimensional and two-dimensional array - as well as
39    mechanisms to fetch a specific sample from such a texture in a shader,
40    and to attach such textures to FBOs for rendering.
41
42    This extension also includes the following functionality, first described
43    in NV_explicit_multisample:
44
45     * A query in the API to query the location of samples within the pixel
46
47     * An explicit control for the multisample sample mask to augment the
48       control provided by SampleCoverage
49
50New Procedures and Functions
51
52    void TexImage2DMultisample(enum target, sizei samples, enum internalformat,
53                               sizei width, sizei height,
54                               boolean fixedsamplelocations);
55
56    void TexImage3DMultisample(enum target, sizei samples, enum internalformat,
57                               sizei width, sizei height, sizei depth,
58                               boolean fixedsamplelocations);
59
60    void GetMultisamplefv(enum pname, uint index, float *val);
61
62    void SampleMaski(uint index, bitfield mask);
63
64New Tokens
65
66    Accepted by the <pname> parameter of GetMultisamplefv:
67
68        SAMPLE_POSITION                             0x8E50
69
70    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
71    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
72    GetDoublev:
73
74        SAMPLE_MASK                                 0x8E51
75
76    Accepted by the <target> parameter of GetBooleani_v and
77    GetIntegeri_v:
78
79        SAMPLE_MASK_VALUE                           0x8E52
80
81    Accepted by the <target> parameter of BindTexture and
82    TexImage2DMultisample:
83
84        TEXTURE_2D_MULTISAMPLE                      0x9100
85
86    Accepted by the <target> parameter of TexImage2DMultisample:
87
88        PROXY_TEXTURE_2D_MULTISAMPLE                0x9101
89
90    Accepted by the <target> parameter of BindTexture and
91    TexImage3DMultisample:
92
93        TEXTURE_2D_MULTISAMPLE_ARRAY                0x9102
94
95    Accepted by the <target> parameter of TexImage3DMultisample:
96
97        PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY          0x9103
98
99    Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
100    and GetFloatv:
101
102        MAX_SAMPLE_MASK_WORDS                       0x8E59
103        MAX_COLOR_TEXTURE_SAMPLES                   0x910E
104        MAX_DEPTH_TEXTURE_SAMPLES                   0x910F
105        MAX_INTEGER_SAMPLES                         0x9110
106        TEXTURE_BINDING_2D_MULTISAMPLE              0x9104
107        TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY        0x9105
108
109    Accepted by the <pname> parameter of GetTexLevelParameter
110
111        TEXTURE_SAMPLES                             0x9106
112        TEXTURE_FIXED_SAMPLE_LOCATIONS              0x9107
113
114    Returned by the <type> parameter of GetActiveUniform:
115
116        SAMPLER_2D_MULTISAMPLE                      0x9108
117        INT_SAMPLER_2D_MULTISAMPLE                  0x9109
118        UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE         0x910A
119        SAMPLER_2D_MULTISAMPLE_ARRAY                0x910B
120        INT_SAMPLER_2D_MULTISAMPLE_ARRAY            0x910C
121        UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY   0x910D
122
123Additions to Chapter 2 of the OpenGL 3.1 Specification (OpenGL Operation)
124
125    Add to table 2.9 "OpenGL Shading Language type tokens" page 56:
126
127    Type Name Token                              Keyword
128    -----------------------------------------    ------------
129    SAMPLER_2D_MULTISAMPLE                       sampler2DMS
130    SAMPLER_2D_MULTISAMPLE_ARRAY                 sampler2DMSArray
131    INT_SAMPLER_2D_MULTISAMPLE_ARRAY             isampler2DMSArray
132    UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE          usampler2DMS
133    UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY    usampler2DMSArray
134
135    Add to section 2.11.7, after subsection "Texel Fetches"
136
137    Multisample Texel Fetches
138
139    Multisample texel fetches are similar to standard texel fetches.
140    Since multisample buffers can't have mipmaps, there is no LOD
141    parameter. Instead, there is an integer parameter which selects the
142    sample number to be fetched from the buffer. The number identifying
143    the sample is the same as the value used to query the sample
144    location using GetMultisamplefv. Multisample textures support only
145    NEAREST filtering.
146
147    Additionally, this fetch may only be performed on a multisample
148    texture sampler. No other sample or fetch commands may be performed
149    on a multisample texture sampler.
150
151Additions to Chapter 3 of the OpenGL 3.1 Specification (Rasterization)
152
153    (Insert into section 3.3.1, Multisampling after the discussion of
154    the query for SAMPLES)
155
156    The location of a given sample is queried with the command
157
158        void GetMultisamplefv(enum pname, uint index, float *val);
159
160    <pname> must be SAMPLE_POSITION and <index> corresponds to the
161    sample for which the location should be returned. The sample
162    location is returned as two floating point values in <val[0]> and
163    <val[1]>, each between 0 and 1, corresponding to the <x> and <y>
164    locations respectively in GL pixel space of that sample. (0.5, 0.5)
165    thus corresponds to the pixel center. An INVALID_ENUM error is
166    generated if <pname> is not SAMPLE_POSITION. An INVALID_VALUE error
167    is generated if <index> is greater than or equal to the value of
168    SAMPLES. If the multisample mode does not have fixed sample
169    locations, the returned values may only reflect the locations of
170    samples within some pixels.
171
172    Modify Section 3.8.1, Texture Image Specification (p. 143)
173
174    Add the two new targets to MAX_TEXTURE_SIZE description:
175
176    In a similar fashion, the maximum allowable width of a texel array
177    for a one or two-dimensional, one- or two-dimensional array,
178    two-dimensional multisample, or two-dimensional multisample array
179    texture, and the maximum allowable height of a two-dimensional,
180    two-dimensional array, two- dimensional multisample, or
181    two-dimensional multisample array texture, must be at least
182    2^(k-lod)+2*b_t for image arrays of level 0 through k, where k is
183    the log base 2 of MAX_TEXTURE_SIZE.
184
185    (Insert new Section 3.8.4, Multisample Textures.  Renumber subsequent
186    sections.)
187
188    In addition to the texture types described in previous sections, two
189    additional types of textures are supported. A multisample texture is
190    similar to a two-dimensional or two-dimensional array texture,
191    except it contains multiple samples per texel. Multisample textures
192    do not have multiple image levels.
193
194    The commands
195
196        void TexImage2DMultisample(enum target, sizei samples,
197                                   enum internalformat,
198                                   sizei width, sizei height,
199                                   boolean fixedsamplelocations);
200
201        void TexImage3DMultisample(enum target, sizei samples,
202                                   enum internalformat,
203                                   sizei width, sizei height, sizei depth,
204                                   boolean fixedsamplelocations);
205
206    establish the data storage, format, dimensions, and number of
207    samples of a multisample texture's image. For TexImage2DMultisample,
208    <target> must be TEXTURE_2D_MULTISAMPLE or
209    PROXY_TEXTURE_2D_MULTISAMPLE and for TexImage3DMultisample <target>
210    must be TEXTURE_2D_MULTISAMPLE_ARRAY or
211    PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY. <width> and <height> are the
212    dimensions in texels of the texture.
213
214    <internalformat> must be color-renderable, depth-renderable, or
215    stencil- renderable (as defined in section 4.4.4). The error
216    INVALID_OPERATION may be generated if any of the following are true:
217
218    * <internalformat> is a depth/stencil-renderable format and
219      <samples> is greater than the value of MAX_DEPTH_TEXTURE_SAMPLES
220    * <internalformat> is a color-renderable format and <samples> is
221      greater than the value of MAX_COLOR_TEXTURE_SAMPLES
222    * <internalformat> is a signed or unsigned integer format and
223      <samples> is greater than the value of MAX_INTEGER_SAMPLES.
224
225    If <fixedsamplelocations> is TRUE, the image will use identical
226    sample locations and the same number of samples for all texels in
227    the image, and the sample locations will not depend on the
228    internalformat or size of the image.
229
230    An INVALID_VALUE error is generated by TexImage2DMultisample if <width>
231    or <height> is greater than the value of MAX_TEXTURE_SIZE. An
232    INVALID_VALUE error is generated by TexImage3DMultisample if <width>,
233    <height>, or <depth> is greater than the value of MAX_3DTEXTURE_SIZE; An
234    INVALID_VALUE error is generated if <samples> is greater than the value
235    of MAX_SAMPLES. An OUT_OF_MEMORY error is generated if the GL is unable
236    to create a texture level of the requested size.
237
238    When a multisample texture is accessed in a shader, the access takes
239    one vector of integers describing which texel to fetch and an
240    integer corresponding to the sample numbers described in section
241    3.3.1 describing which sample within the texel to fetch. No standard
242    sampling instructions are allowed on the multisample texture
243    targets.
244
245    Modify Section 3.8.11, Texture Completeness (p. 154)
246
247    (insert after first paragraph of section, p. 154)
248
249    For multisample textures, a texture is complete if each dimension of
250    the texture's level is positive.
251
252    Modify Section 3.8.12, Texture State and Proxy State (p. 155)
253
254    (insert into the first paragraph of the section, p. 155)
255
256    ... the compressed flag set to FALSE, and a zero compressed size).
257    Multisample textures contain an integer identifying the number of
258    samples in each texel. The buffer texture target has associated an
259    integer containing ...
260
261    (add a new paragraph after the paragraph starting with "Proxy Arrays...")
262
263    Proxy array for two-dimensional multisample and two-dimensional
264    multisample array textures are operated on in the same way when
265    TexImage2DMultisample is called with <target> specified as
266    PROXY_TEXTURE_2D_MULTISAMPLE, or TexImage3DMultisample is called
267    with <target> specified as PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY.
268
269    Modify Section 3.8.13, Texture Objects (p. 157)
270
271    (modify first paragraphs of section, p. 157, simply adding
272     references to multisample textures)
273
274    In addition to the default textures TEXTURE_1D, TEXTURE_2D,
275    TEXTURE_3D, TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_RECTANGLE,
276    TEXTURE_BUFFER, TEXTURE_CUBE_MAP, TEXTURE_2D_MULTISAMPLE, and
277    TEXTURE_2D_MULTISAMPLE_ARRAY, named one-, two-, and
278    three-dimensional, one- and two-dimensional array, rectangular,
279    buffer, cube map, two-dimensional multisample, and two- dimensional
280    multisample array texture objects can be created and operated upon.
281    The name space for texture objects is the unsigned integers, with
282    zero reserved by the GL.
283
284    ...
285
286    In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
287    TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_RECTANGLE,
288    TEXTURE_BUFFER, TEXTURE_CUBE_MAP, TEXTURE_2D_MULTISAMPLE, and
289    TEXTURE_2D_MULTISAMPLE_ARRAY have one-, two-, and three-dimensional,
290    one- and two-dimensional array, rectangular, buffer, cube map,
291    two-dimensional multisample, and two-dimensional multisample array
292    texture state vectors respectively associated with them. In order
293    that access to these initial textures not be lost, they are treated
294    as texture objects all of whose names are 0. The initial one-, two-,
295    three- dimensional, one- and two-dimensional array, rectangular,
296    buffer, cube map, two-dimensional multisample, and two-dimensional
297    multisample array texture is therefore operated upon, queried, and
298    applied as TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY,
299    TEXTURE_2D_ARRAY, TEXTURE_RECTANGLE, TEXTURE_BUFFER,
300    TEXTURE_CUBE_MAP, TEXTURE_2D_MULTISAMPLE, and
301    TEXTURE_2D_MULTISAMPLE_ARRAY respectively while 0 is bound to the
302    corresponding targets.
303
304    (modify second paragraph, p. 158)
305
306    The texture object name space, including the initial one-, two-, and
307    three-dimensional, one- and two-dimensional array, rectangular,
308    buffer, cube map, two-dimensional multisample, and two-dimensional
309    multisample array texture objects, is shared among all texture
310    units. A texture object may be bound to more than one texture unit
311    simultaneously. After a texture object is bound, any GL operations
312    on that target object affect any other texture units to which the
313    same texture object is bound.
314
315Additions to Chapter 4 of the OpenGL 3.1 Specification (Per-Fragment
316Operations and the Frame Buffer)
317
318    Modify Section 4.1.3, Multisample Fragment Operations
319
320    Modify the first paragraph to include SAMPLE_MASK and
321    SAMPLE_MASK_VALUE on the list of values the coverage value is
322    modified based on.
323
324    Modify the discussion of SAMPLE_COVERAGE to start with "Next" instead of
325    "Finally"
326
327    Add after the discussion of SAMPLE_COVERAGE:
328
329    Finally, if SAMPLE_MASK is enabled, the fragment coverage is ANDed
330    with the coverage value SAMPLE_MASK_VALUE. The value of
331    SAMPLE_MASK_VALUE is specified using
332
333        void SampleMaski(GLuint index, GLbitfield mask);
334
335    with <mask> set to the desired mask for <maskNumber>.
336    SAMPLE_MASK_VALUE is queried by calling GetIntegeri_v with <pname>
337    set to SAMPLE_MASK_VALUE and the index set to <maskNumber>. Bit B of
338    mask M corresponds to sample 32*M+B as described in Section 3.3.1.
339    The error INVALID_VALUE is generated if the mask word indexed is
340    greater than or equal to MAX_SAMPLE_MASK_WORDS.
341
342    Modify Section 4.4.2, Attaching Images to Framebuffer Objects, p. 203
343
344    (the first paragraph of RenderbufferStorageMultisample p. 205)
345
346    ... If either <width> or <height> is greater than the value of
347    MAX_RENDERBUFFER_SIZE, or if <samples> is greater than the value of
348    MAX_SAMPLES, then the error INVALID_VALUE is generated. If
349    <internalformat> is a signed or unsigned integer format and
350    <samples> is greater than the value of MAX_INTEGER_SAMPLES, then the
351    error INVALID_OPERATION is generated. (see ``Required Renderbuffer
352    Formats'' below). ...
353
354    (The second paragraph of "Required Renderbuffer Formats" p. 206):
355
356    Implementations must support creation of renderbuffers in these
357    required formats with up to the value of MAX_SAMPLES multisamples,
358    with the exception that the signed and unsigned integer formats are
359    required only to support creation of renderbuffers with up to the
360    value of MAX_INTEGER_SAMPLES multisamples, which must be at least
361    one.
362
363    Modify the description of FrameBufferTextureARB in
364    ARB_geometry_shader4, to allow multisample array textures with
365    FramebufferTextureARB:
366
367    If <texture> is the name of a three-dimensional texture, cube map
368    texture, one- or two-dimensional array texture, or two-dimensional
369    multisample array texture, the texture level attached to the
370    framebuffer attachment point is an array of images, and the
371    framebuffer attachment is considered layered.
372
373    (At the end of p. 208, describing FrameBufferTexture*D)
374
375    If <textarget> is TEXTURE_RECTANGLE, TEXTURE_2D_MULTISAMPLE, or
376    TEXTURE_2D_MULTISAMPLE_ARRAY, then <level> must be zero.
377
378    ...
379
380    For FramebufferTexture2D, if <texture> is not zero, then <textarget>
381    must be one of of TEXTURE_2D, TEXTURE_RECTANGLE,
382    TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
383    TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_X,
384    TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Z, or
385    TEXTURE_2D_MULTISAMPLE.
386
387    ...
388
389    The command
390
391        void FramebufferTextureLayer(enum target, enum attachment,
392                                     uint texture, int level, int layer);
393
394    operates identically to FramebufferTexture3D, except that it
395    attaches a single layer of a three-dimensional, one- or
396    two-dimensional array, or two-dimensional multisample array texture
397    layer is an integer indicating the layer sample number, and is
398    treated identically to the layer parameter in FramebufferTexture3D.
399    The error INVALID_VALUE is generated if texture is non-zero and
400    layer is negative. The error INVALID_OPERATION is generated if
401    texture is non-zero and is not the name of a three dimensional, two-
402    dimensional multisample array, or one-or two-dimensional array
403    texture. Unlike FramebufferTexture3D, no textarget parameter is
404    accepted. ...
405
406
407    Modify Section 4.4.4, Framebuffer Completeness, p. 212
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 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.
416
417      { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE }
418
419    - The value of TEXTURE_FIXED_SAMPLE_LOCATIONS is the same for all
420      attached textures; if the attached images are a mix of
421      renderbuffers and textures, the value of
422      TEXTURE_FIXED_SAMPLE_LOCATIONS must be TRUE for all attached
423      textures.
424
425      { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE }
426
427Additions to Chapter 6 of the OpenGL 3.1 Specification (State and
428State Requests)
429
430    Edit Section 6.1.3, p. 223 (Enumerated Queries)
431
432    Add TEXTURE_2D_MULTISAMPLE, PROXY_TEXTURE_2D_MULTISAMPLE,
433    TEXTURE_2D_MULTISAMPLE_ARRAY, and PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY
434    to the list of valid targets for GetTexLevelParameter{if}v.
435
436Additions to the AGL/GLX/WGL Specifications
437
438    None
439
440GLX Protocol
441
442    TBD
443
444Errors
445
446    The error INVALID_VALUE is generated by GetBooleani_v and
447    GetIntegeri_v if <target> is SAMPLE_MASK_VALUE and <index> is greater
448    than or equal to MAX_SAMPLE_MASK_WORDS.
449
450    The error INVALID_VALUE is generated by SampleMaski if <index> is
451    greater than or equal to MAX_SAMPLE_MASK_WORDS.
452
453    The error INVALID_ENUM is generated by GetMultisamplefv if <pname>
454    is not SAMPLE_POSITION.
455
456    The error INVALID_VALUE is generated by GetMultisamplefv if <index> is
457    greater than or equal to the value of SAMPLES.
458
459    The error INVALID_OPERATION is generated by TexImage2DMultisample
460    and TexImage3DMultisample if the number of samples exceeds the
461    implementation dependent maximum for the given internal format.
462
463    The error INVALID_VALUE is generated by TexImage2DMultisample
464    TexImage3DMultisample if either <width> or <height> is greater than the
465    value of MAX_TEXTURE_SIZE, or if <samples> is greater than the value of
466    MAX_SAMPLES.
467
468    The error INVALID_VALUE is generated by TexImage3DMultisample if
469    <width>, <height>, or <depth> is greater than the value of
470    MAX_3D_TEXTURE_SIZE, or if <samples> is greater than the value of
471    MAX_SAMPLES.
472
473    The error OUT_OF_MEMORY is generated by TexImage2DMultisample and
474    TexImage3DMultisample if the GL is unable to create a texture level
475    of the requested size.
476
477    The error INVALID_OPERATION is generated by
478    RenderbufferStorageMultisample if <internalformat> is a signed or
479    unsigned integer format and <samples> is greater than the value of
480    MAX_INTEGER_SAMPLES.
481
482New State
483
484    Get Value                       Get Command    Type    Initial Value
485    ---------                       -----------    ----    -------------
486    SAMPLE_MASK                     IsEnabled      B       FALSE
487    SAMPLE_MASK_VALUE               GetIntegeri_v  nxZ+    ~0
488
489    Where n is the number of sample mask words (the value of
490    MAX_SAMPLE_MASK_WORDS) the implementation supports.
491
492    (add to table 6.12, Texture State Per Texture Unit/Binding Point p. 250)
493
494                                                               Initial
495    Get Value                              Type    Get Command  Value  Description                 Sec.
496    ------------------------------------   ----     ----------- ------- --------------------------- ------
497    TEXTURE_BINDING_2D_MULTISAMPLE        32*xZ+   GetIntegerv    0    Texture object bound to     3.8.13
498                                                                       TEXTURE_2D_MULTISAMPLE
499    TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY  32*xZ+   GetIntegerv    0    Texture object bound to     3.8.13
500                                                                       TEXTURE_2D_MULTISAMPLE_ARRAY
501
502    (add to table 6.14, Textures (state per texture image p. 252)
503
504                                                                Initial
505    Get Value                       Type  Get Command            Value  Description                 Sec.
506    ----------------------          ----  -------------------   ------- --------------------------- ------
507    TEXTURE_SAMPLES                  Z+   GetTexLevelParameter     0    Number of samples per texel 3.8.4
508    TEXTURE_FIXED_SAMPLE_LOCATIONS   B    GetTexLevelParameter   TRUE   Whether the image uses a    3.8.4
509                                                                        fixed sample pattern
510
511    (add to table 6.41, Framebuffer dependent Values, p. 279)
512
513                                                        Initial
514    Get Value           Type        Get Command         Value           Description      Sec.
515    ------------------  ----------  ------------------  --------------  ---------------  ------
516    SAMPLE_POSITION     N*2*R[0,1]  GetMultisamplefv    implementation  Explicit sample  3.2.1
517                                                        dependent       positions
518
519    Where N is the number of samples (the value of SAMPLES) the framebuffer supports.
520
521New Implementation Dependent State
522
523                                                      Minimum
524    Get Value                    Type    Get Command  Value   Description                   Sec.
525    ---------                    ------- -----------  ------- ------------------------      ------
526    MAX_SAMPLE_MASK_WORDS        Z+      GetIntegerv  1       maximum number of sample      4.1.3
527                                                              mask words
528    MAX_COLOR_TEXTURE_SAMPLES    Z+      GetIntegerv  1       maximum number of samples     4.1.3
529                                                              in a color multisample
530                                                              texture
531    MAX_DEPTH_TEXTURE_SAMPLES    Z+      GetIntegerv  1       maximum number of samples     4.1.3
532                                                              in a depth/stencil
533                                                              multisample texture
534    MAX_INTEGER_SAMPLES          Z+      GetIntegerv  1       Maximum number of samples     4.4.2
535                                                              in integer format
536                                                              multisample buffers
537
538Modifications to the OpenGL Shading Language Specification, Version 1.40
539
540    Including the following line in a shader can be used to control the
541    language featured described in this extension:
542
543      #extension GL_ARB_texture_multisample : <behavior>
544
545    where <behavior> is as specified in section 3.3.
546
547    A new preprocessor #define is added to the OpenGL Shading Language:
548
549      #define GL_ARB_texture_multisample 1
550
551    Add to section 3.6 "Keywords"
552
553    The following new sampler types are added:
554
555      sampler2DMS, isampler2DMS, usampler2DMS,
556      sampler2DMSArray, isampler2DMSArray, usampler2DMSArray
557
558    Add to section 4.1 "Basic Types"
559
560    Add the following sampler type to the "Floating Point Sampler Types"
561    table:
562
563      sampler2DMS                handle for accessing a 2D multisample texture
564      sampler2DMSArray           handle for accessing a 2D multisample array texture
565
566    Add the following sampler type to the "Unsigned Integer Sampler
567    Types" table:
568
569      usampler2DMS               handle for accessing an unsigned integer 2D multisample texture
570      usampler2DMSArray          handle for accessing an unsigned integer 2D multisample array texture
571
572    Add the following sampler type to the "Integer Sampler Types" table:
573
574      isampler2DMS               handle for accessing an integer 2D multisample texture
575      isampler2DMSArray          handle for accessing an integer 2D multisample array texture
576
577    Add to section 8.7 "Texture Lookup Functions"
578
579    Add new functions to the set of allowed texture lookup functions:
580
581    Syntax:
582
583      gvec4 texelFetch(gsampler2DMS sampler, ivec2 P, int sample)
584      gvec4 texelFetch(gsampler2DMSArray sampler, ivec3 P, int sample)
585
586    Description:
587
588      Use integer texture coordinate <P> to lookup a single sample
589      <sample> on the texture bound to <sampler> as described in section
590      2.11.7.1 of the OpenGL specification "Multisample Texel Fetches".
591
592    Syntax:
593
594      ivec2 textureSize(gsampler2DMS sampler)
595      ivec3 textureSize(gsampler2DMSArray sampler)
596
597    Description:
598
599      Returns the dimensions, width and height of level 0 for the
600      texture bound to <sampler>, as described in section 2.11.7.1 of
601      the OpenGL specification section "Texture Size Query".
602
603Examples
604
605Issues
606
607    (1) Do we need new "max size" queries for the new targets?
608
609    RESOLVED: No. The existing MAX_TEXTURE_SIZE applies to 2D multisample
610    textures, and MAX_3D_TEXTURE_SIZE to 3D multisample textures.
611
612    (2) What commands may be used on multisample textures?
613
614    RESOLVED: Multisample textures can be bound for rendering and texturing,
615    but they cannot be loaded/read with SubImage commands (TexSubImage,
616    CopyTexSubImage, GetTexImage), they don't support compressed formats,
617    and they don't need TexParameters since they can only be fetched with
618    texelFetchMultisample.
619
620    (3) Should the new TexImage commands take an "int level" argument?
621
622    RESOLVED: No. We can add new commands if/when we ever add mipmapped
623    multisample textures.
624
625    (4) GetMultisamplefv takes an index to support >32 samples, but
626        NV_gpu_shader4_1's gl_SampleMask is only 32 bits. What gives?
627
628    RESOLVED: This is gpu_shader4_1's problem, not ARB_texture_multisample's
629    problem.
630
631    (5) Should GLSL include a query to return the sample count of a
632        texture, either as part of textureSizeMultisample or
633        stand-alone?
634
635    RESOLVED: No, there hasn't been a demand for it.
636
637    (6) How does SAMPLE_POSITION interact with
638        EXT_fragment_coord_conventions?
639
640    RESOLVED: The SAMPLE_POSITION query is not in any way affected by
641    the shader state added in EXT_fragment_coord_conventions. It is
642    expected that the returned values will not actually be used within
643    the shader, but rather to compute filter weights on the CPU, so
644    whether the fragment coord is inverted or translated by 0.5 doesn't
645    matter.
646
647    (7) Should we use "TexImage3DMultisample" to make things look like
648        regular 2D arrays, or just have TexImage2DArrayMultisample?
649
650    RESOLVED: Leave it as is.
651
652    (8) How should we deal with varying sample locations?
653
654    RESOLVED: Allow the application to explicitly request fixed sample
655    locations for when a texture will be used to do custom downsamples.
656    When this is requested, the values returned by GetMultisamplefv will
657    be valid for all texels in the image and can be used to construct
658    elaborate filter kernels that can safely be used across the entire
659    image.
660
661    (9) Are depth multisample textures supported?
662
663    RESOLVED: Some implementations may not support texturing from a
664    multisample depth/stencil texture. In that case, they would export
665    MAX_DEPTH_TEXTURE_SAMPLES = 1.
666
667Revision History
668
669    Rev.    Date    Author    Changes
670    ----  --------  --------  -----------------------------------------------
671    12    2/28/14   Jon Leech Add missing error for invalid <pname> to
672                              GetMultisamplefv, and change texture size
673                              limits for TexImage3DMultisample to the value
674                              of MAX_3D_TEXTURE_SIZE (Bugs 11134, 11135).
675    11    9/23/13   Jon Leech Change type of <internalformat> argument to
676                              enum (Bug 10496).
677    10    8/02/09   Jon Leech Reformat to 80 columns and assign ARB
678                              extension number.
679    9     7/23/09   groth     Update return of textureSize(gsampler2DMSarray)
680    8     7/20/09   Jon Leech Assign enum values.
681    7     6/26/09   groth     Update some language to correspond to gl3.2
682    6     6/11/09   groth     Add new max queries to token section
683    5     5/28/09   groth     Add MAX_INTEGER_SAMPLES query.
684    4     5/22/09   jbolz     Add max sample queries.
685    3     5/14/09   jbolz     Add allowance for not supporting multisample
686                              depth textures.
687    2     5/08/09   jbolz     Add allowance for varying sample locations,
688                              and a mechanism to request fixed locations.
689                              Resolve some issues.
690    1     4/30/09   jbolz     First revision.
691
692