15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OES_texture_stencil8
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OES_texture_stencil8
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA Corporation (mheyer 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
165bd8deadSopenharmony_ci    Piers Daniell, NVIDIA
175bd8deadSopenharmony_ci    Daniel Koch, NVIDIA
185bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA
195bd8deadSopenharmony_ci    Jon Leech
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciNotice
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Copyright (c) 2012-2015 The Khronos Group Inc. Copyright terms at
245bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciSpecification Update Policy
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
295bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
305bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
315bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
325bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
335bd8deadSopenharmony_ci    described in more detail at
345bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciStatus
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    Complete.
395bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on 2014/03/14.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciVersion
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    Last Modified Date:         May 13, 2015
445bd8deadSopenharmony_ci    Revision:                   10
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciNumber
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    OpenGL ES Extension #173
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciDependencies
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    OpenGL ES 3.1 is required.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.1 (April 29, 2015)
555bd8deadSopenharmony_ci    Specification.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ciOverview
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    This extension accepts STENCIL_INDEX8 as a texture internal format, and
605bd8deadSopenharmony_ci    adds STENCIL_INDEX8 to the required internal format list. This removes the
615bd8deadSopenharmony_ci    need to use renderbuffers if a stencil-only format is desired.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciNew Procedures and Functions
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    None.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Tokens
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Accepted by the <format> parameter of TexImage3D, TexImage2D
705bd8deadSopenharmony_ci    TexSubImage3D and TexSubImage2D:
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci        STENCIL_INDEX           0x1901  /* existing enum */
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    Accepted by the <internalformat> parameter of TexImage3D, TexImage2D,
755bd8deadSopenharmony_ci    TexStorage3D, TexStorage2D, TexStorage3DMultisample
765bd8deadSopenharmony_ci    and TexStorage2DMultisample:
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci        STENCIL_INDEX8          0x8D48  /* existing enum */
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ciAdditions to Section 8.4.2 of the OpenGL ES 3.1 Specification
815bd8deadSopenharmony_ci(Transfer of Pixel Rectangles)
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Add to table 8.2 "Valid combinations of <format>, <type> and sized
845bd8deadSopenharmony_ci    <internalformat>":
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci        Format          Type            External Bytes  Internal Format
875bd8deadSopenharmony_ci                                        per Pixel
885bd8deadSopenharmony_ci        --------------- --------------- --------------- ---------------
895bd8deadSopenharmony_ci        STENCIL_INDEX   UNSIGNED_BYTE   1               STENCIL_INDEX8
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Add to table 8.5 "Pixel data formats":
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci        Format Name   |  Element Meaning and Order | Target buffer
945bd8deadSopenharmony_ci        ----------------------------------------------------------
955bd8deadSopenharmony_ci        STENCIL_INDEX | Stencil Index              | Stencil
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ciAdditions to Section 8.5 of the OpenGL ES 3.1 Specification
985bd8deadSopenharmony_ci(Texture Image Specification)
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    Modify the third paragraph from the bottom of p. 150 to include
1015bd8deadSopenharmony_ci    STENCIL_INDEX:
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    "Textures with a base internal format of DEPTH_COMPONENT, DEPTH_STENCIL,
1045bd8deadSopenharmony_ci    or STENCIL_INDEX are supported by texture image specification commands
1055bd8deadSopenharmony_ci    only if <target> is..."
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ciAdditions to Section 8.6 of the OpenGL ES 3.1 Specification
1085bd8deadSopenharmony_ci(Alternate Texture Image Specification Commands)
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    In table 8.16 "Valid CopyTexImage source framebuffer/destination texture
1115bd8deadSopenharmony_ci    base internal format combinations)", add row 'S' and column 'S' and
1125bd8deadSopenharmony_ci    leave all the format combinations involving 'S' marked unsupported.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciAdditions to Section 8.16 of the OpenGL ES 3.1 Specification
1155bd8deadSopenharmony_ci(Texture Completeness)
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    Add a bullet to the list of reasons a texture would be incomplete, on p,
1185bd8deadSopenharmony_ci    189:
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci      - The internal format of the texture is STENCIL_INDEX and either the
1215bd8deadSopenharmony_ci        magnification filter is not NEAREST, or the minification filter is
1225bd8deadSopenharmony_ci        neither NEAREST nor NEAREST_MIPMAP_NEAREST.
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ciAdditions to Section 8.19.1 of the OpenGL ES 3.1 Specification
1255bd8deadSopenharmony_ci(Depth Texture Comparison Mode)
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    Modify the description of computing R_t on p. 195:
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci   "Then the effective texture value is computed as follows:
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci      - If the base internal format is STENCIL_INDEX, then r = St
1325bd8deadSopenharmony_ci      - If the base internal format is DEPTH_STENCIL and ..."
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ciChanges to Section 11.1.3.5 of the OpenGL ES 3.1 Specification
1355bd8deadSopenharmony_ci(Texture Access)
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    Change the next-to-last paragraph of the section (at the bottom of p.
1385bd8deadSopenharmony_ci    272) to:
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci   "Texture lookups involving texture objects with an internal format of
1415bd8deadSopenharmony_ci    DEPTH_STENCIL can read the stencil value as described in section 8.19 by
1425bd8deadSopenharmony_ci    setting the value of DEPTH_STENCIL_TEXTURE_MODE to STENCIL_INDEX.
1435bd8deadSopenharmony_ci    Textures with a STENCIL_INDEX base internal format may also be used to
1445bd8deadSopenharmony_ci    read stencil data. The stencil value is read as an integer and assigned
1455bd8deadSopenharmony_ci    to R_t. An unsigned integer sampler should be used to lookup the stencil
1465bd8deadSopenharmony_ci    component, otherwise the results are undefined.
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    If a sampler is used in a shader..."
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciAdditions to Section 16.1.2 of the OpenGL ES 3.1 Specification
1515bd8deadSopenharmony_ci(ReadPixels):
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    Add STENCIL_INDEX to the third paragraph following the prototype
1545bd8deadSopenharmony_ci    for ReadPixels on p. 338:
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci   "The second is an implementation-chosen format from among those defined
1575bd8deadSopenharmony_ci    in table 8.2, excluding formats DEPTH_COMPONENT, DEPTH_STENCIL and
1585bd8deadSopenharmony_ci    STENCIL_INDEX. The values of <format> ..."
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ciNew Implementation Dependent State
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    None.
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ciNew State
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    None.
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ciModifications to the OpenGL ES Shading Language Specification, Version 3.10
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    None.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ciErrors
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by TexImage3D, TexImage2D,
1755bd8deadSopenharmony_ci    TexSubImage3D, TexSubImage2D if <format> is STENCIL_INDEX and the
1765bd8deadSopenharmony_ci    base internal format is not <STENCIL_INDEX>.
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by TexImage3D, TexImage2D,
1795bd8deadSopenharmony_ci    TexSubImage3D or TexSubImage2D, if <format> is STENCIL_INDEX and
1805bd8deadSopenharmony_ci    <target> is not one of TEXTURE_2D, TEXTURE_2D_ARRAY and TEXTURE_CUBE_MAP_*.
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by TexImage3D, TexImage2D,
1835bd8deadSopenharmony_ci    TexSubImage3D or TexSubImage2D, if <format> is STENCIL_INDEX and
1845bd8deadSopenharmony_ci    <type> is not <UNSIGNED_BYTE>
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by TexImage3D and TexImage2D,
1875bd8deadSopenharmony_ci    if <format> is <STENCIL_INDEX> and internal format is not <STENCIL_INDEX8>
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ciIssues
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    (1) What is the interaction with OpenGL ES 3.1's
1925bd8deadSopenharmony_ci        DEPTH_STENCIL_TEXTURE_MODE?
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci    RESOLVED: That piece of state is ignored because the base internal format
1955bd8deadSopenharmony_ci    of a STENCIL_INDEX texture is not DEPTH_STENCIL.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    (2) Does the presence of this extension imply that the implementation
1985bd8deadSopenharmony_ci    supports a true 8-bit stencil buffer?
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    RESOLVED: No, some OpenGL implementations may internally expand a
2015bd8deadSopenharmony_ci    format like STENCIL_INDEX8 to DEPTH24_STENCIL8, but will make such a format
2025bd8deadSopenharmony_ci    behave as if there were no depth bits.  Additionally, implementations may
2035bd8deadSopenharmony_ci    not support independent depth and stencil attachments; a framebuffer with a
2045bd8deadSopenharmony_ci    STENCIL_INDEX8 stencil attachment and a DEPTH_COMPONENT24 depth attachment
2055bd8deadSopenharmony_ci    may be treated as unsupported (FRAMEBUFFER_UNSUPPORTED).
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    (3) Should we support stencil formats that have a number of bits that is
2085bd8deadSopenharmony_ci    not exactly supported in the implementation? 8-bits is universally
2095bd8deadSopenharmony_ci    supported, but 1/4/16-bits are not.
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    RESOLVED: Only accept STENCIL_INDEX8, which is universally supported.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ciRevision History
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
2165bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------------
2175bd8deadSopenharmony_ci     1    03/20/12  jbolz     Internal revisions.
2185bd8deadSopenharmony_ci     2    05/30/12  dgkoch    Add tokens and errors section.
2195bd8deadSopenharmony_ci                              Update errors for GetTexImage.
2205bd8deadSopenharmony_ci     3    07/23/13  mheyer    Take ARB_texture_stencil8 and reword it for
2215bd8deadSopenharmony_ci                              ES 3.0
2225bd8deadSopenharmony_ci     4    08/06/13  mheyer    Allow NEAREST_MIPMAP_NEAREST as filter.
2235bd8deadSopenharmony_ci     5    08/30/13  mheyer    Add interactions with multisample textures.
2245bd8deadSopenharmony_ci     6    09/03/13  mheyer    CopyTexImage2D does not support stencil textures
2255bd8deadSopenharmony_ci     7    10/16/13  mheyer    Add entry to Table 3.5, added modification to
2265bd8deadSopenharmony_ci                              section 2.11.9 and extended Errors section.
2275bd8deadSopenharmony_ci     8    01/20/14  dkoch     Fix name of interacting extension.
2285bd8deadSopenharmony_ci                              Remove trailing whitespace.
2295bd8deadSopenharmony_ci     9    01/30/14  dkoch     Rename to OES.
2305bd8deadSopenharmony_ci     10   05/13/15  Jon Leech Rebase on OpenGL ES 3.1, which is required
2315bd8deadSopenharmony_ci                              in any case.
232