Hash :
4285647b
Author :
Date :
2018-08-23T11:16:15
Draft ANGLE_texture_multisample_array spec This is needed for antialiased multiview rendering. The extension is written against OpenGL ES 3.1. To add support for it in OpenGL ES 3.0, an extension for exposing non-array multisample textures will also be required (ANGLE_texture_multisample). This has been previously proposed though not yet submitted to ANGLE. The extension spec provides robustness guarantees for sampling multisample textures. It still needs to be tested whether native implementations follow these guarantees or if the spec needs to be adjusted to allow for clamping coordinates. The native KHR_robust_buffer_access_behavior is not very explicit about whether the texel fetch robustness applies also to multisample textures. BUG=angleproject:2775 Change-Id: I1bd721008a10bee29f8e2e06edca19370a9932a7 Reviewed-on: https://chromium-review.googlesource.com/1186336 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
Name
ANGLE_texture_multisample_array
Name Strings
GL_ANGLE_texture_multisample_array
Contributors
Olli Etuaho, NVIDIA Corporation
Contributors to OpenGL ES 3.2, on which this extension is based
Contact
Olli Etuaho (oetuaho 'at' nvidia.com)
Status
Incomplete
Version
Last Modified Date: August 23, 2018
Author Revision: 1
Number
OpenGL ES Extension XX
Dependencies
OpenGL ES 3.0 and the ANGLE_texture_multisample extension, or OpenGL ES
3.1 is required.
Written against the OpenGL ES 3.1 specification.
Overview
This extension provides support for a new type of texture -
two-dimensional multisample array texture - as well as mechanisms to
allocate storage and attach such textures to FBOs for rendering,
to support such a texture in a shader, to fetch a specific sample
from such a texture in a shader, and to query the dimensions of
such a texture in a shader.
This extension is based on functionality in the OpenGL ES 3.2
specification.
IP Status
No known IP claims.
New Tokens
Accepted by the <target> parameter of BindTexture,
TexStorage3DMultisampleANGLE, GetInternalformativ, TexParameter{if}*,
GetTexParameter{if}v, GetTexLevelParameter{if}vANGLE and
by the <textarget> parameter of FramebufferTexture2D:
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE 0x9102
Accepted by the <pname> parameter of GetIntegerv:
TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_ANGLE 0x9105
Returned by the <type> parameter of GetActiveUniform:
SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910B
INT_SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910C
UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910D
New Procedures and Functions
void TexStorage3DMultisampleANGLE(enum target,
sizei samples,
enum sizedinternalformat,
sizei width,
sizei height,
sizei depth,
boolean fixedsamplelocations);
Additions to Chapter 8 of the OpenGL ES 3.1 Specification (Textures and Samplers)
Modify Section 8.8, "Multisample Textures".
(first paragraph of section 8.8)
In addition to the texture types described in previous sections, two
additional types of textures are supported. A multisample texture is
similar to a two-dimensional or two-dimensional array texture,
except it contains multiple samples per texel. Multisample textures do
not have multiple image levels, and are immutable.
(insert after description of TexStorage2DMultisampleANGLE)
The command
void TexStorage3DMultisampleANGLE(enum target, sizei samples,
int sizedinternalformat,
sizei width, sizei height, sizei depth,
boolean fixedsamplelocations);
establishes the data storage, format, dimensions, and number of
samples of a multisample texture array's image. <target> must be
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE. <width>, <height> and <depth> are the
dimensions in texels of the texture.
Upon success, TexStorage3DMultisampleANGLE deletes any existing image
for <target> and the contents of texels are undefined. The values of
TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_DEPTH, TEXTURE_SAMPLES_ANGLE,
TEXTURE_INTERNAL_FORMAT and TEXTURE_FIXED_SAMPLE_LOCATIONS_ANGLE are
set to <width>, <height>, the actual number of samples allocated,
<sizedinternalformat>, and <fixedsamplelocations> respectively.
(modify errors in Section 8.8)
An INVALID_ENUM error is generated if target is not
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE in case of TexStorage3DMultisampleANGLE,
or TEXTURE_2D_MULTISAMPLE_ANGLE in case of TexStorage2DMultisampleANGLE.
An INVALID_VALUE is generated if <width>, <height> or <depth> is less than 1.
(insert into errors is Section 8.8)
An INVALID_VALUE error is generated by TexStorage3DMultisample if depth is
greater than the value of MAX_ARRAY_TEXTURE_LAYERS.
Modify Section 8.9, "Texture Parameters":
Add TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE to the texture targets accepted by
TexParameter*.
(add to the end of Section 8.9)
An INVALID_ENUM is generated if <target> is
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE and <pname> is any sampler state from
table 20.11. An INVALID_OPERATION error is generated if <target> is
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE, and <pname> TEXTURE_BASE_LEVEL is set
to any value other than zero.
Modify Section 8.10.2, "Texture Parameter Queries":
(modify the paragraph describing the <target> parameter of
GetTexParameter*)
<target> may be one of TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY,
TEXTURE_CUBE_MAP, TEXTURE_2D_MULTISAMPLE_ANGLE, or
TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE, indicating the currently bound
two-dimensional, three-dimensional, two-dimensional array, cube map,
two-dimensional multisample, or two-dimensional multisample array
texture object, respectively.
Modify Section 8.10.3, "Texture Level Parameter Queries"
(modify the paragraph describing the <target> parameter of
GetTexLevelParameter*)
<target> may be one of TEXTURE_2D, TEXTURE_3D, TEXTURE_2D_ARRAY, one of
the cube map face targets from table 8.21, TEXTURE_2D_MULTISAMPLE_ANGLE,
or TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE indicating the two- or
three-dimensional texture, two-dimensional array texture, one of the six
distinct 2D images making up the cube map texture object, two-dimensional
multisample texture or two-dimensional multisample array texture. Otherwise
an INVALID_ENUM is generated.
Additions to Chapter 9 of the OpenGL ES 3.1 Specification (Framebuffers and
Framebuffer Objects)
Modify section 9.2.8 "Attaching Texture Images to a Framebuffer".
(modify description of FrameBufferTextureLayer p. 223)
The command
void FramebufferTextureLayer(enum target, enum attachment,
uint texture, int level, int layer);
operates similarly to FramebufferTexture2D, except that it attaches a
single layer of a three-dimensional texture, two-dimensional array
texture or two-dimensional multisample array texture level.
The error INVALID_OPERATION is generated if texture is non-zero
and is not the name of a three-dimensional texture, two-dimensional
array texture or or two-dimensional multisample array texture.
(insert into description of FrameBufferTextureLayer p. 224)
If <texture> identifies a two-dimensional multisample array texture,
then <level> must be zero. Otherwise, an INVALID_VALUE error is
generated.
Additions to Chapter 11 of the OpenGL ES 3.1 Specification (Programmable Vertex Processing)
Modify Section 11.1.3.3 "Multisample Texel Fetches":
(modify the paragraph before the list of conditions for undefined results)
If the context was created with robust buffer access enabled, the result
of the texel fetch in the following cases is zero. If robust buffer
access is not enabled, the result of the texel fetch is undefined in
each case:
Additions to Chapter 19 of the OpenGL ES 3.1 Specification (Context State Queries)
Modify Section 19.3, "Internal Format Queries":
Add target TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE to table 19.1.
Additions to the AGL/EGL/GLX/WGL Specifications
None
Additions to the OpenGL ES Shading Language Specification, Version 3.10.
Including the following line in a shader can be used to control the
language featured described in this extension:
#extension GL_ANGLE_texture_multisample_array : <behavior>
where <behavior> is as specified in section 3.5.
A new preprocessor #define is added to the OpenGL ES Shading Language:
#define GL_ANGLE_texture_multisample_array 1
Add to section 3.8 "Keywords":
The following new sampler types are added:
sampler2DMSArray, isampler2DMSArray, usampler2DMSArray,
Add to section 4.1 "Basic Types":
Add the following sampler type to the "Floating Point Sampler
Types (opaque)" table:
sampler2DMSArray handle for accessing a 2D multisample array texture
Add the following sampler type to the "Unsigned Integer Sampler
Types (opaque)" table:
usampler2DMSArray handle for accessing an unsigned integer 2D
multisample array texture
Add the following sampler type to the "Integer Sampler Types" table:
isampler2DMSArray handle for accessing an integer 2D
multisample array texture
Add to section 8.8 "Texture Lookup Functions":
Add new functions to the set of allowed texture lookup functions:
Syntax:
gvec4 texelFetch(gsampler2DMSArray sampler, ivec3 P, int sample)
Description:
Use integer texture coordinate <P> to lookup a single sample
<sample> on the texture bound to <sampler> as described in the OpenGL
ES specification section 11.1.3.3 "Multisample Texel Fetches".
Syntax:
ivec3 textureSize(gsampler2DMSArray sampler)
Description:
Returns the dimensions, width, height and depth of level 0 for the
texture bound to <sampler>, as described in the OpenGL ES
specification section 11.1.3.4 "Texture Queries".
Errors
The error INVALID_ENUM is generated by TexStorage3DMultisampleANGLE if
<target> is not TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE.
The error INVALID_OPERATION is generated by TexStorage3DMultisampleANGLE
if zero is bound to <target>.
The error INVALID_VALUE is generated by TexStorage3DMultisampleANGLE if
<width> or <height> is less than 1 or greater than the value of
MAX_TEXTURE_SIZE.
The error INVALID_VALUE is generated by TexStorage3DMultisampleANGLE if
<depth> is less than 1 or greater than the value of
MAX_ARRAY_TEXTURE_LAYERS.
The error INVALID_VALUE is generated by TexStorage3DMultisampleANGLE if
<samples> is zero.
The error INVALID_ENUM is generated by TexStorage3DMultisampleANGLE if
<sizedinternalformat> is not color-renderable, depth-renderable, or
stencil-renderable.
The error INVALID_ENUM is generated by TexStorage3DMultisampleANGLE if
<internalformat> is one of the unsized base internal formats listed in
table 8.11.
The error INVALID_OPERATION is generated by TexStorage3DMultisampleANGLE
if <samples> is greater than the maximum number of samples supported for
this <target> and <sizedinternalformat>, The maximum number of samples
supported can be determined by calling GetInternalformativ with a <pname>
of SAMPLES.
The error INVALID_OPERATION is generated by TexStorage3DMultisampleANGLE
if the value of TEXTURE_IMMUTABLE_FORMAT for the texture currently bound
to <target> on the active texture unit is TRUE.
The error OUT_OF_MEMORY is generated by TexStorage3DMultisampleANGLE
if the GL is unable to create a texture image of the requested size.
The error INVALID_VALUE is generated by FramebufferTextureLayer if
<texture> identifies a two-dimensional multisample array texture, and
<level> is not zero.
Issues
None