15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_packed_float
45bd8deadSopenharmony_ci    NV_packed_float_linear
55bd8deadSopenharmony_ci
65bd8deadSopenharmony_ciName Strings
75bd8deadSopenharmony_ci
85bd8deadSopenharmony_ci    GL_NV_packed_float
95bd8deadSopenharmony_ci    GL_NV_packed_float_linear
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ciContributors
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ci    Mark J. Kilgard, NVIDIA
145bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA
155bd8deadSopenharmony_ci    Koji Ashida, NVIDIA 
165bd8deadSopenharmony_ci    Greg Roth, NVIDIA
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciContact
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA (mheyer 'at' nvidia.com)
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci    
245bd8deadSopenharmony_ci    Complete
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified: 2012/09/26
295bd8deadSopenharmony_ci    NVIDIA Revision: 3
305bd8deadSopenharmony_ci    
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci    
335bd8deadSopenharmony_ci    OpenGL ES Extension #127
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciDependencies
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    Written against the OpenGL ES 2.0.25 (Nov. 2010) Specification.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    EXT_color_buffer_half_float affects the definition of this
415bd8deadSopenharmony_ci    specification.
425bd8deadSopenharmony_ci    
435bd8deadSopenharmony_ci    OES_texture_half_float affects the defintion of this specification.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    NV_framebuffer_multisample affects the defintion of this
465bd8deadSopenharmony_ci    specification.
475bd8deadSopenharmony_ci    
485bd8deadSopenharmony_ci    NV_texture_array affects the defintion of this specification.
495bd8deadSopenharmony_ci    
505bd8deadSopenharmony_ci    EXT_texture_storage affects the defintion of this specification.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciOverview
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    This extension adds a new 3-component floating-point texture format
565bd8deadSopenharmony_ci    that fits within a single 32-bit word.  This format stores 5 bits
575bd8deadSopenharmony_ci    of biased exponent per component in the same manner as 16-bit
585bd8deadSopenharmony_ci    floating-point formats, but rather than 10 mantissa bits, the red,
595bd8deadSopenharmony_ci    green, and blue components have 6, 6, and 5 bits respectively.
605bd8deadSopenharmony_ci    Each mantissa is assumed to have an implied leading one except in the
615bd8deadSopenharmony_ci    denorm exponent case.  There is no sign bit so only non-negative
625bd8deadSopenharmony_ci    values can be represented.  Positive infinity, positive denorms,
635bd8deadSopenharmony_ci    and positive NaN values are representable.  The value of the fourth
645bd8deadSopenharmony_ci    component returned by a texture fetch is always 1.0.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    This extension also provides support for rendering into an unsigned
675bd8deadSopenharmony_ci    floating-point rendering format with the assumption that the texture
685bd8deadSopenharmony_ci    format described above could also be advertised as an unsigned
695bd8deadSopenharmony_ci    floating-point format for rendering.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    The extension also provides a pixel external format for specifying
725bd8deadSopenharmony_ci    packed float values directly.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ciNew Tokens
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    Accepted by the <internalformat> parameter of RenderbufferStorage
785bd8deadSopenharmony_ci    and RenderBufferStorageMultisampleNV, TexStorage2DEXT and
795bd8deadSopenharmony_ci    TexStorage3DEXT:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci        R11F_G11F_B10F_NV                                   0x8C3A
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Accepted by the <type> parameter of ReadPixels, TexImage2D, 
845bd8deadSopenharmony_ci    TexSubImage2D, TexImage3DNV, TexSubImage3DNV:
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV                     0x8C3B
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    
895bd8deadSopenharmony_ciChanges to Chapter 2 of the OpenGL ES 2.0.25 Specification
905bd8deadSopenharmony_ci(OpenGL Operation)
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    Add two new sections after Section "Floating-Point Computation":
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci        "Unsigned 11-Bit Floating-Point Numbers"
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci        An unsigned 11-bit floating-point number has no sign bit, a 5-bit
975bd8deadSopenharmony_ci        exponent (E), and a 6-bit mantissa (M).  The value of an unsigned
985bd8deadSopenharmony_ci        11-bit floating-point number (represented as an 11-bit unsigned
995bd8deadSopenharmony_ci        integer N) is determined by the following: 
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci            0.0,                      if E == 0 and M == 0,
1025bd8deadSopenharmony_ci            2^-14 * (M / 64),         if E == 0 and M != 0,
1035bd8deadSopenharmony_ci            2^(E-15) * (1 + M/64),    if 0 < E < 31,
1045bd8deadSopenharmony_ci            INF,                      if E == 31 and M == 0, or
1055bd8deadSopenharmony_ci            NaN,                      if E == 31 and M != 0,
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci        where
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci            E = floor(N / 64), and
1105bd8deadSopenharmony_ci            M = N mod 64.
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci        Implementations are also allowed to use any of the following
1135bd8deadSopenharmony_ci        alternative encodings:
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci            0.0,                      if E == 0 and M != 0
1165bd8deadSopenharmony_ci            2^(E-15) * (1 + M/64)     if E == 31 and M == 0
1175bd8deadSopenharmony_ci            2^(E-15) * (1 + M/64)     if E == 31 and M != 0
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci        When a floating-point value is converted to an unsigned 11-bit
1205bd8deadSopenharmony_ci        floating-point representation, finite values are rounded to the 
1215bd8deadSopenharmony_ci        closet representable finite value.  While less accurate, 
1225bd8deadSopenharmony_ci        implementations are allowed to always round in the direction of 
1235bd8deadSopenharmony_ci        zero.  This means negative values are converted to zero.  
1245bd8deadSopenharmony_ci        Likewise, finite positive values greater than 65024 (the maximum 
1255bd8deadSopenharmony_ci        finite representable unsigned 11-bit floating-point value) are 
1265bd8deadSopenharmony_ci        converted to 65024.  Additionally: negative infinity is converted 
1275bd8deadSopenharmony_ci        to zero; positive infinity is converted to positive infinity; and 
1285bd8deadSopenharmony_ci        both positive and negative NaN are converted to positive NaN.
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci        Any representable unsigned 11-bit floating-point value is legal
1315bd8deadSopenharmony_ci        as input to a GL command that accepts 11-bit floating-point data.
1325bd8deadSopenharmony_ci        The result of providing a value that is not a floating-point 
1335bd8deadSopenharmony_ci        number (such as infinity or NaN) to such a command is unspecified,
1345bd8deadSopenharmony_ci        but must not lead to GL interruption or termination.  Providing a
1355bd8deadSopenharmony_ci        denormalized number or negative zero to GL must yield predictable 
1365bd8deadSopenharmony_ci        results.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci        "Unsigned 10-Bit Floating-Point Numbers"
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci        An unsigned 10-bit floating-point number has no sign bit, a 5-bit
1415bd8deadSopenharmony_ci        exponent (E), and a 5-bit mantissa (M).  The value of an unsigned
1425bd8deadSopenharmony_ci        10-bit floating-point number (represented as an 10-bit unsigned
1435bd8deadSopenharmony_ci        integer N) is determined by the following: 
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci            0.0,                      if E == 0 and M == 0,
1465bd8deadSopenharmony_ci            2^-14 * (M / 32),         if E == 0 and M != 0,
1475bd8deadSopenharmony_ci            2^(E-15) * (1 + M/32),    if 0 < E < 31,
1485bd8deadSopenharmony_ci            INF,                      if E == 31 and M == 0, or
1495bd8deadSopenharmony_ci            NaN,                      if E == 31 and M != 0,
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        where
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci            E = floor(N / 32), and
1545bd8deadSopenharmony_ci            M = N mod 32.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci        When a floating-point value is converted to an unsigned 10-bit
1575bd8deadSopenharmony_ci        floating-point representation, finite values are rounded to the 
1585bd8deadSopenharmony_ci        closet representable finite value.  While less accurate, 
1595bd8deadSopenharmony_ci        implementations are allowed to always round in the direction of 
1605bd8deadSopenharmony_ci        zero.  This means negative values are converted to zero.  
1615bd8deadSopenharmony_ci        Likewise, finite positive values greater than 64512 (the maximum 
1625bd8deadSopenharmony_ci        finite representable unsigned 10-bit floating-point value) are 
1635bd8deadSopenharmony_ci        converted to 64512.  Additionally: negative infinity is converted 
1645bd8deadSopenharmony_ci        to zero; positive infinity is converted to positive infinity; and 
1655bd8deadSopenharmony_ci        both positive and negative NaN are converted to positive NaN.
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci        Any representable unsigned 10-bit floating-point value is legal
1685bd8deadSopenharmony_ci        as input to a GL command that accepts 10-bit floating-point data.
1695bd8deadSopenharmony_ci        The result of providing a value that is not a floating-point 
1705bd8deadSopenharmony_ci        number (such as infinity or NaN) to such a command is 
1715bd8deadSopenharmony_ci        unspecified, but must not lead to GL interruption or termination.
1725bd8deadSopenharmony_ci        Providing a denormalized number or negative zero to GL must yield 
1735bd8deadSopenharmony_ci        predictable results.
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ciChanges to Chapter 3 of the OpenGL ES 2.0.25 Specification (Rasterization)
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci    Add to Table 3.2, p. 62:
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci        type Parameter                   Corresponding  Special
1815bd8deadSopenharmony_ci        Token Name                       GL Data Type   Interpretation
1825bd8deadSopenharmony_ci        -------------------------------  -------------  --------------
1835bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV  uint           Yes
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Add to Table 3.4, p. 63:
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci        Format           Type                             Bytes per Pixel
1885bd8deadSopenharmony_ci        ---------        -------------------------------  ---------------
1895bd8deadSopenharmony_ci        RGB              UNSIGNED_INT_10F_11F_11F_REV_NV  4
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci  Add to Table 3.5, p. 64:
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci        type Parameter                    GL Data  Number of   Matching  
1945bd8deadSopenharmony_ci        Token Name                        Type     Components  Pixel Formats
1955bd8deadSopenharmony_ci        -------------------------------   -------  ----------  --------------
1965bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV   uint     3           RGB
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci  Add the following to section 3.6.2 Transfor of Pixel Rectangles,
2005bd8deadSopenharmony_ci  subsection Unpacking
2015bd8deadSopenharmony_ci    
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV:
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci         31 30 ... 23 22 21 20 ... 12 11 10  9 ...  1  0
2065bd8deadSopenharmony_ci        +---------------+---------------+---------------+
2075bd8deadSopenharmony_ci        |      3rd      |      2nd      |      1st      |
2085bd8deadSopenharmony_ci        +---------------+---------------+---------------+
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ciChanges to Chapter 4 of the OpenGL ES 2.0.25 Specification 
2125bd8deadSopenharmony_ci(Per-Fragment Operations and the Framebuffer)
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    Add the following to the end of Section 4.3, subsection
2155bd8deadSopenharmony_ci    "Final Color Conversion"
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci        If an implementation allows calling ReadPixels with a <type> of 
2185bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV and format of RGB, the conversion
2195bd8deadSopenharmony_ci        is done as follows:  The returned data are packed into a series of
2205bd8deadSopenharmony_ci        GL uint values. The red, green, and blue components are converted
2215bd8deadSopenharmony_ci        to unsigned 11-bit floating-point, unsigned 11-bit floating-point,
2225bd8deadSopenharmony_ci        and unsigned 10-bit floating point as described in section
2235bd8deadSopenharmony_ci        2.1.A and 2.1.B.  The resulting red 11 bits, green 11 bits, and blue
2245bd8deadSopenharmony_ci        10 bits are then packed as the 1st, 2nd, and 3rd components of the
2255bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV format as shown in Section 3.6.
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    Add to Table 4.4, p. 106:
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci        type Parameter                                  Component
2315bd8deadSopenharmony_ci        Token Name                       GL Data Type   Conversion Formula
2325bd8deadSopenharmony_ci        --------------                   -------------  ------------------
2335bd8deadSopenharmony_ci        UNSIGNED_INT_10F_11F_11F_REV_NV  uint           c = f
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    (modify "Final Conversion", p. 106):
2365bd8deadSopenharmony_ci        If type is not FLOAT, HALF_FLOAT_OES or UNSIGNED_INT_10F_11F_11F_REV_NV,
2375bd8deadSopenharmony_ci        each component is first clamped to [0,1]. Then the appropriate conversion...
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    Add to Table 4.5, p. 117:
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci        Sized              Renderable        R     G     B     A     D     S
2425bd8deadSopenharmony_ci        Internal Format    Type              bits  bits  bits  bits  bits  bits
2435bd8deadSopenharmony_ci        ---------------    ----------------  ----  ----  ----  ----  ----  ----
2445bd8deadSopenharmony_ci        R11F_G11F_B10F_NV  color-renderable  f11   f11   f10
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ciErrors
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    Relaxation of INVALID_ENUM errors
2505bd8deadSopenharmony_ci    ---------------------------------
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    RenderbufferStorage and RenderBufferStorageMultisampleNV accept
2535bd8deadSopenharmony_ci    the new R11F_G11F_B10F_EXT token for <internalformat>.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    ReadPixels, TexImage2D, TexSubImage2D, TexImage3DNV and
2565bd8deadSopenharmony_ci    TexSubImage3DNV accept the new UNSIGNED_INT_10F_11F_11F_REV_EXT
2575bd8deadSopenharmony_ci    token for <type>.
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    New errors
2615bd8deadSopenharmony_ci    ----------
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ci    INVALID_OPERATION is generated by ReadPixels, TexImage2D,
2645bd8deadSopenharmony_ci    TexSubImage2D, TexImage3DNV and TexSubImage3DNV if <type> is
2655bd8deadSopenharmony_ci    UNSIGNED_INT_10F_11F_11F_REV_EXT and <format> is not RGB.
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ciDependencies on OES_texture_half_float
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    If OES_texture_half_float is not supported, modify fifth paragraph
2715bd8deadSopenharmony_ci    of 3.7.1 Texture Image Specification, p. 67:
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ci    "The selected groups are processed as described in section 3.6.2, stopping
2745bd8deadSopenharmony_ci    after final expansion to RGBA. If the internal format of the texture is
2755bd8deadSopenharmony_ci    fixed-point, components are clamped to [0,1]. Otherwise, values are not
2765bd8deadSopenharmony_ci    modified."
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    Modify first sentence of "Unpacking", p. 62:
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    "Data are taken from client memory as a sequence of one of the GL data
2815bd8deadSopenharmony_ci    types listed in Table 3.2. These elements are..."
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    Additionally, ignore all references to RGBA16F_EXT, RGB16F_EXT,
2845bd8deadSopenharmony_ci    RG16F_EXT, R16F_EXT, HALF_FLOAT_OES and half.
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ciDependencies on EXT_color_buffer_half_float
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    If EXT_color_buffer_half_float is not supported, do not consider
2895bd8deadSopenharmony_ci    R11F_G11F_B10F_NV color-renderable. Remove all changes and additions
2905bd8deadSopenharmony_ci    to Chapter 4 of the OpenGL ES 2.0 Specification. 
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ciDependencies on NV_packed_float_linear
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    If NV_packed_float_linear is not supported, using LINEAR
2955bd8deadSopenharmony_ci    magnification filter and LINEAR, NEAREST_MIPMAP_LINEAR,
2965bd8deadSopenharmony_ci    LINEAR_MIPMAP_NEAREST and LINEAR_MIPMAP_NEAREST minification
2975bd8deadSopenharmony_ci    filters will cause packed float textures to be considered
2985bd8deadSopenharmony_ci    incomplete.
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ciDependencies on NV_framebuffer_multisample
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci    If NV_framebuffer_multisample is missing, remove all refernences to
3035bd8deadSopenharmony_ci    RenderBufferStorageMultisampleNV.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ciDependencies on NV_texture_array
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci    If NV_texture_array is not supported, remove all references to
3085bd8deadSopenharmony_ci    TexImage3DNV and TexSubImage3DNV.
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ciDependencies on EXT_texture_storage
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci    If EXT_texture_storage is not supported, remove all references to
3135bd8deadSopenharmony_ci    TexStorage2DEXT and TexStorage3DEXT.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ciIssues
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    1) Are the new formats allowed in window surface and pbuffer managed
3185bd8deadSopenharmony_ci      by EGL?
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci      No.  Let's focus on framebuffer objects.
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci      See EXT_packed_float for other relevant issues.
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ciRevision History
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci#3 - 05.11.2012 (Mathias Heyer)
3275bd8deadSopenharmony_ci   - Remove FRAMEBUFFER_ATTACHMENT_RGBA_SIGNED_COMPONENTS_NV, as its
3285bd8deadSopenharmony_ci     neither in desktop GL nor ES3
3295bd8deadSopenharmony_ci
3305bd8deadSopenharmony_ci#2 - 26.09.2012 (Mathias Heyer)
3315bd8deadSopenharmony_ci   - Make FRAMEBUFFER_ATTACHMENT_RGBA_SIGNED_COMPONENTS_NV a property of
3325bd8deadSopenharmony_ci     framebuffer attachments, adjust the table entries for ES2.0
3335bd8deadSopenharmony_ci   - add interactions with various other ES2.0 extensions
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci#1 - 03.10.2008
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci   First draft written based on EXT_packed_float.
338