15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OES_texture_border_clamp
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OES_texture_border_clamp
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Daniel Koch, NVIDIA (dkoch 'at' nvidia 'dot' com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Jussi Rasanen, NVIDIA
165bd8deadSopenharmony_ci    Greg Roth, NVIDIA
175bd8deadSopenharmony_ci    Dominik Witczak, Mobica
185bd8deadSopenharmony_ci    Graham Connor, Imagination
195bd8deadSopenharmony_ci    Ben Bowman, Imagination
205bd8deadSopenharmony_ci    Jonathan Putsman, Imagination
215bd8deadSopenharmony_ci    Maurice Ribble, Qualcomm
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciNotice
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Copyright (c) 2014 The Khronos Group Inc. Copyright terms at
265bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciSpecification Update Policy
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
315bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
325bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
335bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
345bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
355bd8deadSopenharmony_ci    described in more detail at
365bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciStatus
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Approved by the OpenGL ES Working Group
415bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on November 7, 2014
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciVersion
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    Last Modified Date: June 18, 2014
465bd8deadSopenharmony_ci    Revision: 1
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciNumber
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    OpenGL ES Extension #215
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ciDependencies
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    OpenGL ES 2.0 is required.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.0.2
575bd8deadSopenharmony_ci    specification.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    OpenGL ES 3.0 affects the definition of this extension.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    OES_texture_3D affects the definition of this extension.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    EXT_texture_compression_s3tc trivially affects the definition
645bd8deadSopenharmony_ci    of this extension.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    KHR_texture_compression_astc_{ldr,hdr} trivially affect the
675bd8deadSopenharmony_ci    definition of this extension.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ciOverview
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    OpenGL ES provides only a single clamping wrap mode: CLAMP_TO_EDGE.
725bd8deadSopenharmony_ci    However, the ability to clamp to a constant border color can be
735bd8deadSopenharmony_ci    useful to quickly detect texture coordinates that exceed their
745bd8deadSopenharmony_ci    expected limits or to dummy out any such accesses with transparency
755bd8deadSopenharmony_ci    or a neutral color in tiling or light maps.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    This extension defines an additional texture clamping algorithm.
785bd8deadSopenharmony_ci    CLAMP_TO_BORDER_OES clamps texture coordinates at all mipmap levels
795bd8deadSopenharmony_ci    such that NEAREST and LINEAR filters of clamped coordinates return
805bd8deadSopenharmony_ci    only the constant border color. This does not add the ability for
815bd8deadSopenharmony_ci    textures to specify borders using glTexImage2D, but only to clamp
825bd8deadSopenharmony_ci    to a constant border value set using glTexParameter and
835bd8deadSopenharmony_ci    glSamplerParameter.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ciNew Procedures and Functions
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    void TexParameterIivOES(enum target, enum pname, const int *params);
885bd8deadSopenharmony_ci    void TexParameterIuivOES(enum target, enum pname, const uint *params);
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    void GetTexParameterIivOES(enum target, enum pname, int *params);
915bd8deadSopenharmony_ci    void GetTexParameterIuivOES(enum target, enum pname, uint *params);
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    void SamplerParameterIivOES(uint sampler, enum pname, const int *params);
945bd8deadSopenharmony_ci    void SamplerParameterIuivOES(uint sampler, enum pname, const uint *params);
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    void GetSamplerParameterIivOES(uint sampler, enum pname, int *params);
975bd8deadSopenharmony_ci    void GetSamplerParameterIuivOES(uint sampler, enum pname, uint *params);
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ciNew Tokens
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
1025bd8deadSopenharmony_ci    SamplerParameteriv, SamplerParameterfv, TexParameterIivOES,
1035bd8deadSopenharmony_ci    TexParameterIuivOES, SamplerParameterIivOES, SamplerParameterIuivOES,
1045bd8deadSopenharmony_ci    GetTexParameteriv, GetTexParameterfv, GetTexParameterIivOES,
1055bd8deadSopenharmony_ci    GetTexParameterIuivOES, GetSamplerParameteriv, GetSamplerParameterfv,
1065bd8deadSopenharmony_ci    GetSamplerParameterIivOES, and GetSamplerParameterIuivOES:
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci        TEXTURE_BORDER_COLOR_OES                         0x1004
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Accepted by the <param> parameter of TexParameteri, TexParameterf,
1115bd8deadSopenharmony_ci    SamplerParameteri and SamplerParameterf, and by the <params> parameter of
1125bd8deadSopenharmony_ci    TexParameteriv, TexParameterfv, TexParameterIivOES, TexParameterIuivOES,
1135bd8deadSopenharmony_ci    SamplerParameterIivOES, SamplerParameterIuivOES and returned by the
1145bd8deadSopenharmony_ci    <params> parameter of GetTexParameteriv, GetTexParameterfv,
1155bd8deadSopenharmony_ci    GetTexParameterIivOES, GetTexParameterIuivOES, GetSamplerParameteriv,
1165bd8deadSopenharmony_ci    GetSamplerParameterfv, GetSamplerParameterIivOES, and
1175bd8deadSopenharmony_ci    GetSamplerParameterIuivOES when their <pname> parameter
1185bd8deadSopenharmony_ci    is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R:
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci        CLAMP_TO_BORDER_OES                              0x812D
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    Note that the {Get}TexParameterI{i ui}vOES and
1235bd8deadSopenharmony_ci    {Get}SamplerParameterI{i ui}vOES functions also accept all the
1245bd8deadSopenharmony_ci    same parameters and values as are accepted by the existing
1255bd8deadSopenharmony_ci    {Get}TexParameter{if}v and {Get}SamplerParameter{if}v commands,
1265bd8deadSopenharmony_ci    respectively.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 3.0.2 Specification
1295bd8deadSopenharmony_ci(Rasterization)
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    Modifications to Section 3.8.2 "Sampler Objects"
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    Add the following to the list of SamplerParameter commands (p.123):
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci       void SamplerParameterI{i ui}vOES(uint sampler, enum pname,
1365bd8deadSopenharmony_ci                                        const T *params);
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    Modify the last sentence of the description of the commands to state:
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    "In the first form of the command, <param> is a value to which to
1415bd8deadSopenharmony_ci    set a single-valued parameter; in the remaining forms, <params> is an
1425bd8deadSopenharmony_ci    array of parameters whose type depends on the parameter being set."
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    Replace the last sentence of the 3rd paragraph on p.123 (beginning with
1455bd8deadSopenharmony_ci    "The values accepted in the <pname> parameter..." with the following:
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci    "<pname> must be one of the sampler state names in Table 6.10, otherwise
1485bd8deadSopenharmony_ci    an INVALID_ENUM error is generated. An INVALID_ENUM error is generated
1495bd8deadSopenharmony_ci    if SamplerParameter{if} is called for a non-scalar parameter
1505bd8deadSopenharmony_ci    (TEXTURE_BORDER_COLOR_OES)."
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    Replace the 4th paragraph on p.123 (beginning with "Data conversions...")
1535bd8deadSopenharmony_ci    with the following:
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    "Data conversions are performed as specified in section 2.3.1, except
1565bd8deadSopenharmony_ci    that if the values for TEXTURE_BORDER_COLOR_OES are specified with
1575bd8deadSopenharmony_ci    a call to SamplerParameterIiv or SamplerParameterIuiv, the values are
1585bd8deadSopenharmony_ci    unmodified and stored with an internal data type of integer. If specified
1595bd8deadSopenharmony_ci    with SamplerParameteriv, they are converted to floating point using
1605bd8deadSopenharmony_ci    equation 2.2. Otherwise, border color values are unmodified and stored
1615bd8deadSopenharmony_ci    as floating-point."
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    Modifications to Section 3.8.6 "Compressed Texture Images"
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    Add column to Table 3.16 with heading "Border Type" fill in the
1665bd8deadSopenharmony_ci    values as follows:
1675bd8deadSopenharmony_ci     "unorm" for the following compressed internal formats:
1685bd8deadSopenharmony_ci        COMPRESSED_R11_EAC, COMPRESSED_RG11_EAC, COMPRESSED_RGB8_ETC2,
1695bd8deadSopenharmony_ci        COMPRESSED_SRGB8_ETC2, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1705bd8deadSopenharmony_ci        COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, COMPRESSED_RGBA8_ETC2_EAC,
1715bd8deadSopenharmony_ci        COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1725bd8deadSopenharmony_ci        COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
1735bd8deadSopenharmony_ci        COMPRESSED_RGBA_S3TC_DXT3_EXT, COMPRESSED_RGBA_S3TC_DXT5_EXT,
1745bd8deadSopenharmony_ci        COMPRESSED_RGBA_ASTC_*_KHR, COMPRESSED_SRGB8_ALPHA8_ASTC_*_KHR
1755bd8deadSopenharmony_ci     "snorm" for the following compressed internal formats:
1765bd8deadSopenharmony_ci        COMPRESSED_SIGNED_R11_EAC, COMPRESSED_SIGNED_RG11_EAC
1775bd8deadSopenharmony_ci     "float" for the following compressed internal formats:
1785bd8deadSopenharmony_ci        (currently none -- to be added by any extension adding BPTC support)
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    Add the following to the table caption:
1815bd8deadSopenharmony_ci    "The 'Border Type' field determines how border colors are clamped as
1825bd8deadSopenharmony_ci    described in section 3.8.10."
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    Modifications to Section 3.8.7 "Texture Parameters"
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    Add the following to the list of TexParameter commands (p.223):
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci        void TexParameterI{i ui}vOES(enum target, enum pname,
1895bd8deadSopenharmony_ci                                     const T *params);
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    Modify the last sentence of the description of the commands to state:
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci    "In the first form of the command, <param> is a value to which to
1955bd8deadSopenharmony_ci    set a single-valued parameter; in the remaining forms, <params> is an
1965bd8deadSopenharmony_ci    array of parameters whose type depends on the parameter being set."
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci    Add a new paragraph at the end of p.145 after the paragraph about data
1995bd8deadSopenharmony_ci    conversions:
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    "In addition, if the values for TEXTURE_BORDER_COLOR_OES are specified
2025bd8deadSopenharmony_ci    with TexParameterIiv or TexParameterIuiv, the values are unmodified and
2035bd8deadSopenharmony_ci    stored with an internal data type of integer or unsigned integer,
2045bd8deadSopenharmony_ci    respectively. If specified with TexParameteriv, they are converted to
2055bd8deadSopenharmony_ci    floating-point using equation 2.2. Otherwise, the values are unmodified
2065bd8deadSopenharmony_ci    and stored as floating-point. An INVALID_ENUM error is generated if
2075bd8deadSopenharmony_ci    TexParameter{if} is called for a non-scalar parameters
2085bd8deadSopenharmony_ci    (TEXTURE_BORDER_COLOR_OES)."
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    Modify Table 3.17, edit the following rows (adding
2115bd8deadSopenharmony_ci    CLAMP_TO_BORDER_OES to each of the wrap modes):
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    Name             Type      Legal Values
2145bd8deadSopenharmony_ci    ==============   ====   ====================
2155bd8deadSopenharmony_ci    TEXTURE_WRAP_S   enum   CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT,
2165bd8deadSopenharmony_ci                              CLAMP_TO_BORDER_OES
2175bd8deadSopenharmony_ci    TEXTURE_WRAP_T   enum   CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT,
2185bd8deadSopenharmony_ci                              CLAMP_TO_BORDER_OES
2195bd8deadSopenharmony_ci    TEXTURE_WRAP_R   enum   CLAMP_TO_EDGE, REPEAT, MIRRORED_REPEAT,
2205bd8deadSopenharmony_ci                              CLAMP_TO_BORDER_OES
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    and add the following row:
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    Name                      Type       Legal Values
2255bd8deadSopenharmony_ci    ==============            ========   ====================
2265bd8deadSopenharmony_ci    TEXTURE_BORDER_COLOR_OES  4 floats,  any 4 values
2275bd8deadSopenharmony_ci                              ints, or
2285bd8deadSopenharmony_ci                              uints
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    Modifications to Section 3.8.9 "Cube Map Texture Selection"
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    In the "Seamless Cube Map Filtering" subsection change the rule
2335bd8deadSopenharmony_ci    about LINEAR filtering to state:
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    "* If LINEAR filtering is done within a miplevel, always apply
2365bd8deadSopenharmony_ci    wrap mode CLAMP_TO_BORDER_OES. Then, ..."
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    Modifications to Section 3.8.10 "Texture Minification"
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci    Modify Table 3.19, edit the cell that says:
2415bd8deadSopenharmony_ci    "border clamping (used only for cube maps with LINEAR filter)"
2425bd8deadSopenharmony_ci    and replace it with "CLAMP_TO_BORDER_OES".
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    In the subsection "Coordinate Wrapping and Texel Selection"
2455bd8deadSopenharmony_ci    add the following text at the end of the description for when
2465bd8deadSopenharmony_ci    TEXTURE_MIN_FILTER is NEAREST:
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    "If the selected (i,j,k), (i,j) or i location refers to a border texel
2495bd8deadSopenharmony_ci    that satisfies any of the conditions:
2505bd8deadSopenharmony_ci        i < 0, j < 0, k < 0, i >= w_t, j >= h_t, k >= d_t
2515bd8deadSopenharmony_ci    then the border values defined by TEXTURE_BORDER_COLOR_OES are used
2525bd8deadSopenharmony_ci    in place of the non-existent texel.  If the texture contains color
2535bd8deadSopenharmony_ci    components, the values of TEXTURE_BORDER_COLOR_OES are interpreted
2545bd8deadSopenharmony_ci    as an RGBA color to match the texture's internal format in a manner
2555bd8deadSopenharmony_ci    consistent with table 3.11.  The internal data type of the border
2565bd8deadSopenharmony_ci    colors must be consistent with the type returned by the texture as
2575bd8deadSopenharmony_ci    described in chapter 3, or the result is undefined. Border values are
2585bd8deadSopenharmony_ci    clamped before they are used, according to the format in which the
2595bd8deadSopenharmony_ci    texture components are stored. For signed and unsigned normalized
2605bd8deadSopenharmony_ci    fixed-point formats, border values are clamped to [-1,1] and [0,1]
2615bd8deadSopenharmony_ci    respectively. For floating-point and integer formats, border values
2625bd8deadSopenharmony_ci    are clamped to the representable range of the format. For compressed
2635bd8deadSopenharmony_ci    formats, border values are clamped as signed normalized ("snorm"),
2645bd8deadSopenharmony_ci    unsigned normalized ("unorm"), or floating-point as described in
2655bd8deadSopenharmony_ci    Table 3.16 for each format.  If the texture contains depth components,
2665bd8deadSopenharmony_ci    the first component of TEXTURE_BORDER_COLOR_OES is interpreted as a
2675bd8deadSopenharmony_ci    depth value."
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci    Add the following text at the end of the description for when
2705bd8deadSopenharmony_ci    TEXTURE_MIN_FILTER is LINEAR:
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    "For any texel in the equation above that refers to a border texel
2735bd8deadSopenharmony_ci    outside the defined range of the image, the texel value is taken
2745bd8deadSopenharmony_ci    from the texture border color as with NEAREST filtering."
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci    Modifications to Section 3.7.14 "Texture state"
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    Modify the second paragraph as follows:
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    "Next, there are four sets of texture properties... Each set consists
2815bd8deadSopenharmony_ci    of the selected minification and magnification filters, the wrap modes
2825bd8deadSopenharmony_ci    for s, t, r (three-dimensional only), the TEXTURE_BORDER_COLOR_OES,
2835bd8deadSopenharmony_ci    two floating-point numbers ...  In the initial state, ... wrap modes
2845bd8deadSopenharmony_ci    are set to REPEAT, and the value of TEXTURE_BORDER_COLOR_OES is
2855bd8deadSopenharmony_ci    (0,0,0,0). ..."
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 3.0.2 Specification
2885bd8deadSopenharmony_ci(State and State Requests)
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    Modifications to Section 6.1.3 "Enumerated Queries"
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci    Add the following command in a list with GetTexParameter{if}v:
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci        void GetTexParameterI{i ui}v(enum target, enum pname, T *data);
2955bd8deadSopenharmony_ci
2965bd8deadSopenharmony_ci    Append the following to the description of the GetTexParameter* commands:
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    "Querying <pname> TEXTURE_BORDER_COLOR_OES with GetTexParameterIiv or
2995bd8deadSopenharmony_ci    GetTexParameterIuiv returns the border color values as signed integers
3005bd8deadSopenharmony_ci    or unsigned integers, respectively; otherwise the values are returned
3015bd8deadSopenharmony_ci    as described in section 6.1.2. If the border color is queried with a
3025bd8deadSopenharmony_ci    type that does not match the original type with which it was specified,
3035bd8deadSopenharmony_ci    the result is undefined."
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    Modifications to Section 6.1.5 "Sampler Queries"
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci    Add the following command in a list with GetSamplerParameter{if}v:
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci        void GetSamplerParameterI{i ui}v(uint sampler, enum pname, T *params);
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci    Append the following to the description of the GetSamplerParameter*
3125bd8deadSopenharmony_ci    commands:
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci    "Querying TEXTURE_BORDER_COLOR_OES with GetSamplerParameterIiv or
3155bd8deadSopenharmony_ci    GetSamplerParameterIuiv returns the border color values as signed integers
3165bd8deadSopenharmony_ci    or unsigned integers, respectively; otherwise the values are returned
3175bd8deadSopenharmony_ci    as described in section 6.1.2. If the border color is queried with a
3185bd8deadSopenharmony_ci    type that does not match the original type with which it was specified,
3195bd8deadSopenharmony_ci    the result is undefined."
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ciErrors
3225bd8deadSopenharmony_ci
3235bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if TexParameter{if} is called for
3245bd8deadSopenharmony_ci    a non-scalar parameter (TEXTURE_BORDER_COLOR_OES).
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by TexParameterI*v if
3275bd8deadSopenharmony_ci    <target> is not one of the valid types of texture targets accepted
3285bd8deadSopenharmony_ci    by TexParameter{if}v.
3295bd8deadSopenharmony_ci
3305bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by TexParameterI*v if <pname>
3315bd8deadSopenharmony_ci    is not one of the values listed in Table 3.17.
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by TexParameterI*v if the type
3345bd8deadSopenharmony_ci    of the parameter specified by <pname> is enum, and the value(s)
3355bd8deadSopenharmony_ci    specified by <params> is not among the legal values shown in
3365bd8deadSopenharmony_ci    Table 3.17.
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by GetTexParameterI*v if
3395bd8deadSopenharmony_ci    <target> is not one of the valid types of texture targets accepted
3405bd8deadSopenharmony_ci    by GetTexParameter{if}v.
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by GetTexParameterI*v if
3435bd8deadSopenharmony_ci    <pname> is not one of values accepted by GetTexParameter{if}v.
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if SamplerParameter{if} is called
3465bd8deadSopenharmony_ci    for a non-scalar parameter (TEXTURE_BORDER_COLOR_OES).
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by SamplerParameterI*v
3495bd8deadSopenharmony_ci    if <sampler> is not the name of a sampler object previously returned
3505bd8deadSopenharmony_ci    from a call to GenSamplers.
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by SamplerParameterI*v if
3535bd8deadSopenharmony_ci    <pname> is not the name of a parameter accepted by SamplerParameter*.
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by GetSamplerParameterI*v
3565bd8deadSopenharmony_ci    if <sampler> is not the name of a sampler object previously returned
3575bd8deadSopenharmony_ci    from a call to GenSamplers.
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by GetSamplerParameterI*v if
3605bd8deadSopenharmony_ci    <pname> is not the name of a parameter accepted by GetSamplerParameter*.
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ciNew State
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    Modify table 6.10:
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    Change the type information changes for these parameters.
3685bd8deadSopenharmony_ci                                                      Initial
3695bd8deadSopenharmony_ci    Get Value         Type   Get Command          Value   Description    Sec.
3705bd8deadSopenharmony_ci    ---------         ------ -----------          ------- -----------    ----
3715bd8deadSopenharmony_ci    TEXTURE_WRAP_S    n x Z4 GetSamplerParameter  (as before...)
3725bd8deadSopenharmony_ci    TEXTURE_WRAP_T    n x Z4 GetSamplerParameter  (as before...)
3735bd8deadSopenharmony_ci    TEXTURE_WRAP_R    n x Z4 GetSamplerParameter  (as before...)
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci    Add the following parameter:
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    Get Value                 Type   Get Command          Value           Description   Sec.
3785bd8deadSopenharmony_ci    ---------                 ------ -----------          -------         -----------   ----
3795bd8deadSopenharmony_ci    TEXTURE_BORDER_COLOR_OES  4 x C  GetSamplerParameter  0.0,0.0,0.0,0.0 border color  3.8
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci
3825bd8deadSopenharmony_ciDependencies on OpenGL ES 3.0
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    If OpenGL ES 3.0 is not supported, but OES_texture_3D is supported,
3855bd8deadSopenharmony_ci    replace references to TEXTURE_WRAP_R with TEXTURE_WRAP_R_OES.
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci    If OpenGL ES 3.0 is not supported, delete all references to the
3885bd8deadSopenharmony_ci    TexParameterI*, GetTexParameterI*, SamplerParameterI*, and
3895bd8deadSopenharmony_ci    GetSamplerParameterI* entry points and all related text about
3905bd8deadSopenharmony_ci    signed and unsigned integer textures.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ciDependencies on OES_texture_3D
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci    If neither OpenGL ES 3.0 nor OES_texture_3D is supported, ignore all
3955bd8deadSopenharmony_ci    references to three-dimensional textures and the token TEXTURE_WRAP_R
3965bd8deadSopenharmony_ci    as well as any reference to r wrap modes. References to (i,j,k), k,
3975bd8deadSopenharmony_ci    and d_t in section 3.8.10 should also be removed.
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ciDependencies on EXT_texture_compression_s3tc
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci    If EXT_texture_compression is not supported, ignore all references to
4025bd8deadSopenharmony_ci    S3TC compressed textures.
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ciDependencies on KHR_texture_compression_astc_{ldr,hdr}
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci    If none of the KHR_texture_compression_astc extensions are supported,
4075bd8deadSopenharmony_ci    ignore all references to ASTC compressed textures.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ciIssues
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    (1) Which is the correct equation to use for converting
4125bd8deadSopenharmony_ci    TEXTURE_BORDER_COLOR_OES when specified via SamplerParameteriv
4135bd8deadSopenharmony_ci    or TexParameteriv?
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    RESOLVED: Early versions of GL 4.4 referenced both equations 2.1 and 2.2.
4165bd8deadSopenharmony_ci    As per clarification in Bug 11185, the correct answer is equation 2.2.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    (2) Does SamplerParmeter{if} set an error if called with
4195bd8deadSopenharmony_ci    a non-scalar parameter?
4205bd8deadSopenharmony_ci
4215bd8deadSopenharmony_ci    RESOLVED: Yes. This should be analogous to TexParameteriv.
4225bd8deadSopenharmony_ci    This error seems to be missing from GL 4.4. Filed bug 11186
4235bd8deadSopenharmony_ci    to get this rectified.
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    (3) Should the second argument to GetTexParameterI* be <value> or <pname>?
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci    RESOLVED: the GL specs call it <value>, but the headers call it <pname>.
4285bd8deadSopenharmony_ci    The GetSamplerParameterI* version calls it <pname>, so we are doing the
4295bd8deadSopenharmony_ci    same here for consistency. This was corrected in OpenGL ES 3.1.
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ciRevision History
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
4345bd8deadSopenharmony_ci    ----  --------  --------- -------------------------------------------------
4355bd8deadSopenharmony_ci     1    06/18/2014   dkoch     Initial OES version based on EXT.
4365bd8deadSopenharmony_ci                                 No functional changes.
437