gfx/angle/extensions/ANGLE_depth_texture.txt

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 Name
michael@0 2
michael@0 3 ANGLE_depth_texture
michael@0 4
michael@0 5 Name Strings
michael@0 6
michael@0 7 GL_ANGLE_depth_texture
michael@0 8
michael@0 9 Contributors
michael@0 10
michael@0 11 Nicolas Capens, TransGaming
michael@0 12 Daniel Koch, TransGaming
michael@0 13 Shannon Woods, TransGaming
michael@0 14 Kenneth Russell, Google
michael@0 15 Vangelis Kokkevis, Google
michael@0 16 Gregg Tavares, Google
michael@0 17 Contributors to OES_depth_texture
michael@0 18 Contributors to OES_packed_depth_stencil
michael@0 19
michael@0 20 Contact
michael@0 21
michael@0 22 Shannon Woods, TransGaming (shannon 'dot' woods 'at' transgaming.com)
michael@0 23
michael@0 24 Status
michael@0 25
michael@0 26 Implemented in ANGLE.
michael@0 27
michael@0 28 Version
michael@0 29
michael@0 30 Last Modified Date: February 25, 2013
michael@0 31 Revision: #4
michael@0 32
michael@0 33 Number
michael@0 34
michael@0 35 TBD
michael@0 36
michael@0 37 Dependencies
michael@0 38
michael@0 39 OpenGL ES 2.0 is required.
michael@0 40 This extension is written against the OpenGL ES 2.0.25 specification
michael@0 41
michael@0 42 OES_packed_depth_stencil affects the definition of this extension.
michael@0 43
michael@0 44 EXT_texture_storage affects the definition of this extension.
michael@0 45
michael@0 46 Overview
michael@0 47
michael@0 48 This extension defines support for 2D depth and depth-stencil
michael@0 49 textures in an OpenGL ES implementation.
michael@0 50
michael@0 51 This extension incorporates the depth texturing functionality of
michael@0 52 OES_depth_texture and OES_packed_depth_stencil, but does not
michael@0 53 provide the ability to load existing data via TexImage2D or
michael@0 54 TexSubImage2D. This extension also allows implementation
michael@0 55 variability in which components from a sampled depth texture
michael@0 56 contain the depth data. Depth textures created with this
michael@0 57 extension only support 1 level.
michael@0 58
michael@0 59 New Procedures and Functions
michael@0 60
michael@0 61 None
michael@0 62
michael@0 63 New Tokens
michael@0 64
michael@0 65 Accepted by the <format> parameter of TexImage2D and TexSubImage2D and
michael@0 66 <internalformat> parameter of TexImage2D:
michael@0 67
michael@0 68 DEPTH_COMPONENT 0x1902
michael@0 69 DEPTH_STENCIL_OES 0x84F9
michael@0 70
michael@0 71 Accepted by the <type> parameter of TexImage2D, TexSubImage2D:
michael@0 72
michael@0 73 UNSIGNED_SHORT 0x1403
michael@0 74 UNSIGNED_INT 0x1405
michael@0 75 UNSIGNED_INT_24_8_OES 0x84FA
michael@0 76
michael@0 77 Accepted by the <internalformat> parameter of TexStorage2DEXT:
michael@0 78
michael@0 79 DEPTH_COMPONENT16 0x81A5
michael@0 80 DEPTH_COMPONENT32_OES 0x81A7
michael@0 81 DEPTH24_STENCIL8_OES 0x88F0
michael@0 82
michael@0 83 Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation)
michael@0 84
michael@0 85 Update Section 2.10.5 "Shader Execution" in the subsection titled
michael@0 86 "Texture Access" add a new paragraph before the last paragraph add
michael@0 87 this line:
michael@0 88
michael@0 89 "The stencil index texture internal component is ignored if the base
michael@0 90 internal format is DEPTH_STENCIL_OES.
michael@0 91
michael@0 92 If a vertex shader uses..."
michael@0 93
michael@0 94 Additions to Chapter 3 of the OpenGL ES 2.0 specification (Rasterization)
michael@0 95
michael@0 96 Add the following rows to Table 3.2 (page 62):
michael@0 97
michael@0 98 type Parameter GL Data Type Special
michael@0 99 ------------------------------------------------
michael@0 100 ... ... ...
michael@0 101 UNSIGNED_SHORT ushort No
michael@0 102 UNSIGNED_INT uint No
michael@0 103 UNSIGNED_INT_24_8_OES uint Yes
michael@0 104
michael@0 105 Add the following rows to Table 3.3 (page 62):
michael@0 106
michael@0 107 Format Name Element Meaning and Order Target Buffer
michael@0 108 ------------------------------------------------------------------
michael@0 109 ... ... ...
michael@0 110 DEPTH_COMPONENT Depth Depth
michael@0 111 DEPTH_STENCIL_OES Depth and Stencil Index Depth and Stencil
michael@0 112 ... ... ...
michael@0 113
michael@0 114 Add a row to Table 3.5 "Packed pixel formats" (page 64):
michael@0 115
michael@0 116 type Parameter GL Type Components Pixel Formats
michael@0 117 ------------------------------------------------------------------
michael@0 118 ... ... ... ...
michael@0 119 UNSIGNED_INT_24_8_OES uint 2 DEPTH_STENCIL_OES
michael@0 120
michael@0 121 Add a new table after Table 3.6 (page 64):
michael@0 122
michael@0 123 UNSIGNED_INT_24_8_OES
michael@0 124
michael@0 125 31 30 29 28 27 26 ... 12 11 10 9 8 7 6 5 4 3 2 1 0
michael@0 126 +----------------------------------+---------------+
michael@0 127 | 1st Component | 2nd Component |
michael@0 128 +----------------------------------+---------------+
michael@0 129
michael@0 130 Table 3.6.B: UNSIGNED_INT formats
michael@0 131
michael@0 132 Add a row to Table 3.7 "Packed pixel field assignments" (page 65):
michael@0 133
michael@0 134 Format | 1st 2nd 3rd 4th
michael@0 135 ------------------+-------------------------------
michael@0 136 ... | ... ... ... ...
michael@0 137 DEPTH_STENCIL_OES | depth stencil N/A N/A
michael@0 138
michael@0 139 Add the following paragraph to the end of the section "Conversion to
michael@0 140 floating-point" (page 65):
michael@0 141
michael@0 142 "For groups of components that contain both standard components and index
michael@0 143 elements, such as DEPTH_STENCIL_OES, the index elements are not converted."
michael@0 144
michael@0 145 In section 3.7.1 "Texture Image Specification", update page 67 to
michael@0 146 say:
michael@0 147
michael@0 148 "The selected groups are processed as described in section 3.6.2, stopping
michael@0 149 just before final conversion. Each R, G, B, A, or depth value so generated
michael@0 150 is clamped to [0, 1], while the stencil index values are masked by 2^n-1,
michael@0 151 where n is the number of stencil bits in the internal format resolution
michael@0 152 (see below).
michael@0 153
michael@0 154 Components are then selected from the resulting R, G, B, A, depth, or
michael@0 155 stencil index values to obtain a texture with the base internal format
michael@0 156 specified by <internalformat>. Table 3.8 summarizes the mapping of R, G,
michael@0 157 B, A, depth, or stencil values to texture components, as a function of the
michael@0 158 base internal format of the texture image. <internalformat> may be
michael@0 159 specified as one of the internal format symbolic constants listed in
michael@0 160 table 3.8. Specifying a value for <internalformat> that is not one of the
michael@0 161 above values generates the error INVALID_VALUE. If <internalformat> does
michael@0 162 not match <format>, the error INVALID_OPERATION is generated.
michael@0 163
michael@0 164 Textures with a base internal format of DEPTH_COMPONENT or
michael@0 165 DEPTH_STENCIL_OES are supported by texture image specification commands
michael@0 166 only if <target> is TEXTURE_2D. Using these formats in conjunction with
michael@0 167 any other <target> will result in an INVALID_OPERATION error.
michael@0 168
michael@0 169 Textures with a base internal format of DEPTH_COMPONENT or
michael@0 170 DEPTH_STENCIL_OES only support one level of image data. Specifying a
michael@0 171 non-zero value for <level> will result in an INVALID_OPERATION error.
michael@0 172
michael@0 173 Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES
michael@0 174 require either depth component data or depth/stencil component data.
michael@0 175 Textures with other base internal formats require RGBA component data. The
michael@0 176 error INVALID_OPERATION is generated if the base internal format is
michael@0 177 DEPTH_COMPONENT or DEPTH_STENCIL_OES and <format> is not DEPTH_COMPONENT or
michael@0 178 DEPTH_STENCIL_OES, or if the base internal format is not DEPTH_COMPONENT or
michael@0 179 DEPTH_STENCIL_OES and <format> is DEPTH_COMPONENT or DEPTH_STENCIL_OES.
michael@0 180
michael@0 181 Textures with a base internal format of DEPTH_COMPONENT or
michael@0 182 DEPTH_STENCIL_OES do not support loading image data via the TexImage
michael@0 183 commands. They can only have their contents specified by rendering
michael@0 184 to them. The INVALID_OPERATION error is generated by the TexImage2D
michael@0 185 command if <data> is not NULL for such textures."
michael@0 186
michael@0 187 Add a row to table 3.8 (page 68), and update the title of the
michael@0 188 second column:
michael@0 189
michael@0 190 Base Internal Format RGBA, Depth and Stencil Values Internal Components
michael@0 191 -------------------------------------------------------------------------
michael@0 192 ... ... ...
michael@0 193 DEPTH_COMPONENT Depth D
michael@0 194 DEPTH_STENCIL_OES Depth,Stencil D,S
michael@0 195 ... ... ...
michael@0 196
michael@0 197 Update the caption for table 3.8 (page 68)
michael@0 198
michael@0 199 "Table 3.8: Conversion from RGBA, depth, and stencil pixel components to
michael@0 200 internal texture components. Texture components R, G, B, A, and L are
michael@0 201 converted back to RGBA colors during filtering as shown in table 3.12.
michael@0 202 Texture components D are converted to RGBA colors as described in
michael@0 203 section 3.7.8-1/2."
michael@0 204
michael@0 205 Add the following to section 3.7.2 "Alternate Texture Image Specification
michael@0 206 Commands":
michael@0 207
michael@0 208 "CopyTexImage2D and CopyTexSubImage2D generate the INVALID_OPERATION
michael@0 209 error if the base internal format of the destination texture is
michael@0 210 DEPTH_COMPONENT or DEPTH_STENCIL_OES.
michael@0 211
michael@0 212 TexSubImage2D generates the INVALID_OPERATION error if the base internal
michael@0 213 format of the texture is DEPTH_COMPONENT or DEPTH_STENCIL_OES."
michael@0 214
michael@0 215 Add a new section between sections 3.7.8 and 3.7.9:
michael@0 216
michael@0 217 "3.7.8-1/2 Depth/Stencil Textures
michael@0 218
michael@0 219 If the currently bound texture's base internal format is DEPTH_COMPONENT or
michael@0 220 DEPTH_STENCIL_OES, then the output of the texture unit is as described
michael@0 221 below. Otherwise, the texture unit operates in the normal manner.
michael@0 222
michael@0 223 Let <D_t> be the depth texture value, provided by the shader's texture lookup
michael@0 224 function. Then the effective texture value is computed as follows:
michael@0 225 <Tau> = <D_t>
michael@0 226
michael@0 227 If the texture image has a base internal format of DEPTH_STENCIL_OES, then
michael@0 228 the stencil index texture component is ignored. The texture value <Tau> does
michael@0 229 not include a stencil index component, but includes only the depth
michael@0 230 component.
michael@0 231
michael@0 232 The resulting <Tau> is assigned to <R_t>. In some implementations, <Tau> is
michael@0 233 also assigned to <G_t>, <B_t>, or <A_t>. Thus in table 3.12, textures with
michael@0 234 depth component data behave as if their base internal format is RGBA, with
michael@0 235 values in <G_t>, <B_t>, and <A_t> being implementation dependent."
michael@0 236
michael@0 237 Add the following to section 3.7.11 "Mipmap Generation":
michael@0 238
michael@0 239 "If the level zero array contains depth or depth-stencil data, the
michael@0 240 error INVALID_OPERATION is generated."
michael@0 241
michael@0 242 Insert a new paragraph after the first paragraph of the "Texture Access"
michael@0 243 subsection of section 3.8.2 on page 87, which says:
michael@0 244
michael@0 245 "Texture lookups involving textures with depth component data generate
michael@0 246 a texture source color by using depth data directly, as described in
michael@0 247 section 3.7.8-1/2. The stencil texture internal component is ignored
michael@0 248 if the base internal format is DEPTH_STENCIL_OES."
michael@0 249
michael@0 250 Additions to Chapter 4 of the OpenGL ES 2.0 specification (Per-Fragment
michael@0 251 Operations and the Framebuffer)
michael@0 252
michael@0 253 In section 4.4.5 "Framebuffer Completeness", replace the the 3rd
michael@0 254 paragraph with the following text:
michael@0 255
michael@0 256 "* An internal format is color-renderable if it is one of the formats
michael@0 257 from table 4.5 noted as color-renderable or if it is unsized format
michael@0 258 RGBA or RGB. No other formats, including compressed internal formats,
michael@0 259 are color-renderable.
michael@0 260
michael@0 261 * An internal format is depth-renderable if it is one of the sized
michael@0 262 internal formats from table 4.5 noted as depth-renderable, if it
michael@0 263 is the unsized format DEPTH_COMPONENT or if it is the internal
michael@0 264 format value of DEPTH24_STENCIL8_OES. No other formats are
michael@0 265 depth-renderable.
michael@0 266
michael@0 267 * An internal format is stencil-renderable if it is one of the sized
michael@0 268 internal formats from table 4.5 noted as stencil-renderable or if it
michael@0 269 is DEPTH24_STENCIL8_OES. No other formats are stencil-renderable."
michael@0 270
michael@0 271 Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special
michael@0 272 Functions)
michael@0 273
michael@0 274 None.
michael@0 275
michael@0 276 Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State
michael@0 277 Requests)
michael@0 278
michael@0 279 None.
michael@0 280
michael@0 281 Interactions with OES_packed_depth_stencil
michael@0 282
michael@0 283 If OES_packed_depth_stencil is not supported, mentions of
michael@0 284 DEPTH_STENCIL_OES and UNSIGNED_INT_24_8_OES as a format/type combinations
michael@0 285 for TexImage2D and TexSubImage2D are omitted. Mentions of
michael@0 286 the internal format DEPTH24_STENCIL8_OES are also omitted.
michael@0 287
michael@0 288 Interactions with EXT_texture_storage
michael@0 289
michael@0 290 If EXT_texture_storage is supported the following internalformat
michael@0 291 to format/type mappings are used:
michael@0 292
michael@0 293 <internalformat> <format> <type>
michael@0 294 ---------------- -------- ------
michael@0 295 DEPTH_COMPONENT16 DEPTH_COMPONENT UNSIGNED_SHORT
michael@0 296 DEPTH_COMPONENT32_OES DEPTH_COMPONENT UNSIGNED_INT
michael@0 297 DEPTH24_STENCIL8_OES DEPTH_STENCIL_OES UNSIGNED_INT
michael@0 298
michael@0 299 Textures with the above <internalformats> only support one level of
michael@0 300 image data. Specifying a value other than one for the <levels> parameter
michael@0 301 to TexStorage2DEXT will result in an INVALID_OPERATION error.
michael@0 302
michael@0 303 If EXT_texture_storage is not supported, ignore any references
michael@0 304 to TexStorage2DEXT.
michael@0 305
michael@0 306 Errors
michael@0 307
michael@0 308 The error INVALID_OPERATION is generated by TexImage2D if <format> and
michael@0 309 <internalformat> are DEPTH_COMPONENT and <type> is not UNSIGNED_SHORT,
michael@0 310 or UNSIGNED_INT.
michael@0 311
michael@0 312 The error INVALID_OPERATION is generated by TexSubImage2D if <format> is
michael@0 313 DEPTH_COMPONENT and <type> is not UNSIGNED_SHORT, or UNSIGNED_INT.
michael@0 314
michael@0 315 The error INVALID_OPERATION is generated by TexImage2D if <format> and
michael@0 316 <internalformat> are not DEPTH_COMPONENT and <type> is UNSIGNED_SHORT,
michael@0 317 or UNSIGNED_INT.
michael@0 318
michael@0 319 The error INVALID_OPERATION is generated by TexSubImage2D if <format> is
michael@0 320 not DEPTH_COMPONENT and <type> is UNSIGNED_SHORT, or UNSIGNED_INT.
michael@0 321
michael@0 322 The error INVALID_OPERATION is generated by TexImage2D if <format> and
michael@0 323 <internalformat> are DEPTH_STENCIL_OES and <type> is not
michael@0 324 UNSIGNED_INT_24_8_OES.
michael@0 325
michael@0 326 The error INVALID_OPERATION is generated by TexSubImage2D if <format>
michael@0 327 is DEPTH_STENCIL_OES and <type> is not UNSIGNED_INT_24_8_OES.
michael@0 328
michael@0 329 The error INVALID_OPERATION is generated by TexImage2D if <format> and
michael@0 330 <internalformat> is not DEPTH_STENCIL_OES and <type> is
michael@0 331 UNSIGNED_INT_24_8_OES.
michael@0 332
michael@0 333 The error INVALID_OPERATION is generated by TexSubImage2D if <format>
michael@0 334 is not DEPTH_STENCIL_OES and <type> is UNSIGNED_INT_24_8_OES.
michael@0 335
michael@0 336 The error INVALID_OPERATION is generated in the following situations:
michael@0 337 - TexImage2D is called with <format> and <internalformat> of
michael@0 338 DEPTH_COMPONENT or DEPTH_STENCIL_OES and
michael@0 339 - <target> is not TEXTURE_2D,
michael@0 340 - <data> is not NULL, or
michael@0 341 - <level> is not zero.
michael@0 342 - TexSubImage2D is called with <format> of DEPTH_COMPONENT or
michael@0 343 DEPTH_STENCIL_OES.
michael@0 344 - TexStorage2DEXT is called with <internalformat> of DEPTH_COMPONENT16,
michael@0 345 DEPTH_COMPONENT32_OES, or DEPTH24_STENCIL8_OES, and
michael@0 346 - <target> is not TEXTURE_2D, or
michael@0 347 - <levels> is not one.
michael@0 348 - CopyTexImage2D is called with an <internalformat> that has a base
michael@0 349 internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
michael@0 350 - CopyTexSubImage2D is called with a target texture that has a base
michael@0 351 internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
michael@0 352 - GenerateMipmap is called on a texture that has a base internal format
michael@0 353 of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
michael@0 354
michael@0 355 New State
michael@0 356
michael@0 357 None.
michael@0 358
michael@0 359 Issues
michael@0 360
michael@0 361 1) What are the differences between this extension and OES_depth_texture
michael@0 362 and OES_packed_depth_stencil?
michael@0 363
michael@0 364 RESOLVED: This extension:
michael@0 365 - does not support loading pre-baked depth stencil data via
michael@0 366 TexImage2D or TexSubImage2D.
michael@0 367 - allows variability in the y-, z-, and w-components of the sample
michael@0 368 results from depth textures.
michael@0 369 - only supports one level textures.
michael@0 370 - explicitly lists the errors for unsupported functionality.
michael@0 371 Since these were not clearly specified in the OES_depth_texture
michael@0 372 extension there may be differences in error values between
michael@0 373 implementations of OES_depth_texture and ANGLE_depth_texture.
michael@0 374 This specification was also rebased to apply against the OpenGL ES 2.0
michael@0 375 specification instead of the OpenGL specification, making it more
michael@0 376 obvious what all the functionality changes are.
michael@0 377
michael@0 378 2) Why does TexSubImage2D accept the new format/type combinations even
michael@0 379 though it does not actually support loading data?
michael@0 380
michael@0 381 RESOLVED: This was done to be more consistent with the OES_depth_texture
michael@0 382 extension and to make it easier to add support for loading texture
michael@0 383 data if it is possible to support in the future.
michael@0 384
michael@0 385 3) Why are only 1-level depth textures supported?
michael@0 386
michael@0 387 RESOLVED: The only use for multiple levels of depth textures would
michael@0 388 be for fitlered texturing. However since it is not possible to
michael@0 389 render to non-zero-level texture levels in OpenGL ES 2.0, and since
michael@0 390 this extension forbids loading existing data and GenerateMipmap on
michael@0 391 depth textures, it is impossible to initialize or specify contents
michael@0 392 for non-zero levels of depth textures.
michael@0 393
michael@0 394 Revision History
michael@0 395
michael@0 396 02/25/2013 swoods revise to allow texture lookup to guarantee depth values
michael@0 397 only in red channel of sample result.
michael@0 398 06/04/2012 dgkoch fix errors, disallow multi-level depth textures.
michael@0 399 05/30/2012 dgkoch minor updates and add issues.
michael@0 400 05/23/2012 dgkoch intial revision based on OES_depth_texture and
michael@0 401 OES_packed_depth_stencil and rebased against the ES 2.0 spec
michael@0 402

mercurial