15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_texture_compression_latc
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_texture_compression_latc
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Contributors to the OpenGL EXT_texture_compression_latc extension
125bd8deadSopenharmony_ci    Greg Roth, NVIDIA
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContact
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Ian Stewart, NVIDIA Corporation (istewart 'at' nvidia.com)
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciStatus
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Complete.
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciVersion
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Last Modifed Date: Oct 26, 2012
255bd8deadSopenharmony_ci    NVIDIA Revision: 1
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciNumber
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    OpenGL ES Extension #130
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciDependencies
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 2.0.25
345bd8deadSopenharmony_ci    Specification.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    This extension interacts with NV_texture_array
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciOverview
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    This extension introduces four new block-based texture compression
415bd8deadSopenharmony_ci    formats suited for unsigned and signed luminance and luminance-alpha
425bd8deadSopenharmony_ci    textures (hence the name "latc" for Luminance-Alpha Texture
435bd8deadSopenharmony_ci    Compression).
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    These formats are designed to reduce the storage requirements and
465bd8deadSopenharmony_ci    memory bandwidth required for luminance and luminance-alpha textures
475bd8deadSopenharmony_ci    by a factor of 2-to-1 over conventional uncompressed luminance and
485bd8deadSopenharmony_ci    luminance-alpha textures with 8-bit components.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    The compressed signed luminance-alpha format is reasonably suited
515bd8deadSopenharmony_ci    for storing compressed normal maps.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciNew Tokens
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    Accepted by the <internalformat> parameter of CompressedTexImage2D
565bd8deadSopenharmony_ci    and CompressedTexSubImage2D:
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci        COMPRESSED_LUMINANCE_LATC1_NV                   0x8C70
595bd8deadSopenharmony_ci        COMPRESSED_SIGNED_LUMINANCE_LATC1_NV            0x8C71
605bd8deadSopenharmony_ci        COMPRESSED_LUMINANCE_ALPHA_LATC2_NV             0x8C72
615bd8deadSopenharmony_ci        COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV      0x8C73
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0.25 Specification
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    Modify Section 3.7.3, "Compressed Texture Images"
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    (Replace first two sentences with)
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Texture images may also be specified or modified using image data
705bd8deadSopenharmony_ci    already stored in a known compressed image format.  The GL defines
715bd8deadSopenharmony_ci    some specific compressed formats, and others may be defined by GL
725bd8deadSopenharmony_ci    extensions.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    (Insert after section describing CompressedTexImage2D)
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    The specific compressed texture formats supported by
775bd8deadSopenharmony_ci    CompressedTexImage2D, and the corresponding base internal format
785bd8deadSopenharmony_ci    for each specific format, are defined in table 3.X.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci        Table 3.X: "Specific compressed texture formats"
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci        Compressed Internal Formats                Base Internal Format
835bd8deadSopenharmony_ci        ===========================                ====================
845bd8deadSopenharmony_ci        COMPRESSED_LUMINANCE_LATC1_NV              LUMINANCE
855bd8deadSopenharmony_ci        COMPRESSED_SIGNED_LUMINANCE_LATC1_NV       LUMINANCE
865bd8deadSopenharmony_ci        COMPRESSED_LUMINANCE_ALPHA_LATC2_NV        LUMINANCE_ALPHA
875bd8deadSopenharmony_ci        COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV LUMINANCE_ALPHA
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    (Replace last paragraph with)
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    If the internal format is one of COMPRESSED_LUMINANCE_LATC1_NV,
925bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_LATC1_NV,
935bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_ALPHA_LATC2_NV, or
945bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV, the compressed texture
955bd8deadSopenharmony_ci    is stored using one of the two LATC compressed texture image
965bd8deadSopenharmony_ci    encodings and is easily edited along 4x4 texel boundaries. In this
975bd8deadSopenharmony_ci    case, CompressedTexImage2D will result in an INVALID_OPERATION
985bd8deadSopenharmony_ci    error if one of the following conditions occurs:
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci        * <width> is not a multiple of four, and <width> plus
1015bd8deadSopenharmony_ci          <xoffset> is not equal to TEXTURE_WIDTH;
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci        * <height> is not a multiple of four, and <height> plus
1045bd8deadSopenharmony_ci          <yoffset> is not equal to TEXTURE_HEIGHT; or
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci        * <xoffset> or <yoffset> is not a multiple of four.
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    For any other formats, calling CompressedTexSubImage2D will result
1095bd8deadSopenharmony_ci    in an INVALID_OPERATION error if <xoffset> or <yoffset> is not
1105bd8deadSopenharmony_ci    equal to zero, or if <width> and <height> do not match the width
1115bd8deadSopenharmony_ci    and height of the texture, respectively. The contents of any texel
1125bd8deadSopenharmony_ci    outside the region modified by the call are undefined. These
1135bd8deadSopenharmony_ci    restrictions may be relaxed for other specific compressed internal
1145bd8deadSopenharmony_ci    formats whose images are easily modified.
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ciInteractions with NV_texture_array
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    If NV_texture_array is supported, the LATC compressed formats may
1195bd8deadSopenharmony_ci    also be used as the internal formats given to
1205bd8deadSopenharmony_ci    CompressedTexImage3DNV and CompressedTexSubImage3DNV. The
1215bd8deadSopenharmony_ci    restrictions for the <width>, <height>, <xoffset>, and <yoffset>
1225bd8deadSopenharmony_ci    parameters of the CompressedTexSubImage2D function when used with
1235bd8deadSopenharmony_ci    LATC compressed texture formats, described in this extension, also
1245bd8deadSopenharmony_ci    apply to the identically named parameters of
1255bd8deadSopenharmony_ci    CompressedTexSubImage3DNV.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ciErrors
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    INVALID_OPERATION is generated by CopyTexSubImage2D if the texture
1305bd8deadSopenharmony_ci    image <level> bound to <target> has internal format
1315bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_LATC1_NV,
1325bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_LATC1_NV,
1335bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_ALPHA_LATC2_NV, or
1345bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    INVALID_OPERATION is generated by CompressedTexSubImage2D if
1375bd8deadSopenharmony_ci    <internalformat> is COMPRESSED_LUMINANCE_LATC1_NV,
1385bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_LATC1_NV,
1395bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_ALPHA_LATC2_NV, or
1405bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV and any of the
1415bd8deadSopenharmony_ci    following apply:
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci        * <width> is not a multiple of four, and <width> plus
1445bd8deadSopenharmony_ci          <xoffset> is not equal to the texture width;
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci        * <height> is not a multiple of four, and <height> plus
1475bd8deadSopenharmony_ci          <yoffset> is not equal to the texture height; or
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci        * <xoffset> or <yoffset> is not a multiple of four.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ciNew State
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    The queries for NUM_COMPRESSED_TEXTURE_FORMATS and
1545bd8deadSopenharmony_ci    COMPRESSED_TEXTURE_FORMATS include COMPRESSED_LUMINANCE_LATC1_NV,
1555bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_LATC1_NV,
1565bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_ALPHA_LATC2_NV, and
1575bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV.
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ciAppendix
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    LATC Compressed Texture Image Formats
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    Compressed texture images stored using the LATC compressed image
1645bd8deadSopenharmony_ci    encodings are represented as a collection of 4x4 texel blocks,
1655bd8deadSopenharmony_ci    where each block contains 64 or 128 bits of texel data.  The image
1665bd8deadSopenharmony_ci    is encoded as a normal 2D raster image in which each 4x4 block is
1675bd8deadSopenharmony_ci    treated as a single pixel.  If an LATC image has a width or height
1685bd8deadSopenharmony_ci    that is not a multiple of four, the data corresponding to texels
1695bd8deadSopenharmony_ci    outside the image are irrelevant and undefined.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    When an LATC image with a width of <w>, height of <h>, and block
1725bd8deadSopenharmony_ci    size of <blocksize> (8 or 16 bytes) is decoded, the corresponding
1735bd8deadSopenharmony_ci    image size (in bytes) is:
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci        ceil(<w>/4) * ceil(<h>/4) * blocksize.
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    When decoding an LATC image, the block containing the texel at
1785bd8deadSopenharmony_ci    offset (<x>, <y>) begins at an offset (in bytes) relative to the
1795bd8deadSopenharmony_ci    base of the image of:
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci        blocksize * (ceil(<w>/4) * floor(<y>/4) + floor(<x>/4)).
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    The data corresponding to a specific texel (<x>, <y>) are
1845bd8deadSopenharmony_ci    extracted from a 4x4 texel block using a relative (x,y) value of
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci        (<x> modulo 4, <y> modulo 4).
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    There are four distinct LATC image formats:
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_LATC1_NV:  Each 4x4 block of texels consists
1915bd8deadSopenharmony_ci    of 64 bits of unsigned luminance image data.
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci        Each luminance image data block is encoded as a sequence of 8
1945bd8deadSopenharmony_ci        bytes, called (in order of increasing address):
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci            lum0, lum1, bits_0, bits_1, bits_2, bits_3, bits_4, bits_5
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci        The 6 "bits_*" bytes of the block are decoded into a 48-bit
1995bd8deadSopenharmony_ci        bit vector:
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci            bits   = bits_0 +
2025bd8deadSopenharmony_ci                     256 * (bits_1 +
2035bd8deadSopenharmony_ci                            256 * (bits_2 +
2045bd8deadSopenharmony_ci                                   256 * (bits_3 +
2055bd8deadSopenharmony_ci                                          256 * (bits_4 +
2065bd8deadSopenharmony_ci                                                 256 * bits_5))))
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci        lum0 and lum1 are 8-bit unsigned integers that are unpacked to
2095bd8deadSopenharmony_ci        luminance values LUM0 and LUM1 as though they were pixels with
2105bd8deadSopenharmony_ci        a <format> of LUMINANCE and a type of UNSIGNED_BTYE.
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci        bits is a 48-bit unsigned integer, from which a three-bit control
2135bd8deadSopenharmony_ci        code is extracted for a texel at location (x,y) in the block
2145bd8deadSopenharmony_ci        using:
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci            code(x,y) = bits[3*(4*y+x)+2..3*(4*y+x)+0]
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci        where bit 47 is the most significant and bit 0 is the least
2195bd8deadSopenharmony_ci        significant bit.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci        The luminance value L for a texel at location (x,y) in the block
2225bd8deadSopenharmony_ci        is given by:
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci            LUM0,              if lum0 > lum1 and code(x,y) == 0
2255bd8deadSopenharmony_ci            LUM1,              if lum0 > lum1 and code(x,y) == 1
2265bd8deadSopenharmony_ci            (6*LUM0+  LUM1)/7, if lum0 > lum1 and code(x,y) == 2
2275bd8deadSopenharmony_ci            (5*LUM0+2*LUM1)/7, if lum0 > lum1 and code(x,y) == 3
2285bd8deadSopenharmony_ci            (4*LUM0+3*LUM1)/7, if lum0 > lum1 and code(x,y) == 4
2295bd8deadSopenharmony_ci            (3*LUM0+4*LUM1)/7, if lum0 > lum1 and code(x,y) == 5
2305bd8deadSopenharmony_ci            (2*LUM0+5*LUM1)/7, if lum0 > lum1 and code(x,y) == 6
2315bd8deadSopenharmony_ci            (  LUM0+6*LUM1)/7, if lum0 > lum1 and code(x,y) == 7
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci            LUM0,              if lum0 <= lum1 and code(x,y) == 0
2345bd8deadSopenharmony_ci            LUM1,              if lum0 <= lum1 and code(x,y) == 1
2355bd8deadSopenharmony_ci            (4*LUM0+  LUM1)/5, if lum0 <= lum1 and code(x,y) == 2
2365bd8deadSopenharmony_ci            (3*LUM0+2*LUM1)/5, if lum0 <= lum1 and code(x,y) == 3
2375bd8deadSopenharmony_ci            (2*LUM0+3*LUM1)/5, if lum0 <= lum1 and code(x,y) == 4
2385bd8deadSopenharmony_ci            (  LUM0+4*LUM1)/5, if lum0 <= lum1 and code(x,y) == 5
2395bd8deadSopenharmony_ci            MINLUM,            if lum0 <= lum1 and code(x,y) == 6
2405bd8deadSopenharmony_ci            MAXLUM,            if lum0 <= lum1 and code(x,y) == 7
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci        MINLUM and MAXLUM are 0.0 and 1.0 respectively.
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci        Since the decoded texel has a luminance format, the resulting
2455bd8deadSopenharmony_ci        RGBA value for the texel is (L,L,L,1).
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_LATC1_NV:  Each 4x4 block of texels
2495bd8deadSopenharmony_ci    consists of 64 bits of signed luminance image data.  The luminance
2505bd8deadSopenharmony_ci    values of a texel are extracted in the same way as
2515bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_LATC1_NV except lum0, lum1, LUM0, LUM1,
2525bd8deadSopenharmony_ci    MINLUM, and MAXLUM are signed values defined as follows:
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci        lum0 and lum1 are 8-bit signed (two's complement) integers.
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci               { lum0 / 127.0, lum0 > -128
2575bd8deadSopenharmony_ci        LUM0 = {
2585bd8deadSopenharmony_ci               { -1.0,         lum0 == -128
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci               { lum1 / 127.0, lum1 > -128
2615bd8deadSopenharmony_ci        LUM1 = {
2625bd8deadSopenharmony_ci               { -1.0,         lum1 == -128
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci        MINLUM = -1.0
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci        MAXLUM =  1.0
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci        CAVEAT for signed lum0 and lum1 values: the expressions "lum0
2695bd8deadSopenharmony_ci        > lum1" and "lum0 <= lum1" above are considered undefined
2705bd8deadSopenharmony_ci        (read: may vary by implementation) when lum0 equals -127 and
2715bd8deadSopenharmony_ci        lum1 equals -128, This is because if lum0 were remapped to
2725bd8deadSopenharmony_ci        -127 prior to the comparison to reduce the latency of a
2735bd8deadSopenharmony_ci        hardware decompressor, the expressions would reverse their
2745bd8deadSopenharmony_ci        logic.  Encoders for the signed LA formats should avoid
2755bd8deadSopenharmony_ci        encoding blocks where lum0 equals -127 and lum1 equals -128.
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    COMPRESSED_LUMINANCE_ALPHA_LATC2_NV:  Each 4x4 block of texels
2795bd8deadSopenharmony_ci    consists of 64 bits of compressed unsigned luminance image data
2805bd8deadSopenharmony_ci    followed by 64 bits of compressed unsigned alpha image data.
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci        The first 64 bits of compressed luminance are decoded exactly
2835bd8deadSopenharmony_ci        like COMPRESSED_LUMINANCE_LATC1_NV above.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci        The second 64 bits of compressed alpha are decoded exactly
2865bd8deadSopenharmony_ci        like COMPRESSED_LUMINANCE_LATC1_NV above except the decoded
2875bd8deadSopenharmony_ci        value L for this second block is considered the resulting
2885bd8deadSopenharmony_ci        alpha value A.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci        Since the decoded texel has a luminance-alpha format, the
2915bd8deadSopenharmony_ci        resulting RGBA value for the texel is (L,L,L,A).
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV:  Each 4x4 block of
2955bd8deadSopenharmony_ci    texels consists of 64 bits of compressed signed luminance image
2965bd8deadSopenharmony_ci    data followed by 64 bits of compressed signed alpha image data.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci        The first 64 bits of compressed luminance are decoded exactly
2995bd8deadSopenharmony_ci        like COMPRESSED_SIGNED_LUMINANCE_LATC1_NV above.
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci        The second 64 bits of compressed alpha are decoded exactly
3025bd8deadSopenharmony_ci        like COMPRESSED_SIGNED_LUMINANCE_LATC1_NV above except the
3035bd8deadSopenharmony_ci        decoded value L for this second block is considered the
3045bd8deadSopenharmony_ci        resulting alpha value A.
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci        Since this image has a luminance-alpha format, the resulting
3075bd8deadSopenharmony_ci        RGBA value is (L,L,L,A).
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ciIssues
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci    1)  How are signed integer values mapped to floating-point values?
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci        RESOLVED:  A signed 8-bit two's complement value X is computed
3145bd8deadSopenharmony_ci        to a floating-point value Xf with the formula:
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ci                 { X / 127.0, X > -128
3175bd8deadSopenharmony_ci            Xf = {
3185bd8deadSopenharmony_ci                 { -1.0,      X == -128
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci        This conversion means -1, 0, and +1 are all exactly
3215bd8deadSopenharmony_ci        representable, however -128 and -127 both map to -1.0.
3225bd8deadSopenharmony_ci        Mapping -128 to -1.0 avoids the numerical awkwardness of
3235bd8deadSopenharmony_ci        having a representable value slightly more negative than -1.0.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    2)  Should the NUM_COMPRESSED_TEXTURE_FORMATS and
3265bd8deadSopenharmony_ci        COMPRESSED_TEXTURE_FORMATS queries return the LATC formats?
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci        RESOLVED:  No.
3295bd8deadSopenharmony_ci
3305bd8deadSopenharmony_ci        The OpenGL ES 2.0.25 specification says "The only values
3315bd8deadSopenharmony_ci        returned by this query [GL_COMPRESSED_TEXTURE_FORMATS] are
3325bd8deadSopenharmony_ci        those corresponding to 'internalformat' parameters accepted by
3335bd8deadSopenharmony_ci        CompressedTexImage2D and suitable for general-purpose usage.
3345bd8deadSopenharmony_ci        The renderer will not enumerate formats with restrictions that
3355bd8deadSopenharmony_ci        need to be specifically understood prior to use."
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci        Historically, OpenGL implementations have advertised the RGB
3385bd8deadSopenharmony_ci        and RGBA versions of the S3TC extensions compressed format
3395bd8deadSopenharmony_ci        tokens through this mechanism.
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci        The specification is not sufficiently clear about what
3425bd8deadSopenharmony_ci        "suitable for general-purpose usage" means.  Historically that
3435bd8deadSopenharmony_ci        seems to mean unsigned RGB or unsigned RGBA.  The DXT1 format
3445bd8deadSopenharmony_ci        supporting alpha (GL_COMPRESSED_RGBA_S3TC_DXT1_NV) is not
3455bd8deadSopenharmony_ci        exposed in the list (at least for NVIDIA drivers) because the
3465bd8deadSopenharmony_ci        alpha is always 1.0 except when it is 0.0 when RGB is required
3475bd8deadSopenharmony_ci        to be black.  NVIDIA's implementation even limits itself to
3485bd8deadSopenharmony_ci        true linear RGB or RGBA formats, specifically not including
3495bd8deadSopenharmony_ci        NV_sRGB_formats's sRGB S3TC compressed formats.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci        Adding luminance and luminance-alpha texture formats (and
3525bd8deadSopenharmony_ci        certainly signed versions of luminance and luminance-alpha
3535bd8deadSopenharmony_ci        formats) invites potential comptaibility problems with old
3545bd8deadSopenharmony_ci        applications using this mechanism since old applications are
3555bd8deadSopenharmony_ci        unlikely to expect non-RGB or non-RGBA formats to be
3565bd8deadSopenharmony_ci        advertised through this mechanism.  However no specific
3575bd8deadSopenharmony_ci        misinteractions with old applications is known.
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci        Applications that seek to use the LATC formats should do so by
3605bd8deadSopenharmony_ci        looking for this extension's name in the string returned by
3615bd8deadSopenharmony_ci        glGetString(GL_EXTENSIONS) rather than what
3625bd8deadSopenharmony_ci        GL_NUM_COMPRESSED_TEXTURE_FORMATS and
3635bd8deadSopenharmony_ci        GL_COMPRESSED_TEXTURE_FORMATS return.
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    3) The EXT_texture_compression_latc extension already lists
3665bd8deadSopenharmony_ci       GL_NV_texture_compression_latc as a name string. Do these
3675bd8deadSopenharmony_ci       extensions conflict?
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci       RESOLVED: No.
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci       The EXT_texture_compression_latc extension, written
3725bd8deadSopenharmony_ci       against the OpenGL 1.3 specification, was originally an
3735bd8deadSopenharmony_ci       NVIDIA-proprietary extension and published as
3745bd8deadSopenharmony_ci       NV_texture_compression_latc. It was later promoted to be an EXT
3755bd8deadSopenharmony_ci       extension, in part with S3, and was renamed. However, NVIDIA
3765bd8deadSopenharmony_ci       OpenGL implementations continue to expose the
3775bd8deadSopenharmony_ci       GL_NV_texture_compression_latc string for legacy reasons.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci       This extension, written against the OpenGL ES 2.0.25
3805bd8deadSopenharmony_ci       specification, provides a subset of the functionality of
3815bd8deadSopenharmony_ci       EXT_texture_compression_latc limited only by the differences
3825bd8deadSopenharmony_ci       between the OpenGL 1.3 and OpenGL ES 2.0 specifications. For
3835bd8deadSopenharmony_ci       example, format conversion from uncompressed data to compressed
3845bd8deadSopenharmony_ci       LATC formats via TexImage2D is not supported by this extension.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci       If the driver exporting the GL_NV_texture_compression_latc
3875bd8deadSopenharmony_ci       string is an OpenGL ES 2.0 driver (or an OpenGL driver using an
3885bd8deadSopenharmony_ci       ES 2.0 profile), this extension describes the available
3895bd8deadSopenharmony_ci       functionality. Otherwise, see EXT_texture_compression_latc.
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ciRevision History
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci    Rev.    Date        Author       Changes
3945bd8deadSopenharmony_ci    ----   --------     ---------    -------------------------------------
3955bd8deadSopenharmony_ci     1     10/26/2012   istewart     First revision, based of the
3965bd8deadSopenharmony_ci                                     EXT_texture_compression_latc
3975bd8deadSopenharmony_ci                                     specification.
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci# vim:ai:ts=4:sts=4:expandtab:textwidth=70
400