15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    AMD_gpu_shader_half_float
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_AMD_gpu_shader_half_float
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Qun Lin, AMD (quentin.lin 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Qun Lin, AMD
165bd8deadSopenharmony_ci    Daniel Rakos, AMD
175bd8deadSopenharmony_ci    Donglin Wei, AMD
185bd8deadSopenharmony_ci    Graham Sellers, AMD
195bd8deadSopenharmony_ci    Rex Xu, AMD
205bd8deadSopenharmony_ci    Dominik Witczak, AMD
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Shipping.
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified Date:         09/21/2016
295bd8deadSopenharmony_ci    Author Revision:            5
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    OpenGL Extension #496
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciDependencies
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.5 (Core Profile)
385bd8deadSopenharmony_ci    Specification.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    This extension is written against version 4.50 of the OpenGL Shading
415bd8deadSopenharmony_ci    Language Specification.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    OpenGL 4.0 and GLSL 4.00 are required.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    This extension interacts with ARB_gpu_shader_int64.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    This extension interacts with AMD_shader_trinary_minmax.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension interacts with AMD_shader_explicit_vertex_parameter.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciOverview
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension was developed based on the NV_gpu_shader5 extension to
545bd8deadSopenharmony_ci    allow implementations supporting half float in shader and expose the
555bd8deadSopenharmony_ci    feature without the additional requirements that are present in
565bd8deadSopenharmony_ci    NV_gpu_shader5.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    The extension introduces the following features for all shader types:
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci      * support for half float scalar, vector and matrix data types in shader;
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci      * new built-in functions to pack and unpack half float types into a
635bd8deadSopenharmony_ci        32-bit integer vector;
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci      * half float support for all existing single float built-in functions,
665bd8deadSopenharmony_ci        including angle functions, exponential functions, common functions,
675bd8deadSopenharmony_ci        geometric functions, matrix functions and etc.;
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    This extension is designed to be a functional superset of the half-precision
705bd8deadSopenharmony_ci    floating-point support from NV_gpu_shader5 and to keep source code compatible
715bd8deadSopenharmony_ci    with that, thus the new procedures, functions, and tokens are identical to
725bd8deadSopenharmony_ci    those found in that extension.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ciNew Procedures and Functions
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    None.
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ciNew Tokens
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    Returned by the <type> parameter of GetActiveAttrib, GetActiveUniform, and
825bd8deadSopenharmony_ci    GetTransformFeedbackVarying:
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    (The tokens are identical to those defined in NV_gpu_shader5.)
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci        FLOAT16_NV                                      0x8FF8
875bd8deadSopenharmony_ci        FLOAT16_VEC2_NV                                 0x8FF9
885bd8deadSopenharmony_ci        FLOAT16_VEC3_NV                                 0x8FFA
895bd8deadSopenharmony_ci        FLOAT16_VEC4_NV                                 0x8FFB
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    (New tokens)
925bd8deadSopenharmony_ci        FLOAT16_MAT2_AMD                                0x91C5
935bd8deadSopenharmony_ci        FLOAT16_MAT3_AMD                                0x91C6
945bd8deadSopenharmony_ci        FLOAT16_MAT4_AMD                                0x91C7
955bd8deadSopenharmony_ci        FLOAT16_MAT2x3_AMD                              0x91C8
965bd8deadSopenharmony_ci        FLOAT16_MAT2x4_AMD                              0x91C9
975bd8deadSopenharmony_ci        FLOAT16_MAT3x2_AMD                              0x91CA
985bd8deadSopenharmony_ci        FLOAT16_MAT3x4_AMD                              0x91CB
995bd8deadSopenharmony_ci        FLOAT16_MAT4x2_AMD                              0x91CC
1005bd8deadSopenharmony_ci        FLOAT16_MAT4x3_AMD                              0x91CD
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL 4.5 (Core Profile) Specification
1045bd8deadSopenharmony_ci(Program Objects)
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    Modify Section 7.3.1, Program Interfaces
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    (add to Table 7.3, OpenGL Shading Language type tokens, p. 108)
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    +----------------------------+----------------+------+------+------+
1115bd8deadSopenharmony_ci    | Type Name Token            | Keyword        |Attrib| Xfb  |Buffer|
1125bd8deadSopenharmony_ci    +----------------------------+----------------+------+------+------+
1135bd8deadSopenharmony_ci    | FLOAT16_NV                 | float16_t      |  *   |  *   |  *   |
1145bd8deadSopenharmony_ci    | FLOAT16_VEC2_NV            | f16vec2        |  *   |  *   |  *   |
1155bd8deadSopenharmony_ci    | FLOAT16_VEC3_NV            | f16vec3        |  *   |  *   |  *   |
1165bd8deadSopenharmony_ci    | FLOAT16_VEC4_NV            | f16vec4        |  *   |  *   |  *   |
1175bd8deadSopenharmony_ci    | FLOAT16_MAT2_AMD           | f16mat2        |  *   |  *   |  *   |
1185bd8deadSopenharmony_ci    | FLOAT16_MAT3_AMD           | f16mat3        |  *   |  *   |  *   |
1195bd8deadSopenharmony_ci    | FLOAT16_MAT4_AMD           | f16mat4        |  *   |  *   |  *   |
1205bd8deadSopenharmony_ci    | FLOAT16_MAT2x3_AMD         | f16mat2x3      |  *   |  *   |  *   |
1215bd8deadSopenharmony_ci    | FLOAT16_MAT2x4_AMD         | f16mat2x4      |  *   |  *   |  *   |
1225bd8deadSopenharmony_ci    | FLOAT16_MAT3x2_AMD         | f16mat3x2      |  *   |  *   |  *   |
1235bd8deadSopenharmony_ci    | FLOAT16_MAT3x4_AMD         | f16mat3x4      |  *   |  *   |  *   |
1245bd8deadSopenharmony_ci    | FLOAT16_MAT4x2_AMD         | f16mat4x2      |  *   |  *   |  *   |
1255bd8deadSopenharmony_ci    | FLOAT16_MAT4x3_AMD         | f16mat4x3      |  *   |  *   |  *   |
1265bd8deadSopenharmony_ci    +----------------------------+----------------+------+------+------+
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Modify Section 7.6.1, Loading Uniform Variables
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    (modify the last paragraph on p. 132)
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci        The Uniform*f{v} commands will load count sets of one to four floating-
1345bd8deadSopenharmony_ci    point values into a uniform defined as a float, a half float, a floating-
1355bd8deadSopenharmony_ci    point vector, a half-precision floating-point vector or an array of either
1365bd8deadSopenharmony_ci    of these types. Floating-point values are converted to half float by the GL
1375bd8deadSopenharmony_ci    for uniforms defined as a half float, a half float vector or an array of
1385bd8deadSopenharmony_ci    those.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    Modify Section 7.6.2.1, Uniform Buffer Object Storage
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    (modify the first two bullets of the first paragraph on p. 136)
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    * Members of type bool, int, uint, float, float16_t and double are respectively
1465bd8deadSopenharmony_ci      extracted from a buffer object by reading a single uint, int, uint, float,
1475bd8deadSopenharmony_ci      half float or double value at the specified offset.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    * Vectors with N elements with basic data types of bool, int, uint, float,
1505bd8deadSopenharmony_ci      float16_t or double are extracted as N values in consecutive memory locations
1515bd8deadSopenharmony_ci      beginning at the specified offset, with components stored in order with the
1525bd8deadSopenharmony_ci      first (X) component at the lowest offset. The GL data type used for component
1535bd8deadSopenharmony_ci      extraction is derived according to the rules for scalar members above.
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ciAdditions to Chapter 11 of the OpenGL 4.5 (Core Profile) Specification
1575bd8deadSopenharmony_ci(Programmable Vertex Processing)
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    Modify Section 11.1.1, Vertex Attributes
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    (modify Table 11.2, Generic attributes and vector types used by column vectors of
1625bd8deadSopenharmony_ci    matrix variables bound to generic attribute index i. p. 366)
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    +------------------------------+-------------------------+-----------------------+
1655bd8deadSopenharmony_ci    |          Data type           |Column vector type layout|     Generic           |
1665bd8deadSopenharmony_ci    |                              |qualifier attributes used|                       |
1675bd8deadSopenharmony_ci    +------------------------------+-------------------------+-----------------------+
1685bd8deadSopenharmony_ci    | mat2, dmat2, f16mat2         | two-component vector    | i, i + 1              |
1695bd8deadSopenharmony_ci    | mat2x3, dmat2x3, f16mat2x3   | three-component vector  | i, i + 1              |
1705bd8deadSopenharmony_ci    | mat2x4, dmat2x4, f16mat2x4   | four-component vector   | i, i + 1              |
1715bd8deadSopenharmony_ci    | mat3x2, dmat3x2, f16mat3x2   | two-component vector    | i, i + 1, i + 2       |
1725bd8deadSopenharmony_ci    | mat3, dmat3, f16mat3         | three-component vector  | i, i + 1, i + 2       |
1735bd8deadSopenharmony_ci    | mat3x4, dmat3x4, f16mat3x4   | four-component vector   | i, i + 1, i + 2       |
1745bd8deadSopenharmony_ci    | mat4x2, dmat4x2, f16mat4x2   | two-component vector    | i, i + 1, i + 2, i + 3|
1755bd8deadSopenharmony_ci    | mat4x3, dmat4x3, f16mat4x3   | three-component vector  | i, i + 1, i + 2, i + 3|
1765bd8deadSopenharmony_ci    | mat4, dmat4, f16mat4         | four-component vector   | i, i + 1, i + 2, i + 3|
1775bd8deadSopenharmony_ci    +------------------------------+-------------------------+-----------------------+
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    (modify Table 11.3: Scalar and vector vertex attribute types and VertexAttrib*
1805bd8deadSopenharmony_ci    commands used to set the values of the corresponding generic attributes. p. 366)
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    +-------------------+--------------------------+
1835bd8deadSopenharmony_ci    |   Data type       |         Command          |
1845bd8deadSopenharmony_ci    +-------------------+--------------------------+
1855bd8deadSopenharmony_ci    | float, float16_t  | VertexAttrib1*           |
1865bd8deadSopenharmony_ci    | vec2, f16vec2     | VertexAttrib2*           |
1875bd8deadSopenharmony_ci    | vec3, f16vec3     | VertexAttrib3*           |
1885bd8deadSopenharmony_ci    | vec4, f16vec4     | VertexAttrib4*           |
1895bd8deadSopenharmony_ci    +-------------------+--------------------------+
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    Modify Section 11.1.2.1, Output Variables
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci    (modify the last paragraph on p. 374)
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    ..., each component of outputs declared as half-precision floating-point
1975bd8deadSopenharmony_ci    scalars, vectors, or matrices is considered to consume two basic machine
1985bd8deadSopenharmony_ci    units, and each component of any other type ...
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.50
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
2045bd8deadSopenharmony_ci    language features described in this extension:
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci      #extension GL_AMD_gpu_shader_half_float : <behavior>
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci      #define GL_AMD_gpu_shader_half_float       1
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL Shading Language Specification (Basics)
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    Modify Section 3.6, Keywords
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    (add the following to the list of reserved keywords at p. 18)
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    float16_t f16vec2 f16vec3 f16vec4
2235bd8deadSopenharmony_ci    f16mat2  f16mat3  f16mat4
2245bd8deadSopenharmony_ci    f16mat2x2 fl6mat2x3 f16mat2x4
2255bd8deadSopenharmony_ci    f16mat3x2 f16mat3x3 f16mat3x4
2265bd8deadSopenharmony_ci    f16mat4x2 f16mat4x3 f16mat4x4
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL Shading Language Specification
2305bd8deadSopenharmony_ci(Variables and Types)
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    Modify Section 4.1, Basic Types
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    (add to the basic "Transparent Types" table, p. 23)
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci    +-----------+------------------------------------------------------------+
2385bd8deadSopenharmony_ci    | Type      | Meaning                                                    |
2395bd8deadSopenharmony_ci    +-----------+------------------------------------------------------------+
2405bd8deadSopenharmony_ci    | float16_t | a half-precision floating-point scalar                     |
2415bd8deadSopenharmony_ci    | f16vec2   | a two-component half-precision floating-point vector       |
2425bd8deadSopenharmony_ci    | f16vec3   | a three-component half-precision floating-point vector     |
2435bd8deadSopenharmony_ci    | f16vec4   | a four-component half-precision floating-point vector      |
2445bd8deadSopenharmony_ci    | f16mat2   | a 2x2 half-precision floating-point matrix                 |
2455bd8deadSopenharmony_ci    | f16mat3   | a 3x3 half-precision floating-point matrix                 |
2465bd8deadSopenharmony_ci    | f16mat4   | a 4x4 half-precision floating-point matrix                 |
2475bd8deadSopenharmony_ci    | f16mat2x2 | same as a f16mat2                                          |
2485bd8deadSopenharmony_ci    | f16mat2x3 | a half-precision floating-point matrix with 2 columns and  |
2495bd8deadSopenharmony_ci    |           | 3 rows                                                     |
2505bd8deadSopenharmony_ci    | f16mat2x4 | a half-precision floating-point matrix with 2 columns and  |
2515bd8deadSopenharmony_ci    |           | 4 rows                                                     |
2525bd8deadSopenharmony_ci    | f16mat3x2 | a half-precision floating-point matrix with 3 columns and  |
2535bd8deadSopenharmony_ci    |           | 2 rows                                                     |
2545bd8deadSopenharmony_ci    | f16mat3x3 | same as a f16mat3                                          |
2555bd8deadSopenharmony_ci    | f16mat3x4 | a half-precision floating-point matrix with 3 columns and  |
2565bd8deadSopenharmony_ci    |           | 4 rows                                                     |
2575bd8deadSopenharmony_ci    | f16mat4x2 | a half-precision floating-point matrix with 4 columns and  |
2585bd8deadSopenharmony_ci    |           | 2 rows                                                     |
2595bd8deadSopenharmony_ci    | f16mat4x3 | a half-precision floating-point matrix with 4 columns and  |
2605bd8deadSopenharmony_ci    |           | 3 rows                                                     |
2615bd8deadSopenharmony_ci    | f16mat4x4 | same as a f16mat4                                          |
2625bd8deadSopenharmony_ci    +-----------+------------------------------------------------------------+
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    Modify Section 4.1.4, Floating-Point Variables
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci    (replace first paragraph of the section, p. 29)
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci    Single-precision, double-precision and half-precision floating point variables
2705bd8deadSopenharmony_ci    are available for use in a variety of scalar calculations. Generally, the term
2715bd8deadSopenharmony_ci    floating-point will refer to all single-, double- and half-precision floating
2725bd8deadSopenharmony_ci    point. Floating-point variables are defined as in the following examples:
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci        float a, b = 1.5;       // single-precision floating-point
2755bd8deadSopenharmony_ci        double c, d = 2.0LF;    // double-precision floating-point
2765bd8deadSopenharmony_ci        float16_t e, f = 3.0HF; // half-precision floating-point
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    As an input value to one of the processing units, a single-precision, double-
2795bd8deadSopenharmony_ci    precision or half-precison floating-point variable is expected to match the
2805bd8deadSopenharmony_ci    corresponding IEEE 754 floating-point definition in terms of precision and
2815bd8deadSopenharmony_ci    dynamic range.
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    (modify grammar rule for "floating-suffix", p. 30)
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci      floating-suffix: one of
2865bd8deadSopenharmony_ci        f F lf LF hf HF
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    (modify the fourth sentence of second paragraph on p. 30)
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    When the suffix "lf" or "LF" is present, the literal has type double. When the
2915bd8deadSopenharmony_ci    suffix "hf" or "HF" is present, the literal has type float16_t. Otherwise, the
2925bd8deadSopenharmony_ci    literal has type float.
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    Modify Section 4.1.6, Matrices
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci    (modify the second sentence in the section, p. 30)
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci    Matrix types beginning with "mat" have single-precision components, matrix
3005bd8deadSopenharmony_ci    types beginning with "dmat" have double-precision components and matrix types
3015bd8deadSopenharmony_ci    beginning with "f16mat" have half-precision components.
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    Modify Section 4.1.10, Implicit Conversions
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    (modify the implicit conversion table on p. 37)
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci    +-----------------------+-------------------------------------------------+
3095bd8deadSopenharmony_ci    | Type of expression    | Can be implicitly converted to                  |
3105bd8deadSopenharmony_ci    +-----------------------+-------------------------------------------------+
3115bd8deadSopenharmony_ci    | int, uint, float16_t  | float                                           |
3125bd8deadSopenharmony_ci    | ivec2, uvec2, f16vec2 | vec2                                            |
3135bd8deadSopenharmony_ci    | ivec3, uvec3, f16vec3 | vec3                                            |
3145bd8deadSopenharmony_ci    | ivec4, uvec4, f16vec4 | vec4                                            |
3155bd8deadSopenharmony_ci    | f16mat2               | mat2                                            |
3165bd8deadSopenharmony_ci    | f16mat3               | mat3                                            |
3175bd8deadSopenharmony_ci    | f16mat4               | mat4                                            |
3185bd8deadSopenharmony_ci    | f16mat2x3             | mat2x3                                          |
3195bd8deadSopenharmony_ci    | f16mat2x4             | mat2x4                                          |
3205bd8deadSopenharmony_ci    | f16mat3x2             | mat3x2                                          |
3215bd8deadSopenharmony_ci    | f16mat3x4             | mat3x4                                          |
3225bd8deadSopenharmony_ci    | f16mat4x2             | mat4x2                                          |
3235bd8deadSopenharmony_ci    | f16mat4x3             | mat4x3                                          |
3245bd8deadSopenharmony_ci    | int, uint,            | double                                          |
3255bd8deadSopenharmony_ci    | float, float16_t      |                                                 |
3265bd8deadSopenharmony_ci    | ivec2, uvec2,         | dvec2                                           |
3275bd8deadSopenharmony_ci    | vec2, f16vec2         |                                                 |
3285bd8deadSopenharmony_ci    | ivec3, uvec3,         | dvec3                                           |
3295bd8deadSopenharmony_ci    | vec3, f16vec3         |                                                 |
3305bd8deadSopenharmony_ci    | ivec4, uvec4,         | dvec4                                           |
3315bd8deadSopenharmony_ci    | vec4, f16vec4         |                                                 |
3325bd8deadSopenharmony_ci    | mat2, f16mat2,        | dmat2                                           |
3335bd8deadSopenharmony_ci    | mat3, f16mat3         | dmat3                                           |
3345bd8deadSopenharmony_ci    | mat4, f16mat4         | dmat4                                           |
3355bd8deadSopenharmony_ci    | mat2x3, f16mat2x3     | dmat2x3                                         |
3365bd8deadSopenharmony_ci    | mat2x4, f16mat2x4     | dmat2x4                                         |
3375bd8deadSopenharmony_ci    | mat3x2, f16mat3x2     | dmat3x2                                         |
3385bd8deadSopenharmony_ci    | mat3x4, f16mat3x4     | dmat3x4                                         |
3395bd8deadSopenharmony_ci    | mat4x2, f16mat4x2     | dmat4x2                                         |
3405bd8deadSopenharmony_ci    | mat4x3, f16mat4x3     | dmat4x3                                         |
3415bd8deadSopenharmony_ci    +-----------------------+-------------------------------------------------+
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    Modify Section 4.4.2.1 Transform Feedback Layout Qualifiers
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci    (insert after the fourth paragraph in the section on p. 70)
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci    ... will be a multiple of 8; if applied to an aggregrate containing a
3495bd8deadSopenharmony_ci    float16_t, the offset must also be a multiple of 2, and the space taken in
3505bd8deadSopenharmony_ci    the buffer will be a multiple of 2.
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci    Modify Section 4.7.1 Range and Precision
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    (insert after the first paragraph in the section on p. 85)
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    ... and positive and negative zeros. The precision of stored half-
3585bd8deadSopenharmony_ci    precision floating-point variables is described in section 2.3.3.2 "16-Bit
3595bd8deadSopenharmony_ci    Floating-Point Numbers" of OpenGL Specification.
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    The following rules apply to all floating operations, including single-,
3625bd8deadSopenharmony_ci    double- and half-precision operations:...
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL Shading Language Specification
3665bd8deadSopenharmony_ci(Operators and Expressions)
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci    Modify Section 5.4.1, Conversion and Scalar Constructors
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    (add after the first list of constructor examples on p. 97)
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ci      int(float16_t)    // convert a float16_t value to a signed integer
3745bd8deadSopenharmony_ci      uint(float16_t)   // convert a float16_t value to an unsigned integer
3755bd8deadSopenharmony_ci      bool(float16_t)   // convert a float16_t value to a Boolean
3765bd8deadSopenharmony_ci      float(float16_t)  // convert a float16_t value to a float value
3775bd8deadSopenharmony_ci      double(float16_t) // convert a float16_t value to a double value
3785bd8deadSopenharmony_ci      float16_t(bool)   // convert a Boolean to a float16_t value
3795bd8deadSopenharmony_ci      float16_t(int)    // convert a signed integer to a float16_t value
3805bd8deadSopenharmony_ci      float16_t(uint)   // convert an unsigned integer to a float16_t value
3815bd8deadSopenharmony_ci      float16_t(float)  // convert a float value to a float16_t value
3825bd8deadSopenharmony_ci      float16_t(double) // convert a double value to a float16_t value
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    (modify the first sentence of last paragraph on p. 98)
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    ... other arguments.
3875bd8deadSopenharmony_ci    If the basic type (bool, int, float, double, or float16_t) of a parameter to
3885bd8deadSopenharmony_ci    a constructor does not match the basic type of the object being constructed,
3895bd8deadSopenharmony_ci    the scalar construction rules (above) are used to convert the parameters.
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL Shading Language Specification
3935bd8deadSopenharmony_ci(Statements and Structure)
3945bd8deadSopenharmony_ci
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    Modify Section 6.1, Function Defintions
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci    (replace the second rule in third paragraph on p. 113)
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci      2. A match involving a conversion from a signed integer, unsigned
4015bd8deadSopenharmony_ci         integer, or floating-point type to a similar type having a larger
4025bd8deadSopenharmony_ci         number of bits is better than a match involving any other implicit
4035bd8deadSopenharmony_ci         conversion.
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL Shading Language Specification
4065bd8deadSopenharmony_ci(Built-in Functions)
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    (insert after the sixth sentence of last paragraph on p. 140)
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ci    ... genDType is used as the argument. Where the input arguments (and
4115bd8deadSopenharmony_ci    corresponding output) can be float16_t, f16vec2, f16vec3, f16vec4,
4125bd8deadSopenharmony_ci    genF16Type is used as the argument.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    Modify Section 8.1, Angle and Trigonometry Functions
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    (add to the table of Angle and Trigonometry Functions on p. 141)
4185bd8deadSopenharmony_ci
4195bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4205bd8deadSopenharmony_ci    | Syntax                                         | Desciption                                         |
4215bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4225bd8deadSopenharmony_ci    | genF16Type radians (genF16Type degrees)        | Converts degrees to radians, i.e., 180/PI *        |
4235bd8deadSopenharmony_ci    |                                                | degrees.                                           |
4245bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4255bd8deadSopenharmony_ci    | genF16Type degrees (genF16Type radians)        | Converts radians to degrees, i.e., 180/PI *        |
4265bd8deadSopenharmony_ci    |                                                | radians.                                           |
4275bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4285bd8deadSopenharmony_ci    | genF16Type sin (genF16Type angle)              | The standard trigonometric sine function.          |
4295bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4305bd8deadSopenharmony_ci    | genF16Type cos (genF16Type angle)              | The standard trigonometric cosine function         |
4315bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4325bd8deadSopenharmony_ci    | genF16Type tan (genF16Type angle)              | The standard trigonometric tangent.                |
4335bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4345bd8deadSopenharmony_ci    | genF16Type asin (genF16Type x)                 | Arc sine. Returns an angle whose sine is x. The    |
4355bd8deadSopenharmony_ci    |                                                | range of values returned by this function is [-PI/2|
4365bd8deadSopenharmony_ci    |                                                | , PI/2] Results are undefined if |x| > 1.          |
4375bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4385bd8deadSopenharmony_ci    | genF16Type acos (genF16Type x)                 | Arc cosine. Returns an angle whose cosine is x. The|
4395bd8deadSopenharmony_ci    |                                                | range of values returned by this function is [0, p]|
4405bd8deadSopenharmony_ci    |                                                | Results are undefined if |x| > 1.                  |
4415bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4425bd8deadSopenharmony_ci    | genF16Type atan (genF16Type y, genF16Type x)   | Arc tangent. Returns an angle whose tangent is y/x.|
4435bd8deadSopenharmony_ci    |                                                | The signs of x and y are used to determine what    |
4445bd8deadSopenharmony_ci    |                                                | quadrant the angle is in. The range of values      |
4455bd8deadSopenharmony_ci    |                                                | returned by this function is [-PI,PI]. Results are |
4465bd8deadSopenharmony_ci    |                                                | undefined if x and y are both 0.                   |
4475bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4485bd8deadSopenharmony_ci    | genF16Type atan (genF16Type y_over_x)          | Arc tangent. Returns an angle whose tangent is     |
4495bd8deadSopenharmony_ci    |                                                | y_over_x. The range of values returned by this     |
4505bd8deadSopenharmony_ci    |                                                | function is [-PI/2, PI/2].                         |
4515bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4525bd8deadSopenharmony_ci    | genF16Type sinh (genF16Type x)                 | Returns the hyperbolic sine function               |
4535bd8deadSopenharmony_ci    |                                                | (e^x - e^-x) / 2.                                  |
4545bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4555bd8deadSopenharmony_ci    | genF16Type cosh (genF16Type x)                 | Returns the hyperbolic cosine function             |
4565bd8deadSopenharmony_ci    |                                                | (e^x + e^-x) / 2.                                  |
4575bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4585bd8deadSopenharmony_ci    | genF16Type tanh (genF16Type x)                 | Returns the hyperbolic tangent function            |
4595bd8deadSopenharmony_ci    |                                                | sinh(x) / cosh(x).                                 |
4605bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4615bd8deadSopenharmony_ci    | genF16Type asinh (genF16Type x)                | Arc hyperbolic sine; returns the inverse of sinh.  |
4625bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4635bd8deadSopenharmony_ci    | genF16Type acosh (genF16Type x)                | Arc hyperbolic cosine; returns the non-negative    |
4645bd8deadSopenharmony_ci    |                                                | inverse of cosh. Results are undefined if x < 1.   |
4655bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4665bd8deadSopenharmony_ci    | genF16Type atanh (genF16Type x)                | Arc hyperbolic tangent; returns the inverse of     |
4675bd8deadSopenharmony_ci    |                                                | tanh. Results are undefined if |x| >= 1.           |
4685bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci    Modify Section 8.2, Exponential Functions
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci    (add to the table of Exponential Functions on p. 143)
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4765bd8deadSopenharmony_ci    | Syntax                                         | Desciption                                         |
4775bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4785bd8deadSopenharmony_ci    | genF16Type pow (genF16Type x, genF16Type y)    | Returns x raised to the y power, i.e., x^y         |
4795bd8deadSopenharmony_ci    |                                                | Results are undefined if x < 0.                    |
4805bd8deadSopenharmony_ci    |                                                | Results are undefined if x = 0 and y <= 0.         |
4815bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4825bd8deadSopenharmony_ci    | genF16Type exp (genF16Type x)                  | Returns the natural exponentiation of x, i.e., e^x.|
4835bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4845bd8deadSopenharmony_ci    | genF16Type log (genF16Type x)                  | Returns the natural logarithm of x, i.e., returns  |
4855bd8deadSopenharmony_ci    |                                                | the value y which satisfies the equation x = e^y.  |
4865bd8deadSopenharmony_ci    |                                                | Results are undefined if x <= 0.                   |
4875bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4885bd8deadSopenharmony_ci    | genF16Type exp2 (genF16Type x)                 | Returns 2 raised to the x power, i.e., 2^x.        |
4895bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4905bd8deadSopenharmony_ci    | genF16Type log2 (genF16Type x)                 | Returns the base 2 logarithm of x, i.e., returns   |
4915bd8deadSopenharmony_ci    |                                                | the value y which satisfies the equation x = 2^y   |
4925bd8deadSopenharmony_ci    |                                                | Results are undefined if x <= 0.                   |
4935bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4945bd8deadSopenharmony_ci    | genF16Type sqrt (genF16Type x)                 | Returns sqrt(x) .Results are undefined if x < 0.   |
4955bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4965bd8deadSopenharmony_ci    | genF16Type inversesqrt (genF16Type x)          | Returns 1 / sqrt(x). Results are undefined if      |
4975bd8deadSopenharmony_ci    |                                                | x <= 0.                                            |
4985bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ci    Modify Section 8.3, Common Functions
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    (add to the table of common functions on p. 144)
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5065bd8deadSopenharmony_ci    | Syntax                                         | Desciption                                         |
5075bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5085bd8deadSopenharmony_ci    | genF16Type abs(genF16Type x)                   | Returns x if x >= 0; otherwise it returns -x.      |
5095bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5105bd8deadSopenharmony_ci    | genF16Type sign(genF16Type x)                  | Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < |
5115bd8deadSopenharmony_ci    |                                                | 0.                                                 |
5125bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5135bd8deadSopenharmony_ci    | genF16Type floor (genF16Type x)                | Returns a value equal to the nearest integer that  |
5145bd8deadSopenharmony_ci    |                                                | is less than or equal to x.                        |
5155bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5165bd8deadSopenharmony_ci    | genF16Type trunc (genF16Type x)                | Returns a value equal to the nearest integer to x  |
5175bd8deadSopenharmony_ci    |                                                | whose absolute value is not larger than the        |
5185bd8deadSopenharmony_ci    |                                                | absolute value of x.                               |
5195bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5205bd8deadSopenharmony_ci    | genF16Type round (genF16Type x)                | Returns a value equal to the nearest integer to x. |
5215bd8deadSopenharmony_ci    |                                                | The fraction 0.5 will round in a direction chosen  |
5225bd8deadSopenharmony_ci    |                                                | by the implementation, presumably the direction    |
5235bd8deadSopenharmony_ci    |                                                | that is fastest. This includes the possibility     |
5245bd8deadSopenharmony_ci    |                                                | that round(x) returns the same value as            |
5255bd8deadSopenharmony_ci    |                                                | roundEven(x) for all values of x.                  |
5265bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5275bd8deadSopenharmony_ci    | genF16Type roundEven (genF16Type x)            | Returns a value equal to the nearest integer to x. |
5285bd8deadSopenharmony_ci    |                                                | A fractional part of 0.5 will round toward the     |
5295bd8deadSopenharmony_ci    |                                                | nearest even integer. (Both 3.5 and 4.5 for x will |
5305bd8deadSopenharmony_ci    |                                                | return 4.0.)                                       |
5315bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5325bd8deadSopenharmony_ci    | genF16Type ceil (genF16Type x)                 | Returns a value equal to the nearest integer that  |
5335bd8deadSopenharmony_ci    |                                                | is greater than or equal to x.                     |
5345bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5355bd8deadSopenharmony_ci    | genF16Type fract (genF16Type x)                | Returns x - floor(x).                              |
5365bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5375bd8deadSopenharmony_ci    | genF16Type mod (genF16Type x, float16_t y)     | Modulus. Returns x - y * floor(x/y).               |
5385bd8deadSopenharmony_ci    | genF16Type mod (genF16Type x, genF16Type y)    |                                                    |
5395bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5405bd8deadSopenharmony_ci    | genF16Type modf(genF16Type x, out genF16Type i)| Returns the fractional part of x and sets i to the |
5415bd8deadSopenharmony_ci    |                                                | integer part (as a whole number floating-point     |
5425bd8deadSopenharmony_ci    |                                                | value). Both the return value and the output       |
5435bd8deadSopenharmony_ci    |                                                | parameter will have the same sign as x.            |
5445bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5455bd8deadSopenharmony_ci    | genF16Type min(genF16Type x,                   | Returns y if y < x; otherwise it returns x.        |
5465bd8deadSopenharmony_ci    |                genF16Type y)                   |                                                    |
5475bd8deadSopenharmony_ci    | genF16Type min(genF16Type x,                   |                                                    |
5485bd8deadSopenharmony_ci    |                float16_t y)                    |                                                    |
5495bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5505bd8deadSopenharmony_ci    | genF16Type max(genF16Type x,                   | Returns y if x < y; otherwise it returns x.        |
5515bd8deadSopenharmony_ci    |                genF16Type y)                   |                                                    |
5525bd8deadSopenharmony_ci    | genF16Type max(genF16Type x,                   |                                                    |
5535bd8deadSopenharmony_ci    |                float16_t y)                    |                                                    |
5545bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5555bd8deadSopenharmony_ci    | genF16Type clamp(genF16Type x,                 | Returns min(max(x, minVal), maxVal).               |
5565bd8deadSopenharmony_ci    |                  genF16Type minVal,            |                                                    |
5575bd8deadSopenharmony_ci    |                  genF16Type maxVal)            | Results are undefined if minVal > maxVal.          |
5585bd8deadSopenharmony_ci    | genF16Type clamp(genF16Type x,                 |                                                    |
5595bd8deadSopenharmony_ci    |                  float16_t minVal,             |                                                    |
5605bd8deadSopenharmony_ci    |                  float16_t maxVal)             |                                                    |
5615bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5625bd8deadSopenharmony_ci    | genF16Type mix(genF16Type x,                   | Selects which vector each returned component comes |
5635bd8deadSopenharmony_ci    |                genF16Type y,                   | from. For a component of a that is false, the      |
5645bd8deadSopenharmony_ci    |                genF16Type a)                   | corresponding component of x is returned. For a    |
5655bd8deadSopenharmony_ci    | genF16Type mix(genF16Type x,                   | component of a that is true, the corresponding     |
5665bd8deadSopenharmony_ci    |                genF16Type y,                   | component of y is returned.                        |
5675bd8deadSopenharmony_ci    |                float16_t a)                    |                                                    |
5685bd8deadSopenharmony_ci    | genF16Type mix(genF16Type x,                   |                                                    |
5695bd8deadSopenharmony_ci    |                genF16Type y,                   |                                                    |
5705bd8deadSopenharmony_ci    |                genBType a)                     |                                                    |
5715bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5725bd8deadSopenharmony_ci    | genF16Type step (genF16Type edge, genF16Type x)| Returns 0.0 if x < edge; otherwise it returns 1.0. |
5735bd8deadSopenharmony_ci    | genF16Type step (float16_t edge, genF16Type x) |                                                    |
5745bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5755bd8deadSopenharmony_ci    | genF16Type smoothstep (genF16Type edge0,       | Returns 0.0 if x <= edge0 and 1.0 if x >= edge1    |
5765bd8deadSopenharmony_ci    |                        genF16Type edge1,       | and performs smooth Hermite interpolation between 0|
5775bd8deadSopenharmony_ci    |                        genF16Type x)           | and 1 when edge0 < x < edge1. This is useful in    |
5785bd8deadSopenharmony_ci    | genF16Type smoothstep (float16_t edge0,        | cases where you would want a threshold function    |
5795bd8deadSopenharmony_ci    |                        float16_t edge1         | with a smooth,transition. This is equivalent to:   |
5805bd8deadSopenharmony_ci    |                        genF16Type x)           |    genF16Type t;                                   |
5815bd8deadSopenharmony_ci    |                                                |    t = clamp((x - edge0) / (edge1 - edge0), 0, 1); |
5825bd8deadSopenharmony_ci    |                                                |    return t * t * (3 - 2 * t);                     |
5835bd8deadSopenharmony_ci    |                                                |    Results are undefined if edge0 >= edge1.        |
5845bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5855bd8deadSopenharmony_ci    | genBType isnan (genF16Type x)                  | Returns true if x holds a NaN. Returns false       |
5865bd8deadSopenharmony_ci    |                                                | otherwise. Always returns false if NaNs are not    |
5875bd8deadSopenharmony_ci    |                                                | implemented.                                       |
5885bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5895bd8deadSopenharmony_ci    | genBType isinf (genF16Type x)                  | Returns true if x holds a positive infinity or     |
5905bd8deadSopenharmony_ci    |                                                | negative infinity. Returns false otherwise.        |
5915bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5925bd8deadSopenharmony_ci    | genF16Type fma (genF16Type a, genF16Type b,    | Computes and returns a * b + c.                    |
5935bd8deadSopenharmony_ci    |                 genF16Type c)                  |                                                    |
5945bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
5955bd8deadSopenharmony_ci    | genF16Type frexp (genF16Type x,                | Splits x into a floating-point significand in the  |
5965bd8deadSopenharmony_ci    |                   out genIType exp)            | range [0.5, 1.0) and an integral exponent of two,  |
5975bd8deadSopenharmony_ci    |                                                | such that:                                         |
5985bd8deadSopenharmony_ci    |                                                |    x = significand * 2^exp                         |
5995bd8deadSopenharmony_ci    |                                                | The significand is returned by the function and the|
6005bd8deadSopenharmony_ci    |                                                | exponent is returned in the parameter exp. For a   |
6015bd8deadSopenharmony_ci    |                                                | floating-point value of zero, the significand and  |
6025bd8deadSopenharmony_ci    |                                                | exponent are both zero. For a floating-point value |
6035bd8deadSopenharmony_ci    |                                                | that is an infinity or is not a number, the results|
6045bd8deadSopenharmony_ci    |                                                | are undefined.                                     |
6055bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
6065bd8deadSopenharmony_ci    | genF16Type ldexp (genF16Type x,                | Builds a floating-point number from x and the      |
6075bd8deadSopenharmony_ci    |                   in genIType exp)             | corresponding integral exponent of two in exp,     |
6085bd8deadSopenharmony_ci    |                                                | returning:                                         |
6095bd8deadSopenharmony_ci    |                                                |    x* 2^exp                                        |
6105bd8deadSopenharmony_ci    |                                                | If this product is too large to be represented in  |
6115bd8deadSopenharmony_ci    |                                                | the floating-point type, the result is undefined.  |
6125bd8deadSopenharmony_ci    +------------------------------------------------+----------------------------------------------------+
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci
6155bd8deadSopenharmony_ci    Modify Section 8.4, Floating-Point Pack and Unpack Functions
6165bd8deadSopenharmony_ci
6175bd8deadSopenharmony_ci    (add to the table of pack and unpack functions on p. 149)
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci    +-----------------------------------+------------------------------------------------------+
6205bd8deadSopenharmony_ci    | Syntax                            | Desciption                                           |
6215bd8deadSopenharmony_ci    +-----------------------------------+------------------------------------------------------+
6225bd8deadSopenharmony_ci    | uint packFloat2x16(f16vec2 v)     | Returns an unsigned 32-bit integer obtained by       |
6235bd8deadSopenharmony_ci    |                                   | packing the components of a two-component half-      |
6245bd8deadSopenharmony_ci    |                                   | precision floating-point vector, respectively. The   |
6255bd8deadSopenharmony_ci    |                                   | first vector component specifies the 16 least        |
6265bd8deadSopenharmony_ci    |                                   | significant bits; the second component specifies the |
6275bd8deadSopenharmony_ci    |                                   | 16 most significant bits.                            |
6285bd8deadSopenharmony_ci    +-----------------------------------+------------------------------------------------------+
6295bd8deadSopenharmony_ci    | f16vec2 unpackFloat2x16(uint v)   | Returns a two-component half-precision floating-point|
6305bd8deadSopenharmony_ci    |                                   | vector built from a 32-bit unsigned integer scalar,  |
6315bd8deadSopenharmony_ci    |                                   | respectively. The first component of the vector      |
6325bd8deadSopenharmony_ci    |                                   | contains the 16 least significant bits of the input; |
6335bd8deadSopenharmony_ci    |                                   | the second component contains the 16 most            |
6345bd8deadSopenharmony_ci    |                                   | significant bits.                                    |
6355bd8deadSopenharmony_ci    +-----------------------------------+------------------------------------------------------+
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci
6385bd8deadSopenharmony_ci    Modify Section 8.5 Geometric Functions
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci    (add to table of geometric functions on p.152)
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6435bd8deadSopenharmony_ci    | Syntax                                    | Desciption                                    |
6445bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6455bd8deadSopenharmony_ci    | float16_t length (genF16Type x)           | Returns the length of vector x, i.e.,         |
6465bd8deadSopenharmony_ci    |                                           | sqrt(x[0]*x[0] + x[1]*x[1] + ...)             |
6475bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6485bd8deadSopenharmony_ci    | float16_t distance (genF16Type p0,        | Returns the distance between p0 and p1, i.e., |
6495bd8deadSopenharmony_ci    |                     genF16Type p1)        | length (p0 - p1)                              |
6505bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6515bd8deadSopenharmony_ci    | float16_t dot (genF16Type x, genF16Type y)| Returns the dot product of x and y, i.e.,     |
6525bd8deadSopenharmony_ci    |                                           | x[0]*y[0] + x[1]*y [1] + ...                  |
6535bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6545bd8deadSopenharmony_ci    | f16vec3 cross (f16vec3 x, f16vec3 y)      | Returns the cross product of x and y, i.e.,   |
6555bd8deadSopenharmony_ci    |                                           | |x[1] * y[2] - y[1] * x[2]|                   |
6565bd8deadSopenharmony_ci    |                                           | |x[2] * y[0] - y[2] * x[0]|                   |
6575bd8deadSopenharmony_ci    |                                           | |x[0] * y[1] - y[0] * x[1]|                   |
6585bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6595bd8deadSopenharmony_ci    | genF16Type normalize (genF16Type x)       | Returns a vector in the same direction as x   |
6605bd8deadSopenharmony_ci    |                                           | but with a length of 1.                       |
6615bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6625bd8deadSopenharmony_ci    | genF16Type faceforward (genF16Type N,     | If dot(Nref, I) < 0 return N, otherwise return|
6635bd8deadSopenharmony_ci    |                         genF16Type I,     | -N.                                           |
6645bd8deadSopenharmony_ci    |                         genF16Type Nref), |                                               |
6655bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6665bd8deadSopenharmony_ci    | genF16Type reflect (genF16Type I,         | For the incident vector I and surface         |
6675bd8deadSopenharmony_ci    |                     genF16Type N)         | orientation N, returns the reflection         |
6685bd8deadSopenharmony_ci    |                                           | direction:                                    |
6695bd8deadSopenharmony_ci    |                                           |    I - 2 * dot(N, I) * N                      |
6705bd8deadSopenharmony_ci    |                                           | N must already be normalized in order to      |
6715bd8deadSopenharmony_ci    |                                           | achieve the desired result.                   |
6725bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6735bd8deadSopenharmony_ci    | genF16Type refract (genF16Type I,         | For the incident vector I and surface normal  |
6745bd8deadSopenharmony_ci    |                     genF16Type N,         | N, and the ratio of indices of refraction eta,|
6755bd8deadSopenharmony_ci    |                     float16_t eta)        | return the refraction vector. The result is   |
6765bd8deadSopenharmony_ci    |                                           | computed by                                   |
6775bd8deadSopenharmony_ci    |                                           |    k = 1.0 - eta * eta * (1.0 - dot(N, I) *   |
6785bd8deadSopenharmony_ci    |                                           |                dot(N, I))                     |
6795bd8deadSopenharmony_ci    |                                           | if (k < 0.0)                                  |
6805bd8deadSopenharmony_ci    |                                           |     return genF16Type(0.0)                    |
6815bd8deadSopenharmony_ci    |                                           | else                                          |
6825bd8deadSopenharmony_ci    |                                           |    return eta * I - (eta * dot(N, I)          |
6835bd8deadSopenharmony_ci    |                                           |                      + sqrt(k)) * N           |
6845bd8deadSopenharmony_ci    |                                           | The input parameters for the incident vector  |
6855bd8deadSopenharmony_ci    |                                           | I and the surface normal N must already be    |
6865bd8deadSopenharmony_ci    |                                           | normalized to get the desired results.        |
6875bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
6885bd8deadSopenharmony_ci
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci    Modify Section, 8.6 Matrix Functions
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ci    (modify the first paragraph of the section on p. 154)
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ci    ..., there is both a single-precision floating-point version, where all
6955bd8deadSopenharmony_ci    arguments and return values are single precision, a double-precision
6965bd8deadSopenharmony_ci    floating-point version, where all arguments and return values are double
6975bd8deadSopenharmony_ci    precision, and a half-precision floating-point version, where all
6985bd8deadSopenharmony_ci    arguments and return values are half precision.
6995bd8deadSopenharmony_ci
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci    Modify Section, 8.7, Vector Relational Functions
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci    (add to the table of placeholders at the top of p. 156)
7045bd8deadSopenharmony_ci
7055bd8deadSopenharmony_ci    +-------------+-----------------------------+
7065bd8deadSopenharmony_ci    | Placeholder | Specific Types Allowed      |
7075bd8deadSopenharmony_ci    +-------------+-----------------------------+
7085bd8deadSopenharmony_ci    | f16vec      | f16vec2, f16vec3, f16vec4   |
7095bd8deadSopenharmony_ci    +-------------+-----------------------------+
7105bd8deadSopenharmony_ci
7115bd8deadSopenharmony_ci    (add to the table of vector relational functions at the bottom of p. 156)
7125bd8deadSopenharmony_ci
7135bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7145bd8deadSopenharmony_ci    | Syntax                                    | Desciption                                    |
7155bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7165bd8deadSopenharmony_ci    | bvec lessThan(f16vec x, f16vec y)         | Returns the component-wise compare of x < y.  |
7175bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7185bd8deadSopenharmony_ci    | bvec lessThanEqual(f16vec x, f16vec y)    | Returns the component-wise compare of x <= y. |
7195bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7205bd8deadSopenharmony_ci    | bvec greaterThan(f16vec x, f16vec y)      | Returns the component-wise compare of x > y.  |
7215bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7225bd8deadSopenharmony_ci    | bvec greaterThanEqual(f16vec x, f16vec y) | Returns the component-wise compare of x >= y. |
7235bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7245bd8deadSopenharmony_ci    | bvec equal(f16vec x, f16vec y)            | Returns the component-wise compare of x == y. |
7255bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7265bd8deadSopenharmony_ci    | bvec notEqual(f16vec x, f16vec y)         | Returns the component-wise compare of x != y. |
7275bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7285bd8deadSopenharmony_ci
7295bd8deadSopenharmony_ci
7305bd8deadSopenharmony_ci    Modify Section 8.13.1 Derivative Functions
7315bd8deadSopenharmony_ci
7325bd8deadSopenharmony_ci    (add to table of derivative functions on p. 181)
7335bd8deadSopenharmony_ci
7345bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7355bd8deadSopenharmony_ci    | Syntax                                    | Description                                   |
7365bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7375bd8deadSopenharmony_ci    | genF16Type dFdx (genF16Type p)            | Returns either dFdxFine(p) or dFdxCoarse(p),  |
7385bd8deadSopenharmony_ci    |                                           | based on implementation choice, presumably    |
7395bd8deadSopenharmony_ci    |                                           | whichever is the faster, or by whichever is   |
7405bd8deadSopenharmony_ci    |                                           | selected in the API through                   |
7415bd8deadSopenharmony_ci    |                                           | quality-versus-speed hints.                   |
7425bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7435bd8deadSopenharmony_ci    | genF16Type dFdy (genF16Type p)            | Returns either dFdyFine(p) or dFdyCoarse(p),  |
7445bd8deadSopenharmony_ci    |                                           | based on implementation choice, presumably    |
7455bd8deadSopenharmony_ci    |                                           | whichever is the faster, or by whichever is   |
7465bd8deadSopenharmony_ci    |                                           | selected in the API through                   |
7475bd8deadSopenharmony_ci    |                                           | quality-versus-speed hints.                   |
7485bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7495bd8deadSopenharmony_ci    | genF16Type dFdxFine (genF16Type p)        | Returns the partial derivative of p with      |
7505bd8deadSopenharmony_ci    |                                           | respect to the window x coordinate. Will use  |
7515bd8deadSopenharmony_ci    |                                           | local differencing based on the value of p    |
7525bd8deadSopenharmony_ci    |                                           | for the current fragment and its immediate    |
7535bd8deadSopenharmony_ci    |                                           | neighbor(s).                                  |
7545bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7555bd8deadSopenharmony_ci    | genF16Type dFdyFine (genF16Type p)        | Returns the partial derivative of p with      |
7565bd8deadSopenharmony_ci    |                                           | respect to the window y coordinate. Will use  |
7575bd8deadSopenharmony_ci    |                                           | local differencing based on the value of p    |
7585bd8deadSopenharmony_ci    |                                           | for the current fragment and its immediate    |
7595bd8deadSopenharmony_ci    |                                           | neighbor(s).                                  |
7605bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7615bd8deadSopenharmony_ci    | genF16Type dFdxCoarse (genF16Type p)      | Returns the partial derivative of p with      |
7625bd8deadSopenharmony_ci    |                                           | respect to the window x coordinate. Will use  |
7635bd8deadSopenharmony_ci    |                                           | local differencing based on the value of p    |
7645bd8deadSopenharmony_ci    |                                           | for the current fragment's neighbors, and     |
7655bd8deadSopenharmony_ci    |                                           | will possibly, but not necessarily, include   |
7665bd8deadSopenharmony_ci    |                                           | the value of p for the current fragment. That |
7675bd8deadSopenharmony_ci    |                                           | is, over a given area, the implementation can |
7685bd8deadSopenharmony_ci    |                                           | x compute derivatives in fewer unique         |
7695bd8deadSopenharmony_ci    |                                           | locations than would be allowed for           |
7705bd8deadSopenharmony_ci    |                                           | dFdxFine(p).                                  |
7715bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7725bd8deadSopenharmony_ci    | genF16Type dFdyCoarse (genF16Type p)      | Returns the partial derivative of p with      |
7735bd8deadSopenharmony_ci    |                                           | respect to the window y coordinate. Will use  |
7745bd8deadSopenharmony_ci    |                                           | local differencing based on the value of p    |
7755bd8deadSopenharmony_ci    |                                           | for the current fragment's neighbors, and     |
7765bd8deadSopenharmony_ci    |                                           | will possibly, but not necessarily, include   |
7775bd8deadSopenharmony_ci    |                                           | the value of p for the current fragment. That |
7785bd8deadSopenharmony_ci    |                                           | is, over a given area, the implementation can |
7795bd8deadSopenharmony_ci    |                                           | compute y derivatives in fewer unique         |
7805bd8deadSopenharmony_ci    |                                           | locations than would be allowed for           |
7815bd8deadSopenharmony_ci    |                                           | dFdyFine(p).                                  |
7825bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7835bd8deadSopenharmony_ci    | genF16Type fwidth (genF16Type p)          | Returns abs(dFdx(p)) + abs(dFdy(p)).          |
7845bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7855bd8deadSopenharmony_ci    | genF16Type fwidthFine (genF16Type p)      | Returns abs(dFdxFine(p)) + abs(dFdyFine(p)).  |
7865bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7875bd8deadSopenharmony_ci    | genF16Type fwidthCoarse (genF16Type p)    | Returns abs(dFdxCoarse(p)) +                  |
7885bd8deadSopenharmony_ci    |                                           |         abs(dFdyCoarse(p)).                   |
7895bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7905bd8deadSopenharmony_ci
7915bd8deadSopenharmony_ci
7925bd8deadSopenharmony_ci    Modify Section 8.13.2 Interpolation Functions
7935bd8deadSopenharmony_ci
7945bd8deadSopenharmony_ci    (add to table of interpolation functions on p. 180)
7955bd8deadSopenharmony_ci
7965bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7975bd8deadSopenharmony_ci    | Syntax                                    | Description                                   |
7985bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
7995bd8deadSopenharmony_ci    | genF16Type interpolateAtCentroid (        | Returns the value of the input interpolant    |
8005bd8deadSopenharmony_ci    |            genF16Type interpolant)        | sampled at a location inside both the pixel   |
8015bd8deadSopenharmony_ci    |                                           | and the primitive being processed. The value  |
8025bd8deadSopenharmony_ci    |                                           | obtained would be the same value assigned to  |
8035bd8deadSopenharmony_ci    |                                           | the input variable if declared with the       |
8045bd8deadSopenharmony_ci    |                                           | centroid qualifier                            |
8055bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
8065bd8deadSopenharmony_ci    | genF16Type interpolateAtSample (          | Returns the value of the input interpolant    |
8075bd8deadSopenharmony_ci    |            genF16Type interpolant,        | variable at the location of sample number     |
8085bd8deadSopenharmony_ci    |            int        sample)             | sample. If multisample buffers are not        |
8095bd8deadSopenharmony_ci    |                                           | available, the input variable will be         |
8105bd8deadSopenharmony_ci    |                                           | evaluated at the center of the pixel. If      |
8115bd8deadSopenharmony_ci    |                                           | sample sample does not exist, the position    |
8125bd8deadSopenharmony_ci    |                                           | used to interpolate the input variable is     |
8135bd8deadSopenharmony_ci    |                                           | undefined.                                    |
8145bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
8155bd8deadSopenharmony_ci    | genF16Type interpolateAtOffset (          | Returns the value of the input interpolant    |
8165bd8deadSopenharmony_ci    |            genF16Type interpolant,        | variable sampled at an offset from the center |
8175bd8deadSopenharmony_ci    |            f16vec2    offset)             | of the pixel specified by offset. The two     |
8185bd8deadSopenharmony_ci    |                                           | floating-point components of offset, give the |
8195bd8deadSopenharmony_ci    |                                           | offset in pixels in the x and y directions,   |
8205bd8deadSopenharmony_ci    |                                           | respectively. An offset of (0, 0) identifies  |
8215bd8deadSopenharmony_ci    |                                           | the center of the pixel. The range and        |
8225bd8deadSopenharmony_ci    |                                           | granularity of offsets supported by this      |
8235bd8deadSopenharmony_ci    |                                           | function isimplementation-dependent.          |
8245bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
8255bd8deadSopenharmony_ci
8265bd8deadSopenharmony_ci
8275bd8deadSopenharmony_ci    Modify Section 9, Shading Language Grammar for Core Profile
8285bd8deadSopenharmony_ci
8295bd8deadSopenharmony_ci    (add to the list of tokens on p. 187)
8305bd8deadSopenharmony_ci
8315bd8deadSopenharmony_ci      ...
8325bd8deadSopenharmony_ci      FLOAT16  F16VEC2  F16VEC3  F16VEC4
8335bd8deadSopenharmony_ci      F16MAT2 F16MAT3 F16MAT4
8345bd8deadSopenharmony_ci      F16MAT2X2 FL6MAT2X3 F16MAT2X4
8355bd8deadSopenharmony_ci      F16MAT3X2 F16MAT3X3 F16MAT3X4
8365bd8deadSopenharmony_ci      F16MAT4X2 F16MAT4X3 F16MAT4X4
8375bd8deadSopenharmony_ci      ...
8385bd8deadSopenharmony_ci      FLOAT16CONSTANT
8395bd8deadSopenharmony_ci
8405bd8deadSopenharmony_ci    (add to the rule of "primary_expression" on p. 188)
8415bd8deadSopenharmony_ci
8425bd8deadSopenharmony_ci      primary_expression:
8435bd8deadSopenharmony_ci        ...
8445bd8deadSopenharmony_ci        FLOAT16CONSTANT
8455bd8deadSopenharmony_ci        ...
8465bd8deadSopenharmony_ci
8475bd8deadSopenharmony_ci    (add to the rule of "type_specifier_nonarray" on p. 195)
8485bd8deadSopenharmony_ci
8495bd8deadSopenharmony_ci      type_specifier_nonarray:
8505bd8deadSopenharmony_ci        ...
8515bd8deadSopenharmony_ci          FLOAT16
8525bd8deadSopenharmony_ci          F16VEC2
8535bd8deadSopenharmony_ci          F16VEC3
8545bd8deadSopenharmony_ci          F16VEC4
8555bd8deadSopenharmony_ci          F16MAT2
8565bd8deadSopenharmony_ci          F16MAT3
8575bd8deadSopenharmony_ci          F16MAT4
8585bd8deadSopenharmony_ci          F16MAT2X2
8595bd8deadSopenharmony_ci          FL6MAT2X3
8605bd8deadSopenharmony_ci          F16MAT2X4
8615bd8deadSopenharmony_ci          F16MAT3X2
8625bd8deadSopenharmony_ci          F16MAT3X3
8635bd8deadSopenharmony_ci          F16MAT3X4
8645bd8deadSopenharmony_ci          F16MAT4X2
8655bd8deadSopenharmony_ci          F16MAT4X3
8665bd8deadSopenharmony_ci          F16MAT4X4
8675bd8deadSopenharmony_ci        ...
8685bd8deadSopenharmony_ci
8695bd8deadSopenharmony_ci
8705bd8deadSopenharmony_ciDependencies on ARB_gpu_shader_int64
8715bd8deadSopenharmony_ci
8725bd8deadSopenharmony_ci    If the shader enables ARB_gpu_shader_int64, this extension allows
8735bd8deadSopenharmony_ci    additional explicit conversions between half-precision floating-point
8745bd8deadSopenharmony_ci    types and 64-bit integer types.
8755bd8deadSopenharmony_ci
8765bd8deadSopenharmony_ci    Modify Section 5.4.1, Conversion and Scalar Constructors
8775bd8deadSopenharmony_ci
8785bd8deadSopenharmony_ci    (add after the first list of constructor examples on p. 95)
8795bd8deadSopenharmony_ci
8805bd8deadSopenharmony_ci      int64_t(float16_t)    // convert a float16_t value to a signed 64-bit integer
8815bd8deadSopenharmony_ci      uint64_t(float16_t)   // convert a float16_t value to an unsigned 64-bit integer
8825bd8deadSopenharmony_ci      float16_t(int64_t)    // convert a signed 64-bit integer to a float16_t value
8835bd8deadSopenharmony_ci      float16_t(uint64_t)   // convert an unsigned 64-bit integer to a float16_t value
8845bd8deadSopenharmony_ci
8855bd8deadSopenharmony_ci
8865bd8deadSopenharmony_ciDependencies on AMD_shader_trinary_minmax
8875bd8deadSopenharmony_ci
8885bd8deadSopenharmony_ci    If the shader enables AMD_shader_trinary_minmax, this extension adds
8895bd8deadSopenharmony_ci    additional common functions.
8905bd8deadSopenharmony_ci
8915bd8deadSopenharmony_ci    Modify Section 8.3, Common Functions
8925bd8deadSopenharmony_ci
8935bd8deadSopenharmony_ci    (add to the table of common functions on p. 144)
8945bd8deadSopenharmony_ci
8955bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
8965bd8deadSopenharmony_ci    | Syntax                                    | Description                                   |
8975bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
8985bd8deadSopenharmony_ci    | genF16Type min3(genF16Type x,             | Returns the per-component minimum value of x, |
8995bd8deadSopenharmony_ci    |                 genF16Type y,             | y, and z.                                     |
9005bd8deadSopenharmony_ci    |                 genF16Type z)             |                                               |
9015bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9025bd8deadSopenharmony_ci    | genF16Type max3(genF16Type x,             | Returns the per-component maximum value of x, |
9035bd8deadSopenharmony_ci    |                 genF16Type y,             | y, and z.                                     |
9045bd8deadSopenharmony_ci    |                 genF16Type z)             |                                               |
9055bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9065bd8deadSopenharmony_ci    | genF16Type mid3(genF16Type x,             | Returns the per-component median value of x,  |
9075bd8deadSopenharmony_ci    |                 genF16Type y,             | y, and z.                                     |
9085bd8deadSopenharmony_ci    |                 genF16Type z)             |                                               |
9095bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9105bd8deadSopenharmony_ci
9115bd8deadSopenharmony_ci
9125bd8deadSopenharmony_ciDependencies on AMD_shader_explicit_vertex_parameter
9135bd8deadSopenharmony_ci
9145bd8deadSopenharmony_ci    If the shader enables AMD_shader_explicit_vertex_parameter, this extension
9155bd8deadSopenharmony_ci    adds additional interpolation functions.
9165bd8deadSopenharmony_ci
9175bd8deadSopenharmony_ci    Modify Section 8.13.2 Interpolation Functions
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci    (add to table of interpolation functions on p. 180)
9205bd8deadSopenharmony_ci
9215bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9225bd8deadSopenharmony_ci    | Syntax                                    | Description                                   |
9235bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9245bd8deadSopenharmony_ci    | genF16Type interpolateAtVertexAMD (       | Returns the value of the input <interpolant>  |
9255bd8deadSopenharmony_ci    |            genF16Type interpolant,        | without any interpolation. i.e. the raw       |
9265bd8deadSopenharmony_ci    |            uint       vertexIdx)          | output value of previous shader stage.        |
9275bd8deadSopenharmony_ci    |                                           | <vertexIdx> selects for which vertex of the   |
9285bd8deadSopenharmony_ci    |                                           | primitive the value of <interpolant> is       |
9295bd8deadSopenharmony_ci    |                                           | returned.                                     |
9305bd8deadSopenharmony_ci    |                                           |                                               |
9315bd8deadSopenharmony_ci    |                                           | This return value is equivalent with          |
9325bd8deadSopenharmony_ci    |                                           | interpolating the input <interpolant> using   |
9335bd8deadSopenharmony_ci    |                                           | the following set of barycentric coordinates, |
9345bd8deadSopenharmony_ci    |                                           | depending on the value of <vertexIdx>:        |
9355bd8deadSopenharmony_ci    |                                           |                                               |
9365bd8deadSopenharmony_ci    |                                           |  vertexIdx    Barycentric coordinates         |
9375bd8deadSopenharmony_ci    |                                           |  0            I=0, J=0, K=1                   |
9385bd8deadSopenharmony_ci    |                                           |  1            I=1, J=0, K=0                   |
9395bd8deadSopenharmony_ci    |                                           |  2            I=0, J=1, K=0                   |
9405bd8deadSopenharmony_ci    |                                           |                                               |
9415bd8deadSopenharmony_ci    |                                           | However this order has no association with    |
9425bd8deadSopenharmony_ci    |                                           | the vertex order specified by the application |
9435bd8deadSopenharmony_ci    |                                           | in the originating draw.                      |
9445bd8deadSopenharmony_ci    |                                           |                                               |
9455bd8deadSopenharmony_ci    |                                           | The value of <vertexIdx> must be constant     |
9465bd8deadSopenharmony_ci    |                                           | integer expression with a value in the range  |
9475bd8deadSopenharmony_ci    |                                           | [0, 2].                                       |
9485bd8deadSopenharmony_ci    +-------------------------------------------+-----------------------------------------------+
9495bd8deadSopenharmony_ci
9505bd8deadSopenharmony_ci
9515bd8deadSopenharmony_ciErrors
9525bd8deadSopenharmony_ci
9535bd8deadSopenharmony_ci    None.
9545bd8deadSopenharmony_ci
9555bd8deadSopenharmony_ciNew State
9565bd8deadSopenharmony_ci
9575bd8deadSopenharmony_ci    None.
9585bd8deadSopenharmony_ci
9595bd8deadSopenharmony_ciNew Implementation Dependent State
9605bd8deadSopenharmony_ci
9615bd8deadSopenharmony_ci    None.
9625bd8deadSopenharmony_ci
9635bd8deadSopenharmony_ciIssues
9645bd8deadSopenharmony_ci
9655bd8deadSopenharmony_ci    (1) How the functionality in this extension different than the half_precision
9665bd8deadSopenharmony_ci        floating-point types introduced by NV_gpu_shader5?
9675bd8deadSopenharmony_ci
9685bd8deadSopenharmony_ci      RESOLVED: This extension is designed to be source code compatible with
9695bd8deadSopenharmony_ci      the half-precison floating-point support in NV_gpu_shader5. However, it
9705bd8deadSopenharmony_ci      is a functional superset of that, as it adds the following additional
9715bd8deadSopenharmony_ci      features:
9725bd8deadSopenharmony_ci
9735bd8deadSopenharmony_ci        * support for implicit conversions from int, uint and float to float16_t.
9745bd8deadSopenharmony_ci
9755bd8deadSopenharmony_ci        * support for overloaded versions of the functions, such as abs, sign, min,
9765bd8deadSopenharmony_ci          max, clamp, and etc., that accept float16_t type or half-precision
9775bd8deadSopenharmony_ci          floating-point type as parameters.
9785bd8deadSopenharmony_ci
9795bd8deadSopenharmony_ci    (2) What should be done to distinguish half-precison floating-point constants?
9805bd8deadSopenharmony_ci
9815bd8deadSopenharmony_ci      RESOLVED: We will use "HF" and "hf" to identify half-precision
9825bd8deadSopenharmony_ci      floating-point constants.
9835bd8deadSopenharmony_ci
9845bd8deadSopenharmony_ci    (3) Should we import new uniform API to setup the float16_t type uniform in
9855bd8deadSopenharmony_ci        default uniform block?
9865bd8deadSopenharmony_ci
9875bd8deadSopenharmony_ci      RESOLVED: No. float16_t isn't a IEEE standard format, CPU doesn't support
9885bd8deadSopenharmony_ci      it directly. So most data on CPU side is stored in the form of single- or
9895bd8deadSopenharmony_ci      double-precision floating-point precision floating-point. Uniform*f{v}'s
9905bd8deadSopenharmony_ci      functionality is extended to support uniforms with float16_t type in this
9915bd8deadSopenharmony_ci      extension.
9925bd8deadSopenharmony_ci
9935bd8deadSopenharmony_ci    (4) Should we support float16_t types as members of uniform blocks,
9945bd8deadSopenharmony_ci        shader storage buffer blocks, or as transform feedback varyings?
9955bd8deadSopenharmony_ci
9965bd8deadSopenharmony_ci      RESOLVED: Yes, support all of them. float16_t types will consume two
9975bd8deadSopenharmony_ci      basic machine units. Some examples:
9985bd8deadSopenharmony_ci
9995bd8deadSopenharmony_ci          struct S {
10005bd8deadSopenharmony_ci
10015bd8deadSopenharmony_ci              float16_t  x;     // rule 1:  align = 2, takes offsets 0-1
10025bd8deadSopenharmony_ci              f16vec2    y;     // rule 2:  align = 4, takes offsets 4-7
10035bd8deadSopenharmony_ci              f16vec3    z;     // rule 3:  align = 8, takes offsets 8-13
10045bd8deadSopenharmony_ci          };
10055bd8deadSopenharmony_ci
10065bd8deadSopenharmony_ci          layout(column_major, std140) uniform B1 {
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci              float16_t  a;     // rule 1:  align = 2, takes offsets 0-1
10095bd8deadSopenharmony_ci              f16vec2    b;     // rule 2:  align = 4, takes offsets 4-7
10105bd8deadSopenharmony_ci              f16vec3    c;     // rule 3:  align = 8, takes offsets 8-13
10115bd8deadSopenharmony_ci              float16_t  d[2];  // rule 4:  align = 16, array stride = 16,
10125bd8deadSopenharmony_ci                                //          takes offsets 16-47
10135bd8deadSopenharmony_ci              f16mat2x3  e;     // rule 5:  align = 16, matrix stride = 16,
10145bd8deadSopenharmony_ci                                //          takes offsets 48-79
10155bd8deadSopenharmony_ci              f16mat2x3  f[2];  // rule 6:  align = 16, matrix stride = 16,
10165bd8deadSopenharmony_ci                                //          array stride = 32, f[0] takes
10175bd8deadSopenharmony_ci                                //          offsets 80-111, f[1] takes offsets
10185bd8deadSopenharmony_ci                                //          112-143
10195bd8deadSopenharmony_ci              S          g;     // rule 9:  align = 16, g.x takes offsets
10205bd8deadSopenharmony_ci                                //          144-145, g.y takes offsets 148-151,
10215bd8deadSopenharmony_ci                                //          g.z takes offsets 152-159
10225bd8deadSopenharmony_ci              S          h[2];  // rule 10: align = 16, array stride = 16, h[0]
10235bd8deadSopenharmony_ci                                //          takes offsets 160-175, h[1] takes
10245bd8deadSopenharmony_ci                                //          offsets 176-191
10255bd8deadSopenharmony_ci          };
10265bd8deadSopenharmony_ci
10275bd8deadSopenharmony_ci          layout(row_major, std430) buffer B2 {
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ci              float16_t  o;     // rule 1:  align = 2, takes offsets 0-1
10305bd8deadSopenharmony_ci              f16vec2    p;     // rule 2:  align = 4, takes offsets 4-7
10315bd8deadSopenharmony_ci              f16vec3    q;     // rule 3:  align = 8, takes offsets 8-13
10325bd8deadSopenharmony_ci              float16_t  r[2];  // rule 4:  align = 2, array stride = 2, takes
10335bd8deadSopenharmony_ci                                //          offsets 14-17
10345bd8deadSopenharmony_ci              f16mat2x3  s;     // rule 7:  align = 4, matrix stride = 4, takes
10355bd8deadSopenharmony_ci                                //          offsets 20-31
10365bd8deadSopenharmony_ci              f16mat2x3  t[2];  // rule 8:  align = 4, matrix stride = 4, array
10375bd8deadSopenharmony_ci                                //          stride = 12, t[0] takes offsets
10385bd8deadSopenharmony_ci                                //          32-43, t[1] takes offsets 44-55
10395bd8deadSopenharmony_ci              S          u;     // rule 9:  align = 8, u.x takes offsets
10405bd8deadSopenharmony_ci                                //          56-57, u.y takes offsets 60-63, u.z
10415bd8deadSopenharmony_ci                                //          takes offsets 64-69
10425bd8deadSopenharmony_ci              S          v[2];  // rule 10: align = 8, array stride = 16, v[0]
10435bd8deadSopenharmony_ci                                //          takes offsets 72-87, v[1] takes
10445bd8deadSopenharmony_ci                                //          offsets 88-103
10455bd8deadSopenharmony_ci          };
10465bd8deadSopenharmony_ci
10475bd8deadSopenharmony_ci    (5) In OpenGL ES Shading Language, the format of floating-point in UBO and
10485bd8deadSopenharmony_ci        SSBO is always single-precision floating-point regardless of the precision
10495bd8deadSopenharmony_ci        qualifier in shader. which format should be used for this extension?
10505bd8deadSopenharmony_ci
10515bd8deadSopenharmony_ci      RESOLVED: the format should be equal with the type declaried in shader.
10525bd8deadSopenharmony_ci      i.e. if the block member's type is float16_t, the format in buffer is
10535bd8deadSopenharmony_ci      half-precision floating-point. and if the block member's type is float,
10545bd8deadSopenharmony_ci      the format is single-precision floating-point. we will provide another
10555bd8deadSopenharmony_ci      extension to keep compatible with ES driver's behavior.
10565bd8deadSopenharmony_ci
10575bd8deadSopenharmony_ci
10585bd8deadSopenharmony_ciRevision History
10595bd8deadSopenharmony_ci
10605bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
10615bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------
10625bd8deadSopenharmony_ci     5    09/21/16  dwitczak  Fixed minor character encoding issues.
10635bd8deadSopenharmony_ci
10645bd8deadSopenharmony_ci     4    08/01/16  rexu      Correct the example of offset calculation for
10655bd8deadSopenharmony_ci                              block members. Add limitation of xfb_offset when
10665bd8deadSopenharmony_ci                              this qualifier is applied to block members that
10675bd8deadSopenharmony_ci                              have float16_t types.
10685bd8deadSopenharmony_ci
10695bd8deadSopenharmony_ci     3    07/11/16  rexu      Clarify that each component of float16_t types
10705bd8deadSopenharmony_ci                              consume two basic machine units. Remove the
10715bd8deadSopenharmony_ci                              interaction with NV_gpu_shader5 in that implicit
10725bd8deadSopenharmony_ci                              conversion from int, uint and float types to
10735bd8deadSopenharmony_ci                              float16_t types are disallowed now. Add new
10745bd8deadSopenharmony_ci                              derivative functions: dFdxFine, dFdyFine,
10755bd8deadSopenharmony_ci                              dFdxCoarse, dFdyCoarse, fwidthFine, fwidthCoarse.
10765bd8deadSopenharmony_ci                              Add the interaction with AMD_shader_trinary_minmax
10775bd8deadSopenharmony_ci                              and AMD_shader_explicit_vertex_parameter. Remove
10785bd8deadSopenharmony_ci                              two listed issues that are no longer valid for
10795bd8deadSopenharmony_ci                              the updated version of this extension. Remove
10805bd8deadSopenharmony_ci                              floatBitsToInt and decide to add it when
10815bd8deadSopenharmony_ci                              16-bit integer data type is supported.
10825bd8deadSopenharmony_ci
10835bd8deadSopenharmony_ci     2    07/06/16  rexu      Remove sections that involve half-precision
10845bd8deadSopenharmony_ci                              floating-point opaque types. Modify allowed rules
10855bd8deadSopenharmony_ci                              of implicit conversion relevant to float16_t
10865bd8deadSopenharmony_ci                              types. Add the interaction with ARB_gpu_shader_
10875bd8deadSopenharmony_ci                              int64. Remove the modification of the first rule
10885bd8deadSopenharmony_ci                              of std140 layout. Provide some examples to
10895bd8deadSopenharmony_ci                              demostrate memory storage layout of uniform
10905bd8deadSopenharmony_ci                              blocks and shader storage blocks when they have
10915bd8deadSopenharmony_ci                              members of float16_t types.
10925bd8deadSopenharmony_ci
10935bd8deadSopenharmony_ci     1    11/14/13  qlin      Initial revision.
1094