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