15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_fragment_shader
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_fragment_shader
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Dave Baldwin
125bd8deadSopenharmony_ci    Pat Brown
135bd8deadSopenharmony_ci    Evan Hart
145bd8deadSopenharmony_ci    Phil Huxley
155bd8deadSopenharmony_ci    Dale Kirkland
165bd8deadSopenharmony_ci    John Kessenich
175bd8deadSopenharmony_ci    Steve Koren
185bd8deadSopenharmony_ci    Jon Leech
195bd8deadSopenharmony_ci    Bill Licea-Kane
205bd8deadSopenharmony_ci    Benjamin Lipchak
215bd8deadSopenharmony_ci    Barthold Lichtenbelt
225bd8deadSopenharmony_ci    Kent Lin
235bd8deadSopenharmony_ci    Jeremy Morris
245bd8deadSopenharmony_ci    Teri Morrison
255bd8deadSopenharmony_ci    Glenn Ortner
265bd8deadSopenharmony_ci    Randi Rost
275bd8deadSopenharmony_ci    Jeremy Sandmel
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    The ARB_fragment_program working group members. Several concepts and
305bd8deadSopenharmony_ci    chunks of text are copied from the ARB_fragment_program specification.
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciContact
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Barthold Lichtenbelt, 3Dlabs, Inc. (barthold 'at' 3dlabs.com)
355bd8deadSopenharmony_ci    Randi Rost, 3Dlabs, Inc. (rost 'at' 3dlabs.com)
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciNotice
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    Copyright (c) 2003-2013 The Khronos Group Inc. Copyright terms at
405bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciSpecification Update Policy
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
455bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
465bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
475bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
485bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
495bd8deadSopenharmony_ci    described in more detail at
505bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ciIP Status
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    As described in the Contributor License, which can be found at
555bd8deadSopenharmony_ci    http://www.3dlabs.com/support/developer/ogl2/specs/3dlabs_contributor.pdf.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ciStatus
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    Complete. Approved by the ARB on June 11, 2003.
605bd8deadSopenharmony_ci    Updated revision 0.79 approved by the ARB on June 17, 2004.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ciVersion
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    Last Modified Date: December 12, 2006
655bd8deadSopenharmony_ci    Author Revision: 0.80
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNumber
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    ARB Extension #32
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciDependencies
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    OpenGL 1.0 is required.
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    This extension is written against version 1.10 of the OpenGL Shading
765bd8deadSopenharmony_ci    Language Specification.
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    The extension is written against the OpenGL 1.4 Specification.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    The ARB_shader_objects extension is required.
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    This extension interacts with the ARB_vertex_shader extension.
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ciOverview
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    This extension adds functionality to define fragment shader objects. A
875bd8deadSopenharmony_ci    fragment shader object is a shader object (see the ARB_shader_objects
885bd8deadSopenharmony_ci    extension) that, when attached to a program object, can be compiled and
895bd8deadSopenharmony_ci    linked to produce an executable that runs on the fragment processor in
905bd8deadSopenharmony_ci    OpenGL. The fragment processor is a programmable unit that replaces the
915bd8deadSopenharmony_ci    OpenGL 1.4 fixed-function texturing, color sum and fog stages. This
925bd8deadSopenharmony_ci    extension also defines how such an executable interacts with the fixed
935bd8deadSopenharmony_ci    functionality fragment processing of OpenGL 1.4. The language used to
945bd8deadSopenharmony_ci    write fragment shaders is not discussed here. That language is defined
955bd8deadSopenharmony_ci    in the OpenGL Shading Language specification as the Fragment Shading
965bd8deadSopenharmony_ci    Language.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ciIssues
995bd8deadSopenharmony_ci    1) Can you clarify texture unit, texture image unit and texture
1005bd8deadSopenharmony_ci       coordinate sets please?
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    DISCUSSION: In 'old style' GL a texture unit consists of a texture
1035bd8deadSopenharmony_ci    coordinate processing unit (consisting of a texture matrix stack and
1045bd8deadSopenharmony_ci    texture coordinate generation state), and a texture image unit, with all
1055bd8deadSopenharmony_ci    the texture state defined in section 3.8, as well as texture environment
1065bd8deadSopenharmony_ci    state, as defined in section 3.8.12. The implementation dependent number
1075bd8deadSopenharmony_ci    of supported texture units in 'old style' GL is MAX_TEXTURE_UNITS.
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci    In this specification a texture unit consist of one or both of a texture
1105bd8deadSopenharmony_ci    image unit, and a texture coordinate set. The implementation dependent
1115bd8deadSopenharmony_ci    number of supported texture image units is MAX_TEXTURE_IMAGE_UNITS_ARB
1125bd8deadSopenharmony_ci    and the number of supported texture coordinate sets is
1135bd8deadSopenharmony_ci    MAX_TEXTURE_COORDS_ARB.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    The maximum available multi-texture stages (to the fixed-function
1165bd8deadSopenharmony_ci    pipeline) are MAX_TEXTURE_UNITS. A fragment shader has access to at
1175bd8deadSopenharmony_ci    least MAX_TEXTURE_UNITS texture image units, and possibly more, up to
1185bd8deadSopenharmony_ci    MAX_TEXTURE_IMAGE_UNITS_ARB. Where MAX_TEXTURE_IMAGE_UNITS_ARB is equal
1195bd8deadSopenharmony_ci    or greater than MAX_TEXTURE_UNITS.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    RESOLUTION: Yes
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    2) Should we split the number of available texture coordinate sets and
1245bd8deadSopenharmony_ci       texture units?
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    DISCUSSION: Some implementations might provide for more texture image
1275bd8deadSopenharmony_ci    units than texture coordinate sets. Texture coordinates for the 'new'
1285bd8deadSopenharmony_ci    texture image units can be derived from other texture coordinates, or
1295bd8deadSopenharmony_ci    provided through a texture lookup. These new texture coordinates can be
1305bd8deadSopenharmony_ci    used to index different textures bound to different texture image units.
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci    RESOLUTION: YES, splitting this is useful.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    3) Is the texture environment state associated with all texture image
1355bd8deadSopenharmony_ci       units?
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    DISCUSSION: A fragment shader has access to the texture environment
1385bd8deadSopenharmony_ci    color through the shader built-in array gl_TexEnvColor. This array has
1395bd8deadSopenharmony_ci    MAX_TEXTURE_IMAGE_UNITS_ARB elements. It is also possible, and useful,
1405bd8deadSopenharmony_ci    to set the texture environment state TEXTURE_LOD_BIAS for all texture
1415bd8deadSopenharmony_ci    image units. All other texture environment state is not accessible to a
1425bd8deadSopenharmony_ci    fragment shader (for example, TEXTURE_ENV_MODE, COMBINE_RGB etc).
1435bd8deadSopenharmony_ci    However, an application can still set this state (and query it).
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    Note that fixed-function GL caps the number of supported texture stages
1465bd8deadSopenharmony_ci    to MAX_TEXTURE_UNITS. This limit is generally below the number of
1475bd8deadSopenharmony_ci    texture image units available to a fragment shader. Each of these
1485bd8deadSopenharmony_ci    MAX_TEXTURE_UNITS texture stages need all texture environment state for
1495bd8deadSopenharmony_ci    the multi-texture pipeline to function correctly. Texture units above
1505bd8deadSopenharmony_ci    this limit still have all the texture environment state associated with
1515bd8deadSopenharmony_ci    it, even although this state is not accessible in a fragment shader.
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    Note that ARB_fragment_program also does this, except that it caps
1545bd8deadSopenharmony_ci    access to the texture environment state to the first MAX_TEXTURE_UNITS
1555bd8deadSopenharmony_ci    texture image units.
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    RESOLUTION: Yes.
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    4) What to do about invariance rules (Appendix A)?
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    DISCUSSION: Numerous rules and proposals have been discussed. In the
1625bd8deadSopenharmony_ci    end, simplicity is an important goal. It is always possible to later add
1635bd8deadSopenharmony_ci    more invariance rules, if it turns out to be desirable.
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    RESOLUTION: The same shader will produce the same result when run
1665bd8deadSopenharmony_ci    multiple times with the same input. The wording 'the same shader' means
1675bd8deadSopenharmony_ci    a program object that is populated with the same source strings, which
1685bd8deadSopenharmony_ci    are compiled and then linked, possibly multiple times. This program
1695bd8deadSopenharmony_ci    object is executed using the same GL state vector.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    Besides the above general statement, we will limit this specification to
1725bd8deadSopenharmony_ci    one invariance rule with respect to depth produced by a fragment shader:
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    All shaders that either conditionally or unconditionally copy the input
1755bd8deadSopenharmony_ci    gl_FragCoord.z to the output gl_FragDepth are depth-invariant with
1765bd8deadSopenharmony_ci    respect to each other, for those fragments where this copy actually is
1775bd8deadSopenharmony_ci    done.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    Note that a fragment shader that does not write to gl_FragDepth is
1805bd8deadSopenharmony_ci    depth-invariant with fixed function (since fixed function depth will be
1815bd8deadSopenharmony_ci    used for the fragment when gl_FragDepth is not written).
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    See also Appendix A.
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    5) Should the output from the pixel rectangle rasterization and bitmap
1865bd8deadSopenharmony_ci       rasterization stages feed into a fragment shader?
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    DISCUSSION: See also Issue 2 in the OpenGL Shading Language
1895bd8deadSopenharmony_ci    specification. Future API additions could make the operations DrawPixels
1905bd8deadSopenharmony_ci    performs programmable. For the list of specific operations that could be
1915bd8deadSopenharmony_ci    replaced see Section 3.6.4, Figure 3.7 in the OpenGL 1.4 specification.
1925bd8deadSopenharmony_ci    Combined with the proposed pack/unpack language, and the proposed pack
1935bd8deadSopenharmony_ci    and unpack processors, such a future extension will become an extremely
1945bd8deadSopenharmony_ci    powerful and flexible imaging pipeline.
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    Most of the harder parts to implement the functionality in Figure 3.7
1975bd8deadSopenharmony_ci    result from the imaging subset. A conceivable way to implement this
1985bd8deadSopenharmony_ci    functionality is by using the programmable fragment unit. However, if
1995bd8deadSopenharmony_ci    the results from the pixel rectangle and bitmap rasterization stages did
2005bd8deadSopenharmony_ci    feed into the fragment shader, then implementing all the functionality
2015bd8deadSopenharmony_ci    in Figure 3.7 might become hard or impossible, when a fragment shader is
2025bd8deadSopenharmony_ci    also active. A possibility that was considered was to say that if a
2035bd8deadSopenharmony_ci    fragment shader was active, pixel transfer functionality such as scale
2045bd8deadSopenharmony_ci    and bias, color matrix, lookup, etc., was disabled. A fragment shader
2055bd8deadSopenharmony_ci    could perform these kinds of operations, after all.
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    ARB_fragment_program does feed the result of pixel rectangle and bitmap
2085bd8deadSopenharmony_ci    rasterization into the fragment shader.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    RESOLUTION: Yes, this allows fragment shaders to do image processing
2115bd8deadSopenharmony_ci    type of operations on pixel rectangles and bitmaps.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    Note that a fragment shader that is processing fragments resulting from
2145bd8deadSopenharmony_ci    rasterization of pixel rectangles or bitmaps, can only reference
2155bd8deadSopenharmony_ci    built-in varying variables starting with "gl_" (gl_Color,
2165bd8deadSopenharmony_ci    gl_SecondaryColor, gl_TexCoord[] and gl_FogFragCoord). The fragments
2175bd8deadSopenharmony_ci    produced as a result of rasterizing a pixel rectangle or bitmap have
2185bd8deadSopenharmony_ci    associated values for those varying variables. If the fragment shader
2195bd8deadSopenharmony_ci    uses a user-defined varying, results are undefined.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    6) What about clamping and conversion for color and depth output
2225bd8deadSopenharmony_ci       variables?
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    DISCUSSION: The output variables gl_FragDepth and gl_FragColor are in
2255bd8deadSopenharmony_ci    floating point format. However, the GL 1.4 pipeline following the
2265bd8deadSopenharmony_ci    fragment shader expects these values to be in fixed-point, and clamped
2275bd8deadSopenharmony_ci    to the range [0,1].
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci    RESOLUTION: Color and depth values written by the fragment shader will
2305bd8deadSopenharmony_ci    be automatically clamped to the range [0,1] and then converted, as
2315bd8deadSopenharmony_ci    appropriate, to a fixed-point representation. See section 3.11.6.
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    7) What about clamping and conversion for color and depth input varying
2345bd8deadSopenharmony_ci       variables?
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    DISCUSSION: This ties in with issue 18 in the ARB_vertex_shader
2375bd8deadSopenharmony_ci    specification. There are three cases to consider:
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci      1) An ARB_vertex_shader shader writing colors that are consumed by an
2405bd8deadSopenharmony_ci         ARB_fragment_shader shader.
2415bd8deadSopenharmony_ci      2) An ARB_vertex_program shader writing colors that are consumed by an
2425bd8deadSopenharmony_ci         ARB_fragment_shader shader.
2435bd8deadSopenharmony_ci      3) Fixed functionality vertex processing outputting colors that are
2445bd8deadSopenharmony_ci         consumed by an ARB_fragment_shader shader.
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci    Fixed function vertex processing as well as ARB_vertex_shader and
2475bd8deadSopenharmony_ci    ARB_vertex_program do clamp colors automatically to [0,1]. In all three
2485bd8deadSopenharmony_ci    cases colors are next converted to fixed-point (section 2.13.9).
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    RESOLUTION: Depth and color values will be converted to floating-point
2515bd8deadSopenharmony_ci    before entering the fragment shader.
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci    8) What controls the value of the shader built-in Boolean
2545bd8deadSopenharmony_ci       gl_FrontFacing?
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    DISCUSSION: The OpenGL Shading Language says the following: "The
2575bd8deadSopenharmony_ci    fragment shader has access to the read-only built-in variable
2585bd8deadSopenharmony_ci    gl_FrontFacing whose value is true if the fragment belongs to a
2595bd8deadSopenharmony_ci    front-facing primitive."
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    This specification defines when a fragment is considered front-facing.
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ci    A fragment derives its facing direction from the primitive that
2645bd8deadSopenharmony_ci    generates the fragment. All fragments generated by primitives other than
2655bd8deadSopenharmony_ci    polygons, triangles, or quadrilaterals are considered to be front
2665bd8deadSopenharmony_ci    facing. For all other fragments (including ones resulting from point-
2675bd8deadSopenharmony_ci    and line-mode polygons) the determination is made by examining the sign
2685bd8deadSopenharmony_ci    of the area computed by equation 2.6 of section 2.13.1 (including the
2695bd8deadSopenharmony_ci    possible reversal of this sign as indicated by the last call to
2705bd8deadSopenharmony_ci    FrontFace). If the sign is positive then the fragments are front facing;
2715bd8deadSopenharmony_ci    otherwise, they are back facing.
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ci    ARB_vertex_shader has an enable called VERTEX_PROGRAM_TWO_SIDE_ARB. If
2745bd8deadSopenharmony_ci    false, the front color is always selected. However, this enable does not
2755bd8deadSopenharmony_ci    apply to the front or back facing determination of a fragment. The value
2765bd8deadSopenharmony_ci    of VERTEX_PROGRAM_TWO_SIDE_ARB does not affect the value of
2775bd8deadSopenharmony_ci    gl_FrontFacing. Thus you can have the following situation:
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci      * VERTEX_PROGRAM_TWO_SIDE_ARB = FALSE. Which forces the front color to
2805bd8deadSopenharmony_ci        always be selected. Thus gl_Color and gl_SecondaryColor (read-only
2815bd8deadSopenharmony_ci        accessible in the fragment shader) have the values of the varyings
2825bd8deadSopenharmony_ci        gl_FrontColor and gl_FrontSecondaryColor (written by the vertex
2835bd8deadSopenharmony_ci        shader).
2845bd8deadSopenharmony_ci      * The primitive is a polygon and is determined to be back-facing.
2855bd8deadSopenharmony_ci        gl_FrontFacing therefore = FALSE.
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci    RESOLUTION: Depending on the primitive type it is either always front
2885bd8deadSopenharmony_ci    facing, or it is determined by he sign of the polygon's area computed in
2895bd8deadSopenharmony_ci    window coordinates.
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci    9) OpenGL provides a hierarchy of texture enables (cube map, 3D, 2D,
2925bd8deadSopenharmony_ci       1D). Should samplers override that hierarchy and select specific
2935bd8deadSopenharmony_ci       texture targets?
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    DISCUSSION: How samplers work is explained in issue 25 of the
2965bd8deadSopenharmony_ci    ARB_shader_objects specification.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    RESOLUTION: Yes. This removes a potential pitfall for developers:
2995bd8deadSopenharmony_ci    Leaving the hierarchy of enables in an undesired state. It makes shaders
3005bd8deadSopenharmony_ci    more readable as the intent of the code is more obvious. It allows
3015bd8deadSopenharmony_ci    compilers to be more aggressive as to which texture coordinate
3025bd8deadSopenharmony_ci    components are "don't cares" without having to recompile programs when
3035bd8deadSopenharmony_ci    fixed-function texture enables change.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    Note that the ARB_shader_objects specification states that it is not
3065bd8deadSopenharmony_ci    allowed to have samplers of different types point to the same texture
3075bd8deadSopenharmony_ci    image unit. For example, it is not possible to request a 2D and a 3D
3085bd8deadSopenharmony_ci    texture lookup using the same texture image unit within a program
3095bd8deadSopenharmony_ci    object.
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci    10) Is Depth Offset applied to the window z value before it enters the
3125bd8deadSopenharmony_ci        fragment shader?
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci    DISCUSSION: Depth Offset (polygon offset) is discussed in section 3.5.5
3155bd8deadSopenharmony_ci    of the GL 1.4 spec. Depth offset is considered part of the rasterization
3165bd8deadSopenharmony_ci    stage, which happens prior to processing of a fragment shader.
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    RESOLUTION: As in the base OpenGL specification, the depth offset
3195bd8deadSopenharmony_ci    generated by polygon offset is added during polygon rasterization. The
3205bd8deadSopenharmony_ci    depth value provided to shaders in the built-in gl_FragCoord.z already
3215bd8deadSopenharmony_ci    includes polygon offset, if enabled. If the depth value is replaced by a
3225bd8deadSopenharmony_ci    fragment shader, the polygon offset value will NOT be recomputed and
3235bd8deadSopenharmony_ci    added back after shader execution.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    NOTE: This is probably not desirable for fragment shaders that modify
3265bd8deadSopenharmony_ci    depth values since the partials used to generate the offset may not
3275bd8deadSopenharmony_ci    match the partials of the computed depth value.
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    11) Should gl_FragColor be aliased to gl_FragData[0]?
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    RESOLUTION: No. A shader should write either gl_FragColor, or
3325bd8deadSopenharmony_ci    gl_FragData[n], but not both.
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci    12) Should gl_FragData[n] be clamped?
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    RESOLUTION: gl_FragData[] is basically an array of colors. The values in
3375bd8deadSopenharmony_ci    this array might or might not be actual color data, just as is true for
3385bd8deadSopenharmony_ci    the output variable gl_FragColor. The data assigned to gl_FragData[n]
3395bd8deadSopenharmony_ci    will be clamped to [0,1]. This restriction can be lifted by a separate
3405bd8deadSopenharmony_ci    extension, for example by the proposed color_clamp_control extension.
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    13) What texture operations are not affected by a fragment shader
3435bd8deadSopenharmony_ci        performing a texture lookup?
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    RESOLUTION: Whether or not a fragment shader is active, the following
3465bd8deadSopenharmony_ci    operations still behave as specified:
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci      * texture image specification (pp. 119-128)
3495bd8deadSopenharmony_ci      * alternate texture image specification (pp. 128-132)
3505bd8deadSopenharmony_ci      * compressed texture image specification (pp. 132-135)
3515bd8deadSopenharmony_ci      * texture parameters behave as specified even when a texture is
3525bd8deadSopenharmony_ci        accessed from within a fragment shader (pp. 135-147)
3535bd8deadSopenharmony_ci      * texture state and proxy state (pp. 148-149)
3545bd8deadSopenharmony_ci      * texture object specification (pp. 149-152)
3555bd8deadSopenharmony_ci      * texture comparison modes (p. 157)
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    14) What is the interaction with a possible MRT (Multiple Render Target)
3585bd8deadSopenharmony_ci        extension?
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    The OpenGL Shading Language defines the array gl_FragData[] to output
3615bd8deadSopenharmony_ci    values to multiple buffers. There are two situations to consider.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci      1) There is no MRT extension support. A shader can statically assign a
3645bd8deadSopenharmony_ci         value to either gl_FragColor or gl_FragData[0] (but not both).
3655bd8deadSopenharmony_ci         Either way the same buffer will be targeted.
3665bd8deadSopenharmony_ci      2) There is MRT support. In this case what happens is defined in the
3675bd8deadSopenharmony_ci         relevant MRT extension documentation.
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ciNew Procedures and Functions
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    None
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ciNew Tokens
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci    Accepted by the <shaderType> argument of CreateShaderObjectARB and
3765bd8deadSopenharmony_ci    returned by the <params> parameter of GetObjectParameter{fi}vARB:
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci        FRAGMENT_SHADER_ARB                             0x8B30
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
3815bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci        MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB             0x8B49
3845bd8deadSopenharmony_ci        MAX_TEXTURE_COORDS_ARB                          0x8871
3855bd8deadSopenharmony_ci        MAX_TEXTURE_IMAGE_UNITS_ARB                     0x8872
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci    Accepted by the <target> parameter of Hint and the <pname> parameter of
3885bd8deadSopenharmony_ci    GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci        FRAGMENT_SHADER_DERIVATIVE_HINT_ARB             0x8B8B
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci    Modify Section 2.1.1, Floating-Point Computation (p. 6)
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    (modify first paragraph, p. 6) ... are accurate to about 1 part in 10^5.
3975bd8deadSopenharmony_ci    The maximum representable magnitude of a floating-point number used to
3985bd8deadSopenharmony_ci    represent positional, normal or texture coordinates must be at least
3995bd8deadSopenharmony_ci    2^32. The maximum representable magnitude for colors must be at least
4005bd8deadSopenharmony_ci    2^10. The maximum representable magnitude for all other floating-point
4015bd8deadSopenharmony_ci    values must be at least 2^32.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    Modify Section 2.7, Vertex Specification (p. 19)
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    (modify second paragraph, p. 20) Implementations support more than one
4065bd8deadSopenharmony_ci    set of texture coordinates. The commands
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci        void MultiTexCoord{1234}{sifd}(enum texture, T coords)
4095bd8deadSopenharmony_ci        void MultiTexCoord{1234}{sifd}v(enum texture, T coords)
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    take the coordinate set to be modified as the <texture> parameter.
4125bd8deadSopenharmony_ci    <texture> is a symbolic constant of the form TEXTUREi, indicating that
4135bd8deadSopenharmony_ci    texture coordinate set i is to be modified. The constants obey TEXTUREi
4145bd8deadSopenharmony_ci    = TEXTURE0 + i (i is in the range 0 to k-1, where k is the
4155bd8deadSopenharmony_ci    implementation-dependent number of texture units defined by
4165bd8deadSopenharmony_ci    MAX_TEXTURE_COORDS_ARB).
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    Modify Section 2.8, Vertex Arrays (p. 23)
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    (modify first paragraph, p. 23) ... The client may specify up to 7 plus
4215bd8deadSopenharmony_ci    the value of MAX_TEXTURE_COORDS_ARB arrays: one each to store vertex
4225bd8deadSopenharmony_ci    coordinates...
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci    (modify first paragraph, p. 25) The command
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci        void ClientActiveTexture(enum texture)
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    is used to select the vertex array client state parameters to be
4295bd8deadSopenharmony_ci    modified by the TexCoordPointer command and the array affected by
4305bd8deadSopenharmony_ci    EnableClientState and DisableClientState with parameter
4315bd8deadSopenharmony_ci    TEXTURE_COORD_ARRAY. This command sets the client state variable
4325bd8deadSopenharmony_ci    CLIENT_ACTIVE_TEXTURE. Each texture coordinate set has a client state
4335bd8deadSopenharmony_ci    vector which is selected when this command is invoked. This state vector
4345bd8deadSopenharmony_ci    includes the vertex array state. This call also selects the texture
4355bd8deadSopenharmony_ci    coordinate set state used for queries of client state.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci    (modify first paragraph, p. 30) If the number of supported texture
4395bd8deadSopenharmony_ci    coordinate sets (the value of MAX_TEXTURE_COORDS_ARB) is k, ...
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    Modify Section 2.10.2, Matrices (p. 33)
4425bd8deadSopenharmony_ci
4435bd8deadSopenharmony_ci    (modify first paragraph, p. 37) For each texture coordinate set, a 4x4
4445bd8deadSopenharmony_ci    matrix is applied to the corresponding texture coordinates. This matrix
4455bd8deadSopenharmony_ci    is applied as...
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    (modify third and fourth paragraphs, p. 37) The command
4485bd8deadSopenharmony_ci
4495bd8deadSopenharmony_ci        void ActiveTexture(enum texture)
4505bd8deadSopenharmony_ci
4515bd8deadSopenharmony_ci    specifies the active texture unit selector, ACTIVE_TEXTURE. Each texture
4525bd8deadSopenharmony_ci    unit contains up to two distinct sub-units: a texture coordinate
4535bd8deadSopenharmony_ci    processing unit (consisting of a texture matrix stack and texture
4545bd8deadSopenharmony_ci    coordinate generation state) and a texture image unit (consisting of all
4555bd8deadSopenharmony_ci    the texture state defined in Section 3.8). In implementations with a
4565bd8deadSopenharmony_ci    different number of supported texture coordinate sets and texture image
4575bd8deadSopenharmony_ci    units, some texture units may consist of only one of the two sub-units.
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci    The active texture unit selector specifies the texture coordinate set
4605bd8deadSopenharmony_ci    accessed by commands involving texture coordinate processing. Such
4615bd8deadSopenharmony_ci    commands include those accessing the current matrix stack (if
4625bd8deadSopenharmony_ci    MATRIX_MODE is TEXTURE), TexGen (section 2.10.4), Enable/Disable (if any
4635bd8deadSopenharmony_ci    texture coordinate generation enum is selected), as well as queries of
4645bd8deadSopenharmony_ci    the current texture coordinates and current raster texture coordinates.
4655bd8deadSopenharmony_ci    If the texture coordinate set number corresponding to the current value
4665bd8deadSopenharmony_ci    of ACTIVE_TEXTURE is greater than or equal to the
4675bd8deadSopenharmony_ci    implementation-dependent constant MAX_TEXTURE_COORDS_ARB, the error
4685bd8deadSopenharmony_ci    INVALID_OPERATION is generated by any such command.
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ci    The active texture unit selector also selects the texture image unit
4715bd8deadSopenharmony_ci    accessed by commands involving texture image processing (section 3.8).
4725bd8deadSopenharmony_ci    Such commands include all variants of TexEnv, TexParameter, and TexImage
4735bd8deadSopenharmony_ci    commands, BindTexture, Enable/Disable for any texture target (e.g.,
4745bd8deadSopenharmony_ci    TEXTURE_2D), and queries of all such state. If the texture image unit
4755bd8deadSopenharmony_ci    number corresponding to the current value of ACTIVE_TEXTURE is greater
4765bd8deadSopenharmony_ci    than or equal to the implementation-dependent constant
4775bd8deadSopenharmony_ci    MAX_TEXTURE_IMAGE_UNITS_ARB, the error INVALID_OPERATION is generated by
4785bd8deadSopenharmony_ci    any such command.
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci    ActiveTexture generates the error INVALID_ENUM if an invalid <texture>
4815bd8deadSopenharmony_ci    is specified. <texture> is a symbolic constant of the form TEXTUREi,
4825bd8deadSopenharmony_ci    indicating that texture unit i is to be modified. The constants obey
4835bd8deadSopenharmony_ci    TEXTUREi = TEXTURE0 + i (i is in the range 0 to k-1, where k is the
4845bd8deadSopenharmony_ci    larger of the MAX_TEXTURE_COORDS_ARB and MAX_TEXTURE_IMAGE_UNITS_ARB).
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci    For compatibility with old OpenGL specifications, the
4875bd8deadSopenharmony_ci    implementation-dependent constant MAX_TEXTURE_UNITS specifies the number
4885bd8deadSopenharmony_ci    of conventional texture units supported by the implementation. Its value
4895bd8deadSopenharmony_ci    must be no larger than the minimum of MAX_TEXTURE_COORDS_ARB and
4905bd8deadSopenharmony_ci    MAX_TEXTURE_IMAGE_UNITS_ARB.
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci    (modify third paragraph, p. 38) The state required to implement
4935bd8deadSopenharmony_ci    transformations consists of a 4-valued integer indicating the current
4945bd8deadSopenharmony_ci    matrix mode, one stack of at least two 4x4 matrices for each of COLOR,
4955bd8deadSopenharmony_ci    PROJECTION, each texture coordinate set, and TEXTURE and a stack of at
4965bd8deadSopenharmony_ci    least 32 4x4 matrices for MODELVIEW. Each matrix stack has an associated
4975bd8deadSopenharmony_ci    stack pointer. Initially, there is only one matrix on each stack, and
4985bd8deadSopenharmony_ci    all matrices are set to the identity. The initial matrix mode is
4995bd8deadSopenharmony_ci    MODELVIEW. The initial value of ACTIVE_TEXTURE is TEXTURE0.
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    (Modify first paragraph, p. 61)... Figure 3.1 diagrams the rasterization
5045bd8deadSopenharmony_ci    process. The color value assigned to a fragment is initially determined
5055bd8deadSopenharmony_ci    by the rasterization operations (sections 3.3 through 3.7) and modified
5065bd8deadSopenharmony_ci    by either the execution of the texturing, color sum, and fog operations
5075bd8deadSopenharmony_ci    as defined in sections 3.8, 3.9, and 3.10, or of a fragment shader
5085bd8deadSopenharmony_ci    defined in section 3.11. The final depth value is initially determined
5095bd8deadSopenharmony_ci    by the rasterization operations and may be modified or replaced by a
5105bd8deadSopenharmony_ci    fragment shader. The results from rasterizing a point, line, polygon,
5115bd8deadSopenharmony_ci    pixel rectangle or bitmap can be routed through a fragment shader.
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci    (modify Figure 3.1)
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci                     _ +---------------+      switch depending on a
5175bd8deadSopenharmony_ci                     /||    Point      |\     fragment shader being active
5185bd8deadSopenharmony_ci                    /  | Rasterization | \              o-------------+
5195bd8deadSopenharmony_ci                   /   +---------------+ -++-++--->o                  |
5205bd8deadSopenharmony_ci           From   /    +---------------+ / | ||         o             |
5215bd8deadSopenharmony_ci        Primitive ---> |     Line      |/  | ||         |             |
5225bd8deadSopenharmony_ci         Assembly \    | Rasterization |  /  ||         |             |
5235bd8deadSopenharmony_ci                   \   +---------------+ /   ||         |             |
5245bd8deadSopenharmony_ci                    \  +---------------+/    ||   +-----+-----+  +----+-----+
5255bd8deadSopenharmony_ci                     \||    Polygon    |     ||   | Texturing |  | Fragment |
5265bd8deadSopenharmony_ci                     - | Rasterization |    / |   +-----+-----+  | Shader   |
5275bd8deadSopenharmony_ci                       +---------------+   /  |         |        +----+-----+
5285bd8deadSopenharmony_ci                       +---------------+  /   |   +-----+-----+       |
5295bd8deadSopenharmony_ci                       |     Pixel     | /    |   | Color Sum |       |
5305bd8deadSopenharmony_ci        DrawPixels --> |   Rectangle   |/    /    +-----+-----+       |
5315bd8deadSopenharmony_ci                       | Rasterization |    /           |             V
5325bd8deadSopenharmony_ci                       +---------------+   /      +-----+-----+
5335bd8deadSopenharmony_ci                       +---------------+  /       |    Fog    |---> Fragments
5345bd8deadSopenharmony_ci          Bitmap ----> |    Bitmap     | /        +-----------+
5355bd8deadSopenharmony_ci                       | Rasterization |/
5365bd8deadSopenharmony_ci                       +---------------+
5375bd8deadSopenharmony_ci
5385bd8deadSopenharmony_ci    Modify Section 3.3.1, Basic Point Rasterization (p. 67)
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci    (modify last paragraph, p. 67) All fragments produced in rasterizing a
5415bd8deadSopenharmony_ci    non-antialiased point are assigned the same associated data, which are
5425bd8deadSopenharmony_ci    those of the vertex corresponding to the point. If a fragment shader is
5435bd8deadSopenharmony_ci    active (see section 3.11) the texture coordinates s, t, r, and q are
5445bd8deadSopenharmony_ci    passed on directly. Otherwise, the texture coordinates s, t, and r are
5455bd8deadSopenharmony_ci    replaced by s/q, t/q, and r/q, respectively, and if q is less than or
5465bd8deadSopenharmony_ci    equal to zero, the results are undefined.
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ci    (modify second paragraph p. 68) If antialiasing is enabled, then point
5495bd8deadSopenharmony_ci    rasterization produces a fragment for each fragment square that
5505bd8deadSopenharmony_ci    intersects the region lying within the circle having diameter equal to
5515bd8deadSopenharmony_ci    the current point width and centered at the point's (Xw, Yw) (figure
5525bd8deadSopenharmony_ci    3.3). The coverage value for each fragment in the window coordinate area
5535bd8deadSopenharmony_ci    of the intersection of the circular region with the corresponding
5545bd8deadSopenharmony_ci    fragment square (but see section 3.2). This value is saved and used in
5555bd8deadSopenharmony_ci    the final step of rasterization (section 3.12). The data associated with
5565bd8deadSopenharmony_ci    each fragment are otherwise the data associated with the point being
5575bd8deadSopenharmony_ci    rasterized, with the exception of the texture coordinates. If a fragment
5585bd8deadSopenharmony_ci    shader is active, texture coordinates s, t, r, and q are passed on
5595bd8deadSopenharmony_ci    directly. Otherwise, the texture coordinates s, t, and r are replaced by
5605bd8deadSopenharmony_ci    s/q, t/q, and r/q, respectively, and if q is less than or equal to zero,
5615bd8deadSopenharmony_ci    the results are undefined.
5625bd8deadSopenharmony_ci
5635bd8deadSopenharmony_ci    Modify Section 3.4.1, Basic Line Segment Rasterization (p. 71)
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci    (modify last paragraph, p. 72) ... or the s, t, r, or q texture
5665bd8deadSopenharmony_ci    coordinate or the clip w coordinate (the depth value, window z, must be
5675bd8deadSopenharmony_ci    found using equation 3.5, below), is found as
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci       (Equation 3.4)
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci    where fa and fb are the data associated with the starting and ending
5725bd8deadSopenharmony_ci    endpoints of the segment, respectively; wa and wb are the clip w
5735bd8deadSopenharmony_ci    coordinates of the starting and ending endpoints of the segments,
5745bd8deadSopenharmony_ci    respectively. When there is no fragment shader active (see section
5755bd8deadSopenharmony_ci    3.11), alpha a = alpha b = 1 for all data except texture coordinates, in
5765bd8deadSopenharmony_ci    which case alpha a = qa and alpha b = qb (qa and qb are the homogeneous
5775bd8deadSopenharmony_ci    texture coordinates at the starting and ending endpoints of the segment;
5785bd8deadSopenharmony_ci    results are undefined if either of these is less than or equal to 0).
5795bd8deadSopenharmony_ci    When a fragment shader is active, alpha a = alpha b = 1 for all
5805bd8deadSopenharmony_ci    components (i.e., q is interpolated along with s, t, and r). Note that
5815bd8deadSopenharmony_ci    linear interpolation would use ...
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci    ... A GL implementation may choose to approximate equation 3.4 with 3.5,
5845bd8deadSopenharmony_ci    but this will normally lead to unacceptable distortion effects when
5855bd8deadSopenharmony_ci    interpolating texture coordinates or clip w coordinates.
5865bd8deadSopenharmony_ci
5875bd8deadSopenharmony_ci    Modify Section 3.5.1, Basic Polygon Rasterization (p. 77)
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci    (modify fourth paragraph, p. 78) ... When no fragment shader is active
5905bd8deadSopenharmony_ci    (section 3.11), alpha a = alpha b = alpha c = 1 except for texture s, t,
5915bd8deadSopenharmony_ci    and r coordinates, for which alpha a = qa, alpha b = qb, and alpha c =
5925bd8deadSopenharmony_ci    qc (if any of qa, qb, or qc are less than or equal to zero, results are
5935bd8deadSopenharmony_ci    undefined). When a fragment shader is active, alpha a = alpha b = alpha
5945bd8deadSopenharmony_ci    c = 1 for all components (i.e., q is interpolated along with s, t, and
5955bd8deadSopenharmony_ci    r). ...
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci    (modify first paragraph p. 79) this may yield acceptable results for
5985bd8deadSopenharmony_ci    color values (it must be used for depth values), but will normally lead
5995bd8deadSopenharmony_ci    to unacceptable distortion effects if used for texture coordinates or
6005bd8deadSopenharmony_ci    clip w coordinates.
6015bd8deadSopenharmony_ci
6025bd8deadSopenharmony_ci    Modify Section 3.6.4, Rasterization of Pixel Rectangles (p. 95)
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci    (modify third paragraph, p. 106) A fragment arising from a group
6055bd8deadSopenharmony_ci    consisting of color data ...,and texture coordinates are taken from the
6065bd8deadSopenharmony_ci    current raster position's associated texture coordinates. If a fragment
6075bd8deadSopenharmony_ci    shader is active (see section 3.11) the texture coordinates s, t, r, and
6085bd8deadSopenharmony_ci    q are passed on directly. Otherwise, the texture coordinates s, t, and r
6095bd8deadSopenharmony_ci    are replaced by s/q, t/q, and r/q, respectively, and if q is less than
6105bd8deadSopenharmony_ci    or equal to zero, the results are undefined. Groups arising from
6115bd8deadSopenharmony_ci    DrawPixels ...
6125bd8deadSopenharmony_ci
6135bd8deadSopenharmony_ci    Modify Section 3.7, Bitmaps (p. 116)
6145bd8deadSopenharmony_ci
6155bd8deadSopenharmony_ci    (modify first paragraph, p. 118) ...The associated data for each
6165bd8deadSopenharmony_ci    fragment are those associated with the current raster position. If a
6175bd8deadSopenharmony_ci    fragment shader is active (see section 3.11) the texture coordinates s,
6185bd8deadSopenharmony_ci    t, r, and q are passed on directly. Otherwise, the texture coordinates
6195bd8deadSopenharmony_ci    s, t, and r are replaced by s/q, t/q, and r/q, respectively, and if q is
6205bd8deadSopenharmony_ci    less than or equal to zero, the results are undefined. Once the
6215bd8deadSopenharmony_ci    fragments have been produced,...
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci    Modify Section 3.8, Texturing (p. 118)
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ci    (change the first full paragraph on p. 119) The GL provides two ways to
6265bd8deadSopenharmony_ci    specify the details of how texturing of a primitive is effected. The
6275bd8deadSopenharmony_ci    first is referred to as fixed functionality, and is described in this
6285bd8deadSopenharmony_ci    section. The second is referred to as a fragment shader, and is
6295bd8deadSopenharmony_ci    described in section 3.11. The specification of the image to be texture
6305bd8deadSopenharmony_ci    mapped and the means by which the image is filtered when applied to the
6315bd8deadSopenharmony_ci    primitive are common to both methods and are discussed in this section.
6325bd8deadSopenharmony_ci    The fixed functionality method for determining what RGBA value is
6335bd8deadSopenharmony_ci    produced is also described in this section. If a fragment shader is
6345bd8deadSopenharmony_ci    active, the method for determining the RGBA value is specified by an
6355bd8deadSopenharmony_ci    application-supplied fragment shader as described in the OpenGL Shading
6365bd8deadSopenharmony_ci    Language Specification.
6375bd8deadSopenharmony_ci
6385bd8deadSopenharmony_ci    Modify Section 3.8.8, Texture Minification (p. 140)
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci    (change the first paragraph of the "Scale Factor and Level of Detail"
6415bd8deadSopenharmony_ci    section)
6425bd8deadSopenharmony_ci
6435bd8deadSopenharmony_ci    The choice is governed by a scale factor rho(x,y) and the level of
6445bd8deadSopenharmony_ci    detail parameter lambda(x,y), defined as
6455bd8deadSopenharmony_ci
6465bd8deadSopenharmony_ci    lambda_base(x,y) = log2[rho(x,y)]                                  3.16a
6475bd8deadSopenharmony_ci
6485bd8deadSopenharmony_ci    lambda'(x,y) = lambda_base(x,y) +                                  3.16b
6495bd8deadSopenharmony_ci                   clamp(texobj_bias + texunit_bias + fragshader_bias)
6505bd8deadSopenharmony_ci
6515bd8deadSopenharmony_ci                  |------- lod_max    lambda' > lod_max
6525bd8deadSopenharmony_ci    lambda(x,y) = |        lambda'    lod_min <= lambda' <= lod_max    3.16c
6535bd8deadSopenharmony_ci                  |        lod_min    lambda' < lod_min
6545bd8deadSopenharmony_ci                  |------- undefined  lod_min > lod_max
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci    texobj_bias is the value of TEXTURE_LOD_BIAS for the bound texture
6575bd8deadSopenharmony_ci    object (as described in section 3.8.4), and texunit_bias is the value of
6585bd8deadSopenharmony_ci    TEXTURE_LOD_BIAS for the current texture unit (as described in section
6595bd8deadSopenharmony_ci    3.8.13). fragshader_bias is the value of the optional bias parameter in
6605bd8deadSopenharmony_ci    the texture lookup functions available to a fragment shader. If a
6615bd8deadSopenharmony_ci    fragment shader is active, but the bias parameter is not provided, or if
6625bd8deadSopenharmony_ci    no fragment shader is active, then fragshader_bias is zero. The sum of
6635bd8deadSopenharmony_ci    these values is clamped to the range [-max_bias, max_bias] where
6645bd8deadSopenharmony_ci    max_bias is the value of the implementation defined constant
6655bd8deadSopenharmony_ci    MAX_TEXTURE_LOD_BIAS.
6665bd8deadSopenharmony_ci
6675bd8deadSopenharmony_ci    Modify Section 3.8.15, Texture Application (p. 158)
6685bd8deadSopenharmony_ci
6695bd8deadSopenharmony_ci    (modify fifth paragraph, p. 158) Texturing is enabled and disabled
6705bd8deadSopenharmony_ci    individually for each texture unit. If texturing is disabled for one of
6715bd8deadSopenharmony_ci    the units, then the fragment resulting from the previous unit is passed
6725bd8deadSopenharmony_ci    unaltered to the following unit. Individual texture units beyond those
6735bd8deadSopenharmony_ci    specified by MAX_TEXTURE_UNITS are always treated as disabled.
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci    Modify Section 3.9, Color Sum (p. 160)
6765bd8deadSopenharmony_ci
6775bd8deadSopenharmony_ci    (add a new sentence before first paragraph, p. 160) If no fragment
6785bd8deadSopenharmony_ci    shader is active (see Section 3.11), a color sum operation is performed
6795bd8deadSopenharmony_ci    involving the primary and secondary colors.
6805bd8deadSopenharmony_ci
6815bd8deadSopenharmony_ci    (change the last sentence of the section, p. 160) Color sum has no
6825bd8deadSopenharmony_ci    effect in color index mode or if a fragment shader is active.
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci    Modify Section 3.10, Fog (p. 160)
6855bd8deadSopenharmony_ci
6865bd8deadSopenharmony_ci    (Change the first sentence, p. 160) If no fragment shader is active (see
6875bd8deadSopenharmony_ci    Section 3.11) and fog is enabled, an operation is performed that blends
6885bd8deadSopenharmony_ci    a fog color with a rasterized fragment's ....
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci    Modify Section 3.11, Antialiasing Application
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ci    Rename this section to Section 3.12.
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ci    Add Section 3.11, Fragment Shaders
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci    The sequence of operations that are applied to fragments that result
6975bd8deadSopenharmony_ci    from rasterizing a point, line segment, polygon, pixel rectangle or
6985bd8deadSopenharmony_ci    bitmap as described in Sections 3.8 through 3.10 is a
6995bd8deadSopenharmony_ci    fixed-functionality method for processing such fragments. Applications
7005bd8deadSopenharmony_ci    can more generally describe the operations that occur on such fragments
7015bd8deadSopenharmony_ci    by using a "fragment shader".
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci    A fragment shader is an array of strings containing source code for the
7045bd8deadSopenharmony_ci    operations that are meant to occur on each fragment that results from
7055bd8deadSopenharmony_ci    rasterizing a point, line segment, polygon, pixel rectangle or bitmap.
7065bd8deadSopenharmony_ci    The language used for fragment shaders is described in the OpenGL
7075bd8deadSopenharmony_ci    Shading Language Specification.
7085bd8deadSopenharmony_ci
7095bd8deadSopenharmony_ci    A fragment shader only applies when the GL is in RGBA mode. Its
7105bd8deadSopenharmony_ci    operation in color index mode is undefined.
7115bd8deadSopenharmony_ci
7125bd8deadSopenharmony_ci    Section 3.11.1 Creating and Using a Fragment Shader
7135bd8deadSopenharmony_ci
7145bd8deadSopenharmony_ci    In order to create a fragment shader, call CreateShaderObjectARB with a
7155bd8deadSopenharmony_ci    <shaderType> of FRAGMENT_SHADER_ARB. The source code for the fragment
7165bd8deadSopenharmony_ci    shader can be specified using the ShaderSourceARB command. A fragment
7175bd8deadSopenharmony_ci    shader is compiled by calling CompileShaderARB and attached to a program
7185bd8deadSopenharmony_ci    object by calling AttachObjectARB. When LinkProgramARB is issued, all of
7195bd8deadSopenharmony_ci    the attached shader objects of type FRAGMENT_SHADER_ARB are linked
7205bd8deadSopenharmony_ci    together to create an executable program that can be used to process
7215bd8deadSopenharmony_ci    fragments that arise from rasterizing points, line segments, polygons,
7225bd8deadSopenharmony_ci    pixel rectangles or bitmpas. This executable program will become part of
7235bd8deadSopenharmony_ci    current state when UseProgramObjectARB is issued.
7245bd8deadSopenharmony_ci
7255bd8deadSopenharmony_ci    CreateShaderObjectARB will set the object specific parameter
7265bd8deadSopenharmony_ci    OBJECT_SUBTYPE_ARB to FRAGMENT_SHADER_ARB.
7275bd8deadSopenharmony_ci
7285bd8deadSopenharmony_ci    Section 3.11.2 Uniform Variables
7295bd8deadSopenharmony_ci
7305bd8deadSopenharmony_ci    A fragment shader may define one or more "uniform" variables. These
7315bd8deadSopenharmony_ci    values are expected to remain constant over a primitive or a sequence of
7325bd8deadSopenharmony_ci    primitives. The OpenGL Shading Language Specification defines a set of
7335bd8deadSopenharmony_ci    built-in uniform variables for fragment shaders that correspond to the
7345bd8deadSopenharmony_ci    state that GL manages for the purpose of processing fragments that are
7355bd8deadSopenharmony_ci    generated by the rasterization of points, line segments, and polygons.
7365bd8deadSopenharmony_ci    The amount of storage that is available for fragment shader uniform
7375bd8deadSopenharmony_ci    variables is specified by the implementation dependent constant
7385bd8deadSopenharmony_ci    MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB. This value represents the number of
7395bd8deadSopenharmony_ci    individual floating point values, or individual integer values, or
7405bd8deadSopenharmony_ci    individual Boolean values that can be held in uniform variable storage
7415bd8deadSopenharmony_ci    for a fragment shader. A link error will be generated if an attempt is
7425bd8deadSopenharmony_ci    made to utilize more than the space available for fragment shader
7435bd8deadSopenharmony_ci    uniform variables.
7445bd8deadSopenharmony_ci
7455bd8deadSopenharmony_ci    Section 3.11.3 Varying Variables
7465bd8deadSopenharmony_ci
7475bd8deadSopenharmony_ci    A fragment shader consumes the data produced as a result of the
7485bd8deadSopenharmony_ci    rasterization of points, line segments, polygons, pixel rectangles or
7495bd8deadSopenharmony_ci    bitmaps. If no vertex shader is active, the data that is available to
7505bd8deadSopenharmony_ci    the fragment shader at each fragment consists of the same types of data
7515bd8deadSopenharmony_ci    that are normally associated with a fragment for fixed functionality
7525bd8deadSopenharmony_ci    fragment processing, namely, the fragment's coordinate, color, secondary
7535bd8deadSopenharmony_ci    color, texture coordinates, fog coordinate, and eyeZ. The OpenGL Shading
7545bd8deadSopenharmony_ci    Language Specification defines a set of built-in varying variables that
7555bd8deadSopenharmony_ci    can be used to access these values within a fragment shader.
7565bd8deadSopenharmony_ci
7575bd8deadSopenharmony_ci    When a vertex shader is active, it may define one or more "varying"
7585bd8deadSopenharmony_ci    variables (see Section 2.15.4 and the OpenGL Shading Language
7595bd8deadSopenharmony_ci    Specification). These values are expected to be interpolated across the
7605bd8deadSopenharmony_ci    primitive being rendered. The results of these interpolations are
7615bd8deadSopenharmony_ci    available within a fragment shader through varying variables that are
7625bd8deadSopenharmony_ci    defined as varying variables in the fragment shader with the same names
7635bd8deadSopenharmony_ci    as those defined in the vertex shader.
7645bd8deadSopenharmony_ci
7655bd8deadSopenharmony_ci    Section 3.11.4 Fragment Shader Execution Environment
7665bd8deadSopenharmony_ci
7675bd8deadSopenharmony_ci    If a fragment shader is active, the executable version of the fragment
7685bd8deadSopenharmony_ci    shader is used to process incoming fragment values that are the result
7695bd8deadSopenharmony_ci    of point, line segment, polygon, pixel rectangle or bitmap rasterization
7705bd8deadSopenharmony_ci    rather than the fixed functionality fragment processing described in
7715bd8deadSopenharmony_ci    Sections 3.8-3.10. In particular,
7725bd8deadSopenharmony_ci
7735bd8deadSopenharmony_ci      * the texture environments and texture functions described in Section
7745bd8deadSopenharmony_ci        3.8.13 are not applied (pp. 152-157)
7755bd8deadSopenharmony_ci      * texture application as described in Section 3.8.15 is not applied.
7765bd8deadSopenharmony_ci        (pp. 158- 160)
7775bd8deadSopenharmony_ci      * color sum as described in Section 3.9 is not applied (p. 160)
7785bd8deadSopenharmony_ci      * fog as described in Section 3.10 is not applied (p. 160-162)
7795bd8deadSopenharmony_ci
7805bd8deadSopenharmony_ci    When a texture lookup is performed in a fragment shader, the GL computes
7815bd8deadSopenharmony_ci    the filtered texture value ? in the manner described in sections 3.8.8
7825bd8deadSopenharmony_ci    and 3.8.9, and converts it to a texture source color C_s according to
7835bd8deadSopenharmony_ci    table 3.21 (section 3.8.13). The GL returns a four-component vector
7845bd8deadSopenharmony_ci    (R_s, G_s, B_s, A_s) to the fragment shader. For the purposes of
7855bd8deadSopenharmony_ci    level-of-detail calculations, the derivates du/dx, du/dy, dv/dx, dv/dy,
7865bd8deadSopenharmony_ci    dw/dx and dw/dy may be approximated by a differencing algorithm as
7875bd8deadSopenharmony_ci    detailed in section 8.8 of the OpenGL Shading Language specification.
7885bd8deadSopenharmony_ci
7895bd8deadSopenharmony_ci    Texture comparison requires the fragment shader to use the shadow
7905bd8deadSopenharmony_ci    versions of the texture lookup functions. This in turn means that
7915bd8deadSopenharmony_ci    samplers of type sampler1DShadow or sampler2DShadow or
7925bd8deadSopenharmony_ci    sampler2DRectShadow need to be used to indicate the texture image unit
7935bd8deadSopenharmony_ci    that has a depth texture bound to it.
7945bd8deadSopenharmony_ci
7955bd8deadSopenharmony_ci    The results of a texture lookup function are undefined if:
7965bd8deadSopenharmony_ci
7975bd8deadSopenharmony_ci      * The sampler used in a texture lookup function is of type sampler1D
7985bd8deadSopenharmony_ci        or sampler2D or sampler2DRect, and the texture object's internal
7995bd8deadSopenharmony_ci        format is DEPTH_COMPONENT, and the TEXTURE_COMPARE_MODE is not NONE.
8005bd8deadSopenharmony_ci      * The sampler used in a texture lookup function is of type
8015bd8deadSopenharmony_ci        sampler1DShadow or sampler2DShadow or sampler2DRectShadow, and the
8025bd8deadSopenharmony_ci        texture object's internal format is DEPTH_COMPONENT, and the
8035bd8deadSopenharmony_ci        TEXTURE_COMPARE_MODE is NONE.
8045bd8deadSopenharmony_ci      * The sampler used in a texture lookup function is of type
8055bd8deadSopenharmony_ci        sampler1DShadow or sampler2DShadow or sampler2DRectShadow, and the
8065bd8deadSopenharmony_ci        texture object's internal format is not DEPTH_COMPONENT_ARB.
8075bd8deadSopenharmony_ci
8085bd8deadSopenharmony_ci    If a fragment shader uses a sampler which associated texture object is
8095bd8deadSopenharmony_ci    not complete, as defined in section 3.8.10, the texture image unit will
8105bd8deadSopenharmony_ci    return (R, G, B, A) = (0, 0, 0, 1).
8115bd8deadSopenharmony_ci
8125bd8deadSopenharmony_ci    The number of separate texture units that can be accessed from within a
8135bd8deadSopenharmony_ci    fragment shader during the rendering of a single primitive is specified
8145bd8deadSopenharmony_ci    by the implementation- dependent constant MAX_TEXTURE_IMAGE_UNITS_ARB.
8155bd8deadSopenharmony_ci
8165bd8deadSopenharmony_ci    A fragment shader has access to the read-only built-in variable
8175bd8deadSopenharmony_ci    gl_FrontFacing whose value is true if the fragment belongs to a
8185bd8deadSopenharmony_ci    front-facing primitive. A fragment derives its facing direction from the
8195bd8deadSopenharmony_ci    primitive that generates the fragment. All fragments generated by
8205bd8deadSopenharmony_ci    primitives other than polygons, triangles, or quadrilaterals are
8215bd8deadSopenharmony_ci    considered to be front facing. For all other fragments (including ones
8225bd8deadSopenharmony_ci    resulting from point- and line-mode polygons) the determination is made
8235bd8deadSopenharmony_ci    by examining the sign of the area computed by equation 2.6 of section
8245bd8deadSopenharmony_ci    2.13.1 (including the possible reversal of this sign as indicated by the
8255bd8deadSopenharmony_ci    last call to FrontFace). If the sign is positive then the fragments are
8265bd8deadSopenharmony_ci    front facing; otherwise, they are back facing.
8275bd8deadSopenharmony_ci
8285bd8deadSopenharmony_ci    When processing fragments resulting from the rasterization of a pixel
8295bd8deadSopenharmony_ci    rectangle or bitmap, results are undefined if the fragment shader uses a
8305bd8deadSopenharmony_ci    varying variable that is not a built-in varying variable (see Section
8315bd8deadSopenharmony_ci    7.6 of the Shading Language Specification for a list).
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci    Section 3.11.5 Fragment Shader Input
8345bd8deadSopenharmony_ci
8355bd8deadSopenharmony_ci    The OpenGL Shading Language specification describes the values that are
8365bd8deadSopenharmony_ci    available as inputs to the fragment shader. This section is concerned
8375bd8deadSopenharmony_ci    with the built-in variables gl_FragCood, gl_Color and gl_SecondaryColor.
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci    The built-in gl_FragCoord holds the window relative coordinates x, y, z,
8405bd8deadSopenharmony_ci    and 1/w for the fragment. The "z" component of gl_FragCoord undergoes an
8415bd8deadSopenharmony_ci    implied conversion to floating point. This conversion must leave the
8425bd8deadSopenharmony_ci    values 0 and 1 invariant. Note that this "z" component already has a
8435bd8deadSopenharmony_ci    polygon offset added in, if enabled. The 1/w value is computed from the
8445bd8deadSopenharmony_ci    Wc coordinate (see Section 2.10), which is the result of the product of
8455bd8deadSopenharmony_ci    the projection matrix and the vertex's eye coordinates.
8465bd8deadSopenharmony_ci
8475bd8deadSopenharmony_ci    The built-in variables gl_Color and gl_SecondaryColor hold the "r", "g",
8485bd8deadSopenharmony_ci    "b", and "a" components, respectively, of the fragment color and
8495bd8deadSopenharmony_ci    secondary color. Each fixed-point color component undergoes an implied
8505bd8deadSopenharmony_ci    conversion to floating point. This conversion must leave the values 0
8515bd8deadSopenharmony_ci    and 1 invariant.
8525bd8deadSopenharmony_ci
8535bd8deadSopenharmony_ci    Section 3.11.6 Fragment Shader Output
8545bd8deadSopenharmony_ci
8555bd8deadSopenharmony_ci    The OpenGL Shading Language specification describes the values that may
8565bd8deadSopenharmony_ci    be output by a fragment shader. These are gl_FragColor, gl_FragData[n],
8575bd8deadSopenharmony_ci    and gl_FragDepth. The final fragment color values or the final fragment
8585bd8deadSopenharmony_ci    data values written by a fragment shader are clamped to the range [0,1]
8595bd8deadSopenharmony_ci    and then converted to fixed-point as described in section 2.13.9, Final
8605bd8deadSopenharmony_ci    Color Processing. The final fragment depth written by a fragment shader
8615bd8deadSopenharmony_ci    is first clamped to [0,1] and then converted to fixed-point as if it
8625bd8deadSopenharmony_ci    were a window z value. See Section 2.10.1, Controlling the Viewport.
8635bd8deadSopenharmony_ci    Note that the depth range computation is NOT applied here, only the
8645bd8deadSopenharmony_ci    conversion to fixed-point.
8655bd8deadSopenharmony_ci
8665bd8deadSopenharmony_ci    The OpenGL Shading Language specification defines what happens when
8675bd8deadSopenharmony_ci    color, fragment data and/or depth are not written. Those rules are
8685bd8deadSopenharmony_ci    repeated here.
8695bd8deadSopenharmony_ci
8705bd8deadSopenharmony_ci    Writing to gl_FragColor specifies the fragment color that will be used
8715bd8deadSopenharmony_ci    by the subsequent fixed functionality pipeline. If subsequent fixed
8725bd8deadSopenharmony_ci    functionality consumes fragment color and an execution of a fragment
8735bd8deadSopenharmony_ci    shader does not write a value to gl_FragColor then the fragment color
8745bd8deadSopenharmony_ci    consumed is undefined.
8755bd8deadSopenharmony_ci
8765bd8deadSopenharmony_ci    The variable gl_FragData is an array. Writing to gl_FragData[n]
8775bd8deadSopenharmony_ci    specifies the fragment data that will be used by the subsequent fixed
8785bd8deadSopenharmony_ci    functionality pipeline for data n. If subsequent fixed functionality
8795bd8deadSopenharmony_ci    consumes fragment data and an execution of a fragment shader does not
8805bd8deadSopenharmony_ci    write a value to it, then the fragment data consumed is undefined.
8815bd8deadSopenharmony_ci
8825bd8deadSopenharmony_ci    If a shader statically assigns a value to gl_FragColor, it may not
8835bd8deadSopenharmony_ci    assign a value to any element of gl_FragData. If a shader statically
8845bd8deadSopenharmony_ci    writes a value to any element of gl_FragData, it may not assign a value
8855bd8deadSopenharmony_ci    to gl_FragColor. That is, a shader may assign values to either
8865bd8deadSopenharmony_ci    gl_FragColor or gl_FragData, but not both..
8875bd8deadSopenharmony_ci
8885bd8deadSopenharmony_ci    Writing to gl_FragDepth will establish the depth value for the fragment
8895bd8deadSopenharmony_ci    being processed. If depth buffering is enabled, and a shader does not
8905bd8deadSopenharmony_ci    write gl_FragDepth, then the fixed function value for depth will be used
8915bd8deadSopenharmony_ci    as the fragment's depth value. If a shader statically assigns a value to
8925bd8deadSopenharmony_ci    gl_FragDepth, and there is an execution path through the shader that
8935bd8deadSopenharmony_ci    does not set gl_FragDepth, then the value of the fragment's depth may be
8945bd8deadSopenharmony_ci    undefined for some executions of the shader. That is, if a shader
8955bd8deadSopenharmony_ci    statically contains a write to gl_FragDepth, then it is responsible for
8965bd8deadSopenharmony_ci    always writing it.
8975bd8deadSopenharmony_ci
8985bd8deadSopenharmony_ci    Note, a shader contains a static assignment to a variable x if, after
8995bd8deadSopenharmony_ci    pre-processing, the shader contains a statement that would write to x,
9005bd8deadSopenharmony_ci    whether or not run-time flow of control will cause that statement to be
9015bd8deadSopenharmony_ci    executed.
9025bd8deadSopenharmony_ci
9035bd8deadSopenharmony_ci    Section 3.11.7 Required State
9045bd8deadSopenharmony_ci
9055bd8deadSopenharmony_ci    Besides the required state outlined in the ARB_shader_objects extension
9065bd8deadSopenharmony_ci    document, the following state per program object is also required:
9075bd8deadSopenharmony_ci
9085bd8deadSopenharmony_ci      * An array of MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB words that holds
9095bd8deadSopenharmony_ci        uniform values.
9105bd8deadSopenharmony_ci
9115bd8deadSopenharmony_ci    Modify Section 3.12, Multisample Point Fade
9125bd8deadSopenharmony_ci
9135bd8deadSopenharmony_ci    Rename this section to Section 3.13.
9145bd8deadSopenharmony_ci
9155bd8deadSopenharmony_ci
9165bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
9175bd8deadSopenharmony_ciOperations and the Frame Buffer)
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci    None
9205bd8deadSopenharmony_ci
9215bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
9225bd8deadSopenharmony_ci
9235bd8deadSopenharmony_ci    Modify Section 5.6, Hints (p. 203)
9245bd8deadSopenharmony_ci
9255bd8deadSopenharmony_ci    (add to the paragraph describing the hints)... the desired quality and
9265bd8deadSopenharmony_ci    performance of compressing texture images;
9275bd8deadSopenharmony_ci    FRAGMENT_SHADER_DERIVATIVE_HINT_ARB, indicating the desired derivative
9285bd8deadSopenharmony_ci    accuracy for the fragment processing built-in functions dFdx, dFdy and
9295bd8deadSopenharmony_ci    fwidth. Hint must be one of FASTEST, ...
9305bd8deadSopenharmony_ci
9315bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.4 Specification (State and State Requests)
9325bd8deadSopenharmony_ci
9335bd8deadSopenharmony_ci    Modify Section 6.1.2, Data Conversions (p. 205)
9345bd8deadSopenharmony_ci
9355bd8deadSopenharmony_ci    (add to end of last paragraph, p. 206) Queries of texture state
9365bd8deadSopenharmony_ci    variables corresponding to a texture coordinate processing unit (namely,
9375bd8deadSopenharmony_ci    TexGen state and enables, and matrices) will produce an
9385bd8deadSopenharmony_ci    INVALID_OPERATION error if the value of ACTIVE_TEXTURE is greater than
9395bd8deadSopenharmony_ci    or equal to MAX_TEXTURE_COORDS_ARB. All other texture state queries will
9405bd8deadSopenharmony_ci    result in an INVALID_OPERATION error if the value of ACTIVE_TEXTURE is
9415bd8deadSopenharmony_ci    greater than or equal to MAX_TEXTURE_IMAGE_UNITS_ARB.
9425bd8deadSopenharmony_ci
9435bd8deadSopenharmony_ci    Modify section 6.1.12 Object Queries.
9445bd8deadSopenharmony_ci
9455bd8deadSopenharmony_ci    The commands
9465bd8deadSopenharmony_ci
9475bd8deadSopenharmony_ci        void GetObjectParameter{if}vARB(handleARB obj, enum pname, T params)
9485bd8deadSopenharmony_ci
9495bd8deadSopenharmony_ci    return object specific parameter values for object <obj> in <params>.
9505bd8deadSopenharmony_ci    The parameter value to return is specified by <pname>.
9515bd8deadSopenharmony_ci
9525bd8deadSopenharmony_ci    If <pname> is OBJECT_TYPE_ARB, GetObjectParameter{if}vARB returns
9535bd8deadSopenharmony_ci    PROGRAM_OBJECT_ARB if <obj> references a program object. It returns
9545bd8deadSopenharmony_ci    SHADER_OBJECT_ARB if <obj> references any shader object. If <obj> is not
9555bd8deadSopenharmony_ci    of type PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB, the error
9565bd8deadSopenharmony_ci    INVALID_OPERATION is generated.
9575bd8deadSopenharmony_ci
9585bd8deadSopenharmony_ci    If <pname> is OBJECT_SUBTYPE_ARB, GetObjectParameter{if}vARB returns
9595bd8deadSopenharmony_ci    FRAGMENT_SHADER_ARB if <obj> references a shader object. If <obj> is not
9605bd8deadSopenharmony_ci    of type SHADER_OBJECT_ARB, the error INVALID_OPERATION is generated.
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ci
9635bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.4 Specification (Invariance)
9645bd8deadSopenharmony_ci
9655bd8deadSopenharmony_ci    Add to end of Section A.3 (p. 250):
9665bd8deadSopenharmony_ci
9675bd8deadSopenharmony_ci    The same fragment shader will produce the same result when run multiple
9685bd8deadSopenharmony_ci    times with the same input. The wording 'the same shader' means a program
9695bd8deadSopenharmony_ci    object that is populated with the same source strings, which are
9705bd8deadSopenharmony_ci    compiled and then linked, possibly multiple times. This program object
9715bd8deadSopenharmony_ci    is then executed using the same GL state vector.
9725bd8deadSopenharmony_ci
9735bd8deadSopenharmony_ci    All fragment shaders that either conditionally or unconditionally assign
9745bd8deadSopenharmony_ci    gl_FragCoord.z to gl_FragDepth are depth-invariant with respect to each
9755bd8deadSopenharmony_ci    other, for those fragments where the assignment to gl_FragDepth actually
9765bd8deadSopenharmony_ci    is done.
9775bd8deadSopenharmony_ci
9785bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
9795bd8deadSopenharmony_ci
9805bd8deadSopenharmony_ci    None
9815bd8deadSopenharmony_ci
9825bd8deadSopenharmony_ciInteractions with ARB_vertex_program and ARB_fragment_program
9835bd8deadSopenharmony_ci
9845bd8deadSopenharmony_ci    Mixing a high level ARB_fragment_shader shader with a low level
9855bd8deadSopenharmony_ci    ARB_vertex_program shader is allowed. However, a high level
9865bd8deadSopenharmony_ci    ARB_fragment_shader shader and a low level ARB_fragment_program shader
9875bd8deadSopenharmony_ci    cannot be active at the same time.
9885bd8deadSopenharmony_ci
9895bd8deadSopenharmony_ciInteractions with ARB_fragment_program
9905bd8deadSopenharmony_ci
9915bd8deadSopenharmony_ci    Enabling an ARB_fragment_shader shader by issuing the command
9925bd8deadSopenharmony_ci    UseProgramObjectARB(), with a handle which is not zero, results in any
9935bd8deadSopenharmony_ci    low level fragment shader to be ignored and overrides the enable
9945bd8deadSopenharmony_ci    FRAGMENT_PROGRAM_ARB. Note that the value for FRAGMENT_PROGRAM_ARB does
9955bd8deadSopenharmony_ci    not change by installing an ARB_fragment_shader shader.
9965bd8deadSopenharmony_ci
9975bd8deadSopenharmony_ci    The following enumerants are borrowed from ARB_fragment_program. Their
9985bd8deadSopenharmony_ci    usage and meaning has stayed the same:
9995bd8deadSopenharmony_ci
10005bd8deadSopenharmony_ci        MAX_TEXTURE_COORDS_ARB                          0x8871
10015bd8deadSopenharmony_ci        MAX_TEXTURE_IMAGE_UNITS_ARB                     0x8872
10025bd8deadSopenharmony_ci
10035bd8deadSopenharmony_ciInteractions with ARB_vertex_shader
10045bd8deadSopenharmony_ci
10055bd8deadSopenharmony_ci    If ARB_vertex_shader is present, then this extension does not also
10065bd8deadSopenharmony_ci    define the new token SHADER_OBJECT_ARB.
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci    If ARB_vertex_shader is not present, the wording of Section 3.11.3
10095bd8deadSopenharmony_ci    Varying Variables needs to be modified to omit references to the vertex
10105bd8deadSopenharmony_ci    shader.
10115bd8deadSopenharmony_ci
10125bd8deadSopenharmony_ciErrors
10135bd8deadSopenharmony_ci
10145bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by any command accessing
10155bd8deadSopenharmony_ci    texture coordinate processing state if the texture unit number
10165bd8deadSopenharmony_ci    corresponding to the current value of ACTIVE_TEXTURE is greater than or
10175bd8deadSopenharmony_ci    equal to the implementation-dependent constant MAX_TEXTURE_COORDS_ARB.
10185bd8deadSopenharmony_ci
10195bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by any command accessing
10205bd8deadSopenharmony_ci    texture image processing state if the texture unit number corresponding
10215bd8deadSopenharmony_ci    to the current value of ACTIVE_TEXTURE is greater than or equal to the
10225bd8deadSopenharmony_ci    implementation-dependent constant MAX_TEXTURE_IMAGE_UNITS_ARB.
10235bd8deadSopenharmony_ci
10245bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by any command that takes one or
10255bd8deadSopenharmony_ci    more handles as input, and one or more of these handles are not an
10265bd8deadSopenharmony_ci    object handle generated by OpenGL.
10275bd8deadSopenharmony_ci
10285bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB
10295bd8deadSopenharmony_ci    if <pname> is OBJECT_TYPE_ARB and <obj> is not of type
10305bd8deadSopenharmony_ci    PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB.
10315bd8deadSopenharmony_ci
10325bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB
10335bd8deadSopenharmony_ci    if <pname> is OBJECT_SUBTYPE_ARB and <obj> is not of type
10345bd8deadSopenharmony_ci    SHADER_OBJECT_ARB.
10355bd8deadSopenharmony_ci
10365bd8deadSopenharmony_ciNew State
10375bd8deadSopenharmony_ci                                                                 Initial
10385bd8deadSopenharmony_ci    Get Value              Type       Get Command                Value        Description          Sec.   Attribute
10395bd8deadSopenharmony_ci    ---------              -----      -----------------------  -------------  -----------          ----   ---------
10405bd8deadSopenharmony_ci    OBJECT_TYPE_ARB        Z2         GetObjectParameterivARB   SHADER_OBJECT  Type of object      3.11.1        -
10415bd8deadSopenharmony_ci    OBJECT_SUBTYPE_ARB     Z2         GetObjectParameterivARB  FRAGMENT_SHADER Sub type of object  3.11.1        -
10425bd8deadSopenharmony_ci
10435bd8deadSopenharmony_ci    Table X Shader object state.
10445bd8deadSopenharmony_ci
10455bd8deadSopenharmony_ci    (Add the following hint to Table 6.26, p. 241.)
10465bd8deadSopenharmony_ci
10475bd8deadSopenharmony_ci                                                                 Initial
10485bd8deadSopenharmony_ci    Get Value              Type       Get Command                Value        Description          Sec.   Attribute
10495bd8deadSopenharmony_ci    ---------              -----      -----------------------  -------------  -----------          ----   ---------
10505bd8deadSopenharmony_ci    FRAGMENT_SHADER_DERIVATIVE_HINT                                            fragment shader
10515bd8deadSopenharmony_ci                           Z3         GetIntegerv               DONT_CARE      derivative accuracy  5.6    hint
10525bd8deadSopenharmony_ci                                                                               hint
10535bd8deadSopenharmony_ci
10545bd8deadSopenharmony_ciNew Implementation Dependent State
10555bd8deadSopenharmony_ci                                                                      Minimum
10565bd8deadSopenharmony_ci    Get Value                           Type  Get Command   Value   Description            Sec.  Attr.
10575bd8deadSopenharmony_ci    ---------                           ----  -----------  -------  -----------            ----  -----
10585bd8deadSopenharmony_ci    MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB Z+   GetIntegerv     64     Number of words        3.11.2   -
10595bd8deadSopenharmony_ci                                                                    for fragment shader
10605bd8deadSopenharmony_ci                                                                    uniform variables
10615bd8deadSopenharmony_ci    MAX_TEXTURE_IMAGE_UNITS_ARB         Z+   GetIntegerv     2      Number of separate     3.11.4   -
10625bd8deadSopenharmony_ci                                                                    texture image units
10635bd8deadSopenharmony_ci    MAX_TEXTURE_COORDS_ARB              Z+    GetIntegerv    2      number of texture      2.7      -
10645bd8deadSopenharmony_ci                                                                    coordinate sets
10655bd8deadSopenharmony_ci
10665bd8deadSopenharmony_ciSample Usage
10675bd8deadSopenharmony_ci
10685bd8deadSopenharmony_ci    The code below is taken from the sample section in ARB_vertex_shader and
10695bd8deadSopenharmony_ci    expanded to include a fragment shader.
10705bd8deadSopenharmony_ci
10715bd8deadSopenharmony_ci    GLboolean init(GLcharARB *vertexShader, GLcharARB *fragmentShader)
10725bd8deadSopenharmony_ci    {
10735bd8deadSopenharmony_ci        const GLcharARB    *pInfoLog;
10745bd8deadSopenharmony_ci        GLboolean compiled = GL_FALSE;
10755bd8deadSopenharmony_ci        GLboolean linked   = GL_FALSE;
10765bd8deadSopenharmony_ci        GLint     length;
10775bd8deadSopenharmony_ci
10785bd8deadSopenharmony_ci        //
10795bd8deadSopenharmony_ci        // Create shader and program objects.
10805bd8deadSopenharmony_ci        //
10815bd8deadSopenharmony_ci        ProgramObject      = glCreateProgramObjectARB();
10825bd8deadSopenharmony_ci        VertexShaderObject = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
10835bd8deadSopenharmony_ci        FragmentShaderObject = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
10845bd8deadSopenharmony_ci
10855bd8deadSopenharmony_ci
10865bd8deadSopenharmony_ci        length = strlen(vertexShader);
10875bd8deadSopenharmony_ci        glShaderSourceARB(VertexShaderObject, 1, &vertexShader, &length);
10885bd8deadSopenharmony_ci        glShaderSourceARB(FragmentShaderObject, 1, &fragmentShader, NULL);
10895bd8deadSopenharmony_ci
10905bd8deadSopenharmony_ci        //
10915bd8deadSopenharmony_ci        // OpenGL made a copy of the shaders, we can free our copy
10925bd8deadSopenharmony_ci        //
10935bd8deadSopenharmony_ci        free(vertexShader);
10945bd8deadSopenharmony_ci        free(fragmentShader);
10955bd8deadSopenharmony_ci
10965bd8deadSopenharmony_ci        //
10975bd8deadSopenharmony_ci        // Compile the vertex and fragment shader, and print out the
10985bd8deadSopenharmony_ci        // compiler log file.
10995bd8deadSopenharmony_ci        //
11005bd8deadSopenharmony_ci        glCompileShaderARB(VertexShaderObject);
11015bd8deadSopenharmony_ci        glGetObjectParameterivARB(VertexShaderObject,
11025bd8deadSopenharmony_ci                                  GL_OBJECT_COMPILE_STATUS_ARB, &compiled);
11035bd8deadSopenharmony_ci
11045bd8deadSopenharmony_ci        glGetObjectParameterivARB(VertexShaderObject,
11055bd8deadSopenharmony_ci                                 GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
11065bd8deadSopenharmony_ci        pInfoLog = (GLcharARB *) malloc(maxLength * sizeof(GLcharARB));
11075bd8deadSopenharmony_ci        glGetInfoLogARB(VertexShaderObject, maxLength, &length, pInfoLog);
11085bd8deadSopenharmony_ci        printf("%s", pInfoLog);
11095bd8deadSopenharmony_ci        free(pInfoLog);
11105bd8deadSopenharmony_ci
11115bd8deadSopenharmony_ci        if (!compiled) {
11125bd8deadSopenharmony_ci            printf("Compile failed\n");
11135bd8deadSopenharmony_ci            return GL_FALSE;
11145bd8deadSopenharmony_ci        }
11155bd8deadSopenharmony_ci
11165bd8deadSopenharmony_ci        glCompileShaderARB(FragmentShaderObject);
11175bd8deadSopenharmony_ci        glGetObjectParameterivARB(FragmentShaderObject,
11185bd8deadSopenharmony_ci                                  GL_OBJECT_COMPILE_STATUS_ARB, &compiled);
11195bd8deadSopenharmony_ci
11205bd8deadSopenharmony_ci        glGetObjectParameterivARB(FragmentShaderObject,
11215bd8deadSopenharmony_ci                                 GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
11225bd8deadSopenharmony_ci        pInfoLog = (GLcharARB *) malloc(maxLength * sizeof(GLcharARB));
11235bd8deadSopenharmony_ci        glGetInfoLogARB(FragmentShaderObject, maxLength, NULL, pInfoLog);
11245bd8deadSopenharmony_ci        printf("%s", pInfoLog);
11255bd8deadSopenharmony_ci        free(pInfoLog);
11265bd8deadSopenharmony_ci
11275bd8deadSopenharmony_ci        if (!compiled) {
11285bd8deadSopenharmony_ci            printf("Compile failed\n");
11295bd8deadSopenharmony_ci            return GL_FALSE;
11305bd8deadSopenharmony_ci        }
11315bd8deadSopenharmony_ci
11325bd8deadSopenharmony_ci        //
11335bd8deadSopenharmony_ci        // Populate the program object with the compiled shadera
11345bd8deadSopenharmony_ci        //
11355bd8deadSopenharmony_ci        glAttachObjectARB(ProgramObject, VertexShaderObject);
11365bd8deadSopenharmony_ci        glAttachObjectARB(ProgramObject, FragmentShaderObject);
11375bd8deadSopenharmony_ci
11385bd8deadSopenharmony_ci        //
11395bd8deadSopenharmony_ci        // We want the shader objects to go away as soon as it is detached
11405bd8deadSopenharmony_ci        // from the program object it is attached to. We can simply call
11415bd8deadSopenharmony_ci        // delete now to achieve that. Note that calling delete on a program
11425bd8deadSopenharmony_ci        // object will result in all shaders attached to that program object
11435bd8deadSopenharmony_ci        // to be detached. If delete has been called for the shader objects,
11445bd8deadSopenharmony_ci        // calling delete on the program object will result in the shader
11455bd8deadSopenharmony_ci        // objects being deleted as well.
11465bd8deadSopenharmony_ci        //
11475bd8deadSopenharmony_ci        glDeleteObjectARB(VertexShaderObject);
11485bd8deadSopenharmony_ci        glDeleteObjectARB(FragmentShaderObject);
11495bd8deadSopenharmony_ci
11505bd8deadSopenharmony_ci        //
11515bd8deadSopenharmony_ci        // Link the program object and print out the linker log file
11525bd8deadSopenharmony_ci        //
11535bd8deadSopenharmony_ci        glLinkProgramARB(ProgramObject);
11545bd8deadSopenharmony_ci        glGetObjectParameterivARB(ProgramObject,
11555bd8deadSopenharmony_ci                                  GL_OBJECT_LINK_STATUS_ARB, &linked);
11565bd8deadSopenharmony_ci
11575bd8deadSopenharmony_ci        glGetObjectParameterivARB(ProgramObject,
11585bd8deadSopenharmony_ci                                 GL_OBJECT_INFO_LOG_LENGTH_ARB, &maxLength);
11595bd8deadSopenharmony_ci        pInfoLog = (GLcharARB *) malloc(maxLength * sizeof(GLcharARB));
11605bd8deadSopenharmony_ci        glGetInfoLogARB(ProgramObject, maxLength, NULL, pInfoLog);
11615bd8deadSopenharmony_ci
11625bd8deadSopenharmony_ci        printf("%s\n", pInfoLog);
11635bd8deadSopenharmony_ci        free(pInfoLog);
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci        //
11665bd8deadSopenharmony_ci        // If all went well, make the program object part of the current state
11675bd8deadSopenharmony_ci        //
11685bd8deadSopenharmony_ci        if (linked) {
11695bd8deadSopenharmony_ci            glUseProgramObjectARB(ProgramObject);
11705bd8deadSopenharmony_ci            return GL_TRUE;
11715bd8deadSopenharmony_ci        } else {
11725bd8deadSopenharmony_ci            return GL_FALSE;
11735bd8deadSopenharmony_ci        }
11745bd8deadSopenharmony_ci    }
11755bd8deadSopenharmony_ci
11765bd8deadSopenharmony_ciRevision History
11775bd8deadSopenharmony_ci
11785bd8deadSopenharmony_ci    Revision 0.5, 6/6/2002
11795bd8deadSopenharmony_ci      - First draft for circulation
11805bd8deadSopenharmony_ci    Revision 0.51, 6/10/2002
11815bd8deadSopenharmony_ci      - Listed all varyings that a fragment shader can access
11825bd8deadSopenharmony_ci      - Clarified section 3.11.6
11835bd8deadSopenharmony_ci      - Added more to the 'Interaction with GL2_vertex_shader' section
11845bd8deadSopenharmony_ci    Revision 0.52, 6/12/2002
11855bd8deadSopenharmony_ci      - Now references V1.0 of the OpenGL Shading Language Specification
11865bd8deadSopenharmony_ci      - Fixed minor typos
11875bd8deadSopenharmony_ci      - Accepted by the GL2 working group
11885bd8deadSopenharmony_ci    Revision 0.52, 10/17/2002
11895bd8deadSopenharmony_ci      - Removed IsObjectGL2()
11905bd8deadSopenharmony_ci      - Expanded GetObjectParameter{if}GL2. Added OBJECT_SUBTYPE_GL2.
11915bd8deadSopenharmony_ci    Revision 0.53, 10/18/2002
11925bd8deadSopenharmony_ci      - Forgot to add _GL2 to the end of MAX_FP_TEXTURE_UNITS_GL2.
11935bd8deadSopenharmony_ci      - Added language disallowing mixing GL2 high level vertex shader with
11945bd8deadSopenharmony_ci        low level ARB vertex program or fragment program.
11955bd8deadSopenharmony_ci    Revision 0.54, 10/24/2002
11965bd8deadSopenharmony_ci      - Removed the resource limit section and move it to GL2_shader_objects
11975bd8deadSopenharmony_ci      - Clarified some sections across the document
11985bd8deadSopenharmony_ci      - Based on ARB_fragment_program split a texture unit into two sub
11995bd8deadSopenharmony_ci        units. This resulted in expanding Section 2 significantly.
12005bd8deadSopenharmony_ci      - Expanded section 6
12015bd8deadSopenharmony_ci      - Expanded Errors section
12025bd8deadSopenharmony_ci      - Added sample usage
12035bd8deadSopenharmony_ci    Revision 0.6, 10/29/2002
12045bd8deadSopenharmony_ci      - Now written against the OpenGL 1.4 specification.
12055bd8deadSopenharmony_ci      - Second distribution to the GL2 working group.
12065bd8deadSopenharmony_ci    Revision 0.61, 11/26/2002
12075bd8deadSopenharmony_ci      - Renamed MAX_FP_TEXTURE_UNITS to MAX_FRAGMENT_TEXTURE_UNITS.
12085bd8deadSopenharmony_ci      - Updated list of contributors.
12095bd8deadSopenharmony_ci      - Allowed mixing of a high level GL2 fragment shader with a low level
12105bd8deadSopenharmony_ci        ARB_vertex_program shader.
12115bd8deadSopenharmony_ci    Revision 0.62, 12/04/2002
12125bd8deadSopenharmony_ci      - Changed issue 3 wording to make the number of texture image units
12135bd8deadSopenharmony_ci        and coordinates units independent from each other.
12145bd8deadSopenharmony_ci      - Changed MAX_FRAGMENT_UNIFORM_FLOATS_GL2 to
12155bd8deadSopenharmony_ci        MAX_FRAGMENT_UNIFORM_WORDS_GL2. Also changed language in paragraph
12165bd8deadSopenharmony_ci        3.11.2 clarifying this new constant.
12175bd8deadSopenharmony_ci      - Added issue number 5.
12185bd8deadSopenharmony_ci    Revision 0.63, 02/13/2003
12195bd8deadSopenharmony_ci      - Consistently used 'texture coordinate set'
12205bd8deadSopenharmony_ci      - Changed 3.11.5, fragment shader output. Colors are clamped, and
12215bd8deadSopenharmony_ci        depths are clamped then converted to fixed point.
12225bd8deadSopenharmony_ci      - Added Section 3.11.4.1 Fragment Shader Texturing
12235bd8deadSopenharmony_ci    Revision 0.64, 02/21/2003
12245bd8deadSopenharmony_ci      - Modified section 2.10.1
12255bd8deadSopenharmony_ci      - Added color conversion to fixed-point to the values written to
12265bd8deadSopenharmony_ci        gl_FragColor. Section 3.11.5.
12275bd8deadSopenharmony_ci    Revision 0.65, 03/06/2003
12285bd8deadSopenharmony_ci      - Added a third LOD bias parameter to section 3.8.8 (comes from the
12295bd8deadSopenharmony_ci        texture lookup functions).
12305bd8deadSopenharmony_ci      - Added issues 6 and 7.
12315bd8deadSopenharmony_ci      - Added clip w coordinate interpolation for lines and polygons.
12325bd8deadSopenharmony_ci      - Upgraded colors and texture coordinates to be full floating point
12335bd8deadSopenharmony_ci        citizens, section 2.1.1.
12345bd8deadSopenharmony_ci      - Updated the interactions section.
12355bd8deadSopenharmony_ci      - Renamed MAX_FRAGMENT_TEXTURE_UNITS_GL2 to
12365bd8deadSopenharmony_ci        MAX_TEXTURE_IMAGE_UNITS_ARB
12375bd8deadSopenharmony_ci    Revision 0.66, 03/26/2003
12385bd8deadSopenharmony_ci      - Expanded issues 2 and 3.
12395bd8deadSopenharmony_ci      - Added modification to section 3.8.15.
12405bd8deadSopenharmony_ci      - Updated contributors list. Who else?
12415bd8deadSopenharmony_ci      - Updated IP Status section to point to the contributors agreement.
12425bd8deadSopenharmony_ci    Revision 0.67, 04/09/2003
12435bd8deadSopenharmony_ci      - Added required state section.
12445bd8deadSopenharmony_ci      - Renamed handle to handleGL2
12455bd8deadSopenharmony_ci    Revision 0.68, 05/08/2003
12465bd8deadSopenharmony_ci      - Changed MAX_FRAGMENT_UNIFORM_WORDS_GL2 to
12475bd8deadSopenharmony_ci        MAX_FRAGMENT_UNIFORM_COMPONENTS_GL2
12485bd8deadSopenharmony_ci      - Updated example section to reflect the latest API changes
12495bd8deadSopenharmony_ci      - Changed the location of the Contributors License to a publicly
12505bd8deadSopenharmony_ci        accessible place on www.3dlabs.com.
12515bd8deadSopenharmony_ci      - Re-worded the introduction.
12525bd8deadSopenharmony_ci      - Added OBJECT_TYPE_GL2 to the list of new tokens.
12535bd8deadSopenharmony_ci      - Moved issue 3 up to be issue 1.
12545bd8deadSopenharmony_ci      - Re-wrote section 3.8, introduction.
12555bd8deadSopenharmony_ci      - Added issue 8.
12565bd8deadSopenharmony_ci      - Added front/back facing language to section 3.11.4
12575bd8deadSopenharmony_ci      - Re-wrote issue 3.
12585bd8deadSopenharmony_ci      - Added language to appendix A. Invariance.
12595bd8deadSopenharmony_ci      - Added section 3.11.5 Fragment Shader Input
12605bd8deadSopenharmony_ci      - Added issue 9
12615bd8deadSopenharmony_ci      - Fixed section 3.11.4. Texture enables are ignored.
12625bd8deadSopenharmony_ci      - Added issue 10.
12635bd8deadSopenharmony_ci      - Added a note about polygon offset to section 3.11.5.
12645bd8deadSopenharmony_ci      - Reversed the resolution of issue 5. Changed chapter 3 to reflect
12655bd8deadSopenharmony_ci        this.
12665bd8deadSopenharmony_ci      - Updated sample code to reflect latest API names.
12675bd8deadSopenharmony_ci      - Updated errors section.
12685bd8deadSopenharmony_ci      - Numerous small fixes based on Pat's comments.
12695bd8deadSopenharmony_ci      - Depth values are converted to floating point before entering the
12705bd8deadSopenharmony_ci        fragment shader. Updated issue 7 to reflect this.
12715bd8deadSopenharmony_ci      - Fixed up the state tables.
12725bd8deadSopenharmony_ci      - Updated section 3.11.4. Clarified depth texture comparison mode when
12735bd8deadSopenharmony_ci        a fragment shader is active.
12745bd8deadSopenharmony_ci      - Added Jon Leech, Evan Hart, Benjamin Lipchak and Jeremy Sandmel to
12755bd8deadSopenharmony_ci        the list of contributors.
12765bd8deadSopenharmony_ci    Revision 0.69, 05/09/2003
12775bd8deadSopenharmony_ci      - Added to issue 5. In this case fragment shader should only reference
12785bd8deadSopenharmony_ci        built- in varying variables s (starting with "gl_"). Also added spec
12795bd8deadSopenharmony_ci        language to section 3.11.4.
12805bd8deadSopenharmony_ci      - Added one more paragraph to issue 4, invariance. If you do not write
12815bd8deadSopenharmony_ci        to gl_FragDepth you're depth invariant with fixed-function.
12825bd8deadSopenharmony_ci      - Explained 'statically assigned'
12835bd8deadSopenharmony_ci      - Assigned enum values.
12845bd8deadSopenharmony_ci      - Version approved by the ARB-GL2 working group.
12855bd8deadSopenharmony_ci    Revision 0.70, 05/14/2003
12865bd8deadSopenharmony_ci      - Section 3.8.15 clarified.
12875bd8deadSopenharmony_ci      - Issue 8 intended to explain what happens when
12885bd8deadSopenharmony_ci        VERTEX_PROGRAM_TWO_SIDE_ARB is false, not true. Fixed.
12895bd8deadSopenharmony_ci      - Clarified fragment front/back facing selection when in polygon point
12905bd8deadSopenharmony_ci        or line mode.
12915bd8deadSopenharmony_ci      - Fixed typos.
12925bd8deadSopenharmony_ci      - Renamed all GL2 occurrences to ARB.
12935bd8deadSopenharmony_ci      - Added SHADER_OBJECT_ARB to the list of new tokens.
12945bd8deadSopenharmony_ci      - Deleted reference to AppendShader (this call no longer exist).
12955bd8deadSopenharmony_ci    Revision 0.71, 06/30/2003
12965bd8deadSopenharmony_ci      - Removed section 2.13.9. It no longer applies.
12975bd8deadSopenharmony_ci      - The dynamic range of colors is left at 2^10, only texture
12985bd8deadSopenharmony_ci        coordinates are upgraded to 2^32 (Section 2.1.1).
12995bd8deadSopenharmony_ci      - Updated Sample Usage section.
13005bd8deadSopenharmony_ci      - Added fixed-point conversion rule for color and secondary color.
13015bd8deadSopenharmony_ci        Section 3.11.5.
13025bd8deadSopenharmony_ci      - General language cleanup.
13035bd8deadSopenharmony_ci      - Version approved as ARB extension
13045bd8deadSopenharmony_ci    Revision 0.72, 02/23/2004
13055bd8deadSopenharmony_ci      - Fixed the last part of section 3.4.1, basic line segment
13065bd8deadSopenharmony_ci        rasterization.
13075bd8deadSopenharmony_ci      - Removed SHADER_OBJECT_ARB, OBJECT_TYPE_ARB and OBJECT_SUBTYPE_ARB
13085bd8deadSopenharmony_ci        tokens from the New Tokens section. They are already defined in
13095bd8deadSopenharmony_ci        ARB_shader_objects. Also removed references to these in Chapter 6,
13105bd8deadSopenharmony_ci        GetObjectParameter{fi}v and the Errors section.
13115bd8deadSopenharmony_ci      - Added the official extension number (32). Edited the Status
13125bd8deadSopenharmony_ci        paragraph.
13135bd8deadSopenharmony_ci    Revision 0.73, 03/11/2004
13145bd8deadSopenharmony_ci      - Added language to specify when texture lookups are undefined when
13155bd8deadSopenharmony_ci        mixing shadow and non shadow samplers with texture objects with or
13165bd8deadSopenharmony_ci        without depth components and different texture compare modes set.
13175bd8deadSopenharmony_ci    Revision 0.74, 03/12/2004
13185bd8deadSopenharmony_ci      - Added sampler2DRect and sampler2DRectShadow to the previous changes.
13195bd8deadSopenharmony_ci    Revision 0.75, 03/16/2004
13205bd8deadSopenharmony_ci      - Fixed up the sampler language from version 0.74.
13215bd8deadSopenharmony_ci      - Updated section 3.11.6, Fragment Shader Output to incorporate the
13225bd8deadSopenharmony_ci        new gl_FragData[] output array. Added related issues 11 and 12.
13235bd8deadSopenharmony_ci    Revision 0.76, 03/19/2004
13245bd8deadSopenharmony_ci      - Added a hint DERIVATIVE_ACCURACY_HINT to section 5.6 and the New
13255bd8deadSopenharmony_ci        Tokens section.
13265bd8deadSopenharmony_ci    Revision 0.77, 03/31/2004
13275bd8deadSopenharmony_ci      - Added language to section 3.11.4 specifying that derivatives for LOD
13285bd8deadSopenharmony_ci        calculations may be approximated.
13295bd8deadSopenharmony_ci      - Moved spec language related to texture operations not affected by a
13305bd8deadSopenharmony_ci        fragment shader from section 3.11.4 to issue 13.
13315bd8deadSopenharmony_ci      - Added language to section 3.11.4, copied from the vertex shader, how
13325bd8deadSopenharmony_ci        the filtered texture value is computed. Also added language that the
13335bd8deadSopenharmony_ci        LOD could be computed using derivatives computed using a
13345bd8deadSopenharmony_ci        differencing algorithm.
13355bd8deadSopenharmony_ci      - Renamed DERIVATIVE_ACCURACY_HINT_ARB to
13365bd8deadSopenharmony_ci        FRAGMENT_SHADER_DERIVATIVE_HINT_ARB and added it to the state
13375bd8deadSopenharmony_ci        tables.
13385bd8deadSopenharmony_ci      - Updated issue 12. gl_FragData will be clamped to [0,1]
13395bd8deadSopenharmony_ci      - Added issue 14, explaining the interaction with MRT.
13405bd8deadSopenharmony_ci      - Updated the shading language version this spec references to version
13415bd8deadSopenharmony_ci        100.53.
13425bd8deadSopenharmony_ci      - Added clamping to [0,1] for output color and fragData back into
13435bd8deadSopenharmony_ci        section 3.11.6. Also updated the language in 3.11.6 to be the same
13445bd8deadSopenharmony_ci        as in the OpenGL Shading Language document.
13455bd8deadSopenharmony_ci      - Version voted on and approved by the workgroup.
13465bd8deadSopenharmony_ci    Revision 0.78, 04/06/2004
13475bd8deadSopenharmony_ci      - Minor language changes to issues 12 and 14.
13485bd8deadSopenharmony_ci      - Updated the Shading Language Version referenced to the now official
13495bd8deadSopenharmony_ci        version 1.10.
13505bd8deadSopenharmony_ci    Revision 0.79, 05/14/2004
13515bd8deadSopenharmony_ci      - Listed that FRAGMENT_SHADER_DERIVATIVE_HINT is also accepted by the
13525bd8deadSopenharmony_ci        Get* commands under the New Tokens section.
13535bd8deadSopenharmony_ci      - Updated issue 14. Punted most of it to the MRT extension document.
13545bd8deadSopenharmony_ci    Revision 0.80, 12/12/2006
13555bd8deadSopenharmony_ci      - Fixed spelling of glGetObjectParameterivARB in sample code.
1356