15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_texture3D
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_texture3D
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    $Date: 1996/04/05 19:17:05 $ $Revision: 1.22 $
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    6
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    EXT_abgr affects the definition of this extension
205bd8deadSopenharmony_ci    EXT_texture is required
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciOverview
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    This extension defines 3-dimensional texture mapping.  In order to
255bd8deadSopenharmony_ci    define a 3D texture image conveniently, this extension also defines the
265bd8deadSopenharmony_ci    in-memory formats for 3D images, and adds pixel storage modes to support
275bd8deadSopenharmony_ci    them.
285bd8deadSopenharmony_ci    
295bd8deadSopenharmony_ci    One important application of 3D textures is rendering volumes of image
305bd8deadSopenharmony_ci    data.
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciNew Procedures and Functions
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    void TexImage3DEXT(enum target,
355bd8deadSopenharmony_ci                       int level,
365bd8deadSopenharmony_ci                       enum internalformat,
375bd8deadSopenharmony_ci                       sizei width,
385bd8deadSopenharmony_ci                       sizei height,
395bd8deadSopenharmony_ci                       sizei depth,
405bd8deadSopenharmony_ci                       int border,
415bd8deadSopenharmony_ci                       enum format,
425bd8deadSopenharmony_ci                       enum type,
435bd8deadSopenharmony_ci                       const void* pixels);
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ciNew Tokens
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
485bd8deadSopenharmony_ci    GetFloatv, and GetDoublev, and by the <pname> parameter of PixelStore:
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci        PACK_SKIP_IMAGES_EXT             0x806B
515bd8deadSopenharmony_ci        PACK_IMAGE_HEIGHT_EXT            0x806C
525bd8deadSopenharmony_ci        UNPACK_SKIP_IMAGES_EXT           0x806D
535bd8deadSopenharmony_ci        UNPACK_IMAGE_HEIGHT_EXT          0x806E
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
565bd8deadSopenharmony_ci    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
575bd8deadSopenharmony_ci    GetDoublev, and by the <target> parameter of TexImage3DEXT, GetTexImage,
585bd8deadSopenharmony_ci    GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and
595bd8deadSopenharmony_ci    GetTexParameterfv:
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci        TEXTURE_3D_EXT                   0x806F
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    Accepted by the <target> parameter of TexImage3DEXT,
645bd8deadSopenharmony_ci    GetTexLevelParameteriv, and GetTexLevelParameterfv:
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci        PROXY_TEXTURE_3D_EXT             0x8070
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTexLevelParameteriv and
695bd8deadSopenharmony_ci    GetTexLevelParameterfv:
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci        TEXTURE_DEPTH_EXT                0x8071
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
745bd8deadSopenharmony_ci    GetTexParameteriv, and GetTexParameterfv:
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci        TEXTURE_WRAP_R_EXT               0x8072
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
795bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci        MAX_3D_TEXTURE_SIZE_EXT          0x8073
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation)
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    None
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization)
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    The pixel storage modes are augmented to support 3D image formats in
905bd8deadSopenharmony_ci    memory.  Table 3.1 is replaced with the table below:
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci        Parameter Name          Type            Initial Value   Valid Range
935bd8deadSopenharmony_ci        --------------          ----            -------------   -----------
945bd8deadSopenharmony_ci        UNPACK_SWAP_BYTES       boolean         FALSE           TRUE/FALSE
955bd8deadSopenharmony_ci        UNPACK_LSB_FIRST        boolean         FALSE           TRUE/FALSE
965bd8deadSopenharmony_ci        UNPACK_ROW_LENGTH       integer         0               [0, infinity]
975bd8deadSopenharmony_ci        UNPACK_SKIP_ROWS        integer         0               [0, infinity]
985bd8deadSopenharmony_ci        UNPACK_SKIP_PIXELS      integer         0               [0, infinity]
995bd8deadSopenharmony_ci        UNPACK_ALIGNMENT        integer         4               1, 2, 4, 8
1005bd8deadSopenharmony_ci        UNPACK_IMAGE_HEIGHT_EXT integer         0               [0, infinity]
1015bd8deadSopenharmony_ci        UNPACK_SKIP_IMAGES_EXT  integer         0               [0, infinity]
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci        Table 3.1: PixelStore parameters pertaining to one or more of
1045bd8deadSopenharmony_ci        DrawPixels, TexImage1D, TexImage2D, and TexImage3DEXT.
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    When TexImage3DEXT is called, the groups in memory are treated as being
1075bd8deadSopenharmony_ci    arranged in a sequence of adjacent rectangles.  Each rectangle is a
1085bd8deadSopenharmony_ci    2-dimensional image, whose size and organization are specified by the
1095bd8deadSopenharmony_ci    <width> and <height> parameters to TexImage3DEXT.  The values of
1105bd8deadSopenharmony_ci    UNPACK_ROW_LENGTH and UNPACK_ALIGNMENT control the row-to-row spacing in
1115bd8deadSopenharmony_ci    these images in exactly the manner described in the GL Specification for
1125bd8deadSopenharmony_ci    2-dimensional images.  If the value of UNPACK_IMAGE_HEIGHT_EXT is not
1135bd8deadSopenharmony_ci    positive, then the number of rows in each 2-dimensional image is
1145bd8deadSopenharmony_ci    <height>; otherwise the number of rows is UNPACK_IMAGE_HEIGHT_EXT.  Each
1155bd8deadSopenharmony_ci    2-dimensional image comprises an integral number of rows, and is exactly
1165bd8deadSopenharmony_ci    adjacent to its neighbor images.
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    The mechanism for selecting a sub-volume of a 3-dimensional image builds
1195bd8deadSopenharmony_ci    on the mechanism for selecting a sub-rectangle of groups from a larger
1205bd8deadSopenharmony_ci    containing rectangle.  If UNPACK_SKIP_IMAGES_EXT is positive, the
1215bd8deadSopenharmony_ci    pointer is advanced by UNPACK_SKIP_IMAGES_EXT times the number of
1225bd8deadSopenharmony_ci    elements in one 2-dimensional image.  Then <depth> 2-dimensional images
1235bd8deadSopenharmony_ci    are processed, each having a subimage extracted in the manner described
1245bd8deadSopenharmony_ci    in the GL Specification for 2-dimensional images.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    The selected groups are processed as though they were part of a
1275bd8deadSopenharmony_ci    2-dimensional image.  When the final R, G, B, and A components have been
1285bd8deadSopenharmony_ci    computed for a group, they are assigned to components of a texel as
1295bd8deadSopenharmony_ci    described by Table 3.6 in the EXT_texture extension.  Counting from
1305bd8deadSopenharmony_ci    zero, each resulting Nth texel is assigned internal integer coordinates
1315bd8deadSopenharmony_ci    [i,j,k], where
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci        i = (N mod width) - border
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci        j = ((N div width) mod height) - border
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci        k = ((N div (width * height)) mod depth) - border
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    and the div operator performs integer division with truncation.  Thus
1405bd8deadSopenharmony_ci    the last 2-dimensional image of the 3-dimensional image is indexed with
1415bd8deadSopenharmony_ci    the highest value of k.  The dimensions of the 3-dimensional texture
1425bd8deadSopenharmony_ci    image are <width> x <height> x <depth>.  Integer values that will
1435bd8deadSopenharmony_ci    represent the base-2 logarithm of these dimensions are n, m, and l,
1445bd8deadSopenharmony_ci    defined such that
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci        width = 2**n + (2 * border)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci        height = 2**m + (2 * border)
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci        depth = 2**l + (2 * border)
1515bd8deadSopenharmony_ci    
1525bd8deadSopenharmony_ci    It is acceptable for an implementation to vary its allocation of
1535bd8deadSopenharmony_ci    internal component resolution based any TexImage3DEXT parameter, but the
1545bd8deadSopenharmony_ci    allocation must not be a function of any other factor, and cannot be
1555bd8deadSopenharmony_ci    changed once it is established.  In particular, allocations must be
1565bd8deadSopenharmony_ci    invariant -- the same allocation must be made each time a texture image
1575bd8deadSopenharmony_ci    is specified with the same parameter values.  Provision is made for an
1585bd8deadSopenharmony_ci    application to determine what component resolutions are available
1595bd8deadSopenharmony_ci    without having to fully specify the texture (see below).
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    Texture Wrap Modes
1625bd8deadSopenharmony_ci    ------------------
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    The additional token value TEXTURE_WRAP_R_EXT is accepted by
1655bd8deadSopenharmony_ci    TexParameteri, TexParameterv, TexParameteriv, and TexParameterfv,
1665bd8deadSopenharmony_ci    causing table 3.7 to be replaced with the table below:
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci        Name                            Type            Legal Values
1695bd8deadSopenharmony_ci        ----                            ----            ------------
1705bd8deadSopenharmony_ci        TEXTURE_WRAP_S                  integer         CLAMP, REPEAT
1715bd8deadSopenharmony_ci        TEXTURE_WRAP_T                  integer         CLAMP, REPEAT
1725bd8deadSopenharmony_ci        TEXTURE_WRAP_R_EXT              integer         CLAMP, REPEAT
1735bd8deadSopenharmony_ci        TEXTURE_MIN_FILTER              integer         NEAREST, LINEAR,
1745bd8deadSopenharmony_ci                                                        NEAREST_MIPMAP_NEAREST,
1755bd8deadSopenharmony_ci                                                        NEAREST_MIPMAP_LINEAR,
1765bd8deadSopenharmony_ci                                                        LINEAR_MIPMAP_NEAREST,
1775bd8deadSopenharmony_ci                                                        LINEAR_MIPMAP_LINEAR
1785bd8deadSopenharmony_ci        TEXTURE_MAG_FILTER              integer         NEAREST, LINEAR
1795bd8deadSopenharmony_ci        TEXTURE_BORDER_COLOR            4 floats        any 4 values in [0,1]
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci        Table 3.7: Texture parameters and their values.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    If TEXTURE_WRAP_R_EXT is set to REPEAT, then the GL ignores the integer
1845bd8deadSopenharmony_ci    part of R coordinates, using only the fractional part.  CLAMP causes R
1855bd8deadSopenharmony_ci    to be clamped to the range [0, 1].  The initial state is for
1865bd8deadSopenharmony_ci    TEXTURE_WRAP_R_EXT to be REPEAT.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    Texture Minification
1895bd8deadSopenharmony_ci    --------------------
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    Continuous coordinates s, t, u, and v are defined in figure 3.10 of the
1925bd8deadSopenharmony_ci    GL Specification.  To discuss 3-dimensional texture mapping, coordinates
1935bd8deadSopenharmony_ci    r and w are defined similarly.  Coordinate w is equal to -border at the
1945bd8deadSopenharmony_ci    "far" edge of the 3D image, understanding the image to be right-handed,
1955bd8deadSopenharmony_ci    with k values increasing toward the viewer.  It has value depth+border
1965bd8deadSopenharmony_ci    at the near edge of this volume.  Coordinate r has the same direction,
1975bd8deadSopenharmony_ci    but is normalized so that it is 0.0 and 1.0 at the "far" and "near"
1985bd8deadSopenharmony_ci    edges of a borderless volume.  If the volume has a border, the 0.0 and
1995bd8deadSopenharmony_ci    1.0 mappings of r continue to bound the core image.
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    The formulas for p, used to determine the level of detail, are modified
2025bd8deadSopenharmony_ci    by including dw/dx and dw/dy terms in the obvious ways.  Equation 3.7
2035bd8deadSopenharmony_ci    sums (dw/dx)**2 into the left term, and (dw/dy)**2 into the right term.
2045bd8deadSopenharmony_ci    Equation 3.8 has ((dw/dx * Dx + dw/dy * Dy)**2 added to the two terms
2055bd8deadSopenharmony_ci    under the square root.  The requirements for the function f(x,y) become
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci        1.  f(x, y) is continuous and monotonically increasing in each of
2085bd8deadSopenharmony_ci            |du/dx|, |du/dy|, |dv/dx|, |dv/dy|, |dw/dx|, and |dw/dy|.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci        2.  Let
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci                m_u = max(|du/dx|, |du/dy|)
2135bd8deadSopenharmony_ci                m_v = max(|dv/dx|, |dv/dy|)
2145bd8deadSopenharmony_ci                m_w = max(|dw/dx|, |dw/dy|)
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci            Then
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci                max(m_u, m_v, m_w) <= f(x, y) <= m_u + m_v + m_w
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    The i and j coordinates of the texel selected for NEAREST filtering are
2215bd8deadSopenharmony_ci    as defined in equations 3.9 and 3.10 of the GL Specification.
2225bd8deadSopenharmony_ci    Coordinate k is computed as
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci             /  floor(w),       r < 1
2255bd8deadSopenharmony_ci        k = (
2265bd8deadSopenharmony_ci             \  2**l - 1,       r = 1
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    A 2x2x2 cube of texels is selected for LINEAR filtering.  The i and j
2295bd8deadSopenharmony_ci    coordinates of these texels are computed as defined in the GL
2305bd8deadSopenharmony_ci    Specification for 2-dimensional images.  The k coordinates are
2315bd8deadSopenharmony_ci    computed as
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci              / floor(w - 1/2) mod 2**l,        TEXTURE_WRAP_R_EXT is REPEAT
2345bd8deadSopenharmony_ci        k0 = (
2355bd8deadSopenharmony_ci              \ floor(w - 1/2),                 TEXTURE_WRAP_R_EXT is CLAMP
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci              / (k0 + 1) mod 2**l,      TEXTURE_WRAP_R_EXT is REPEAT
2395bd8deadSopenharmony_ci        k1 = (
2405bd8deadSopenharmony_ci              \ k0 + 1,                 TEXTURE_WRAP_R_EXT is CLAMP
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    Let
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci        A = frac(u - 1/2)
2455bd8deadSopenharmony_ci        B = frac(v - 1/2)
2465bd8deadSopenharmony_ci        C = frac(w - 1/2)
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    where frac(x) denotes the fractional part of x.  Let T[i,j,k] be the
2495bd8deadSopenharmony_ci    texel at location [i,j,k] in the texture image.  Then the texture value,
2505bd8deadSopenharmony_ci    T, is found as
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci        T = (1-A) * (1-B) * (1-C) * T[i0,j0,k0] +
2535bd8deadSopenharmony_ci              A   * (1-B) * (1-C) * T[i1,j0,k0] +
2545bd8deadSopenharmony_ci            (1-A) *   B   * (1-C) * T[i0,j1,k0] +
2555bd8deadSopenharmony_ci              A   *   B   * (1-C) * T[i1,j1,k0] +
2565bd8deadSopenharmony_ci            (1-A) * (1-B) *   C   * T[i0,j0,k1] +
2575bd8deadSopenharmony_ci              A   * (1-B) *   C   * T[i1,j0,k1] +
2585bd8deadSopenharmony_ci            (1-A) *   B   *   C   * T[i0,j1,k1] +
2595bd8deadSopenharmony_ci              A   *   B   *   C   * T[i1,j1,k1]
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    for a 3-dimensional texture.  If any of the selected T[i,j,k] in the
2625bd8deadSopenharmony_ci    above equation refer to a border texel with unspecified value, then the
2635bd8deadSopenharmony_ci    border color given by the current setting of TEXTURE_BORDER_COLOR is
2645bd8deadSopenharmony_ci    used instead of the unspecified value or values.
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci    Mipmapping
2675bd8deadSopenharmony_ci    ----------
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci    TEXTURE_MIN_FILTER values NEAREST_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR,
2705bd8deadSopenharmony_ci    LINEAR_MIPMAP_NEAREST, and LINEAR_MIPMAP_LINEAR each require the use of
2715bd8deadSopenharmony_ci    a mipmap.  A 3-dimensional mipmap is an ordered set of arrays
2725bd8deadSopenharmony_ci    representing the same image; each array has a resolution lower than the
2735bd8deadSopenharmony_ci    previous one.  If the texture, excluding is border, has dimensions
2745bd8deadSopenharmony_ci    2**n x 2**m x 2**l, then there are exactly max(n, m, l) + 1 mipmap
2755bd8deadSopenharmony_ci    arrays.  Each subsequent array has dimensions
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci        size(i-1) x size(j-1) x size(k-1)
2785bd8deadSopenharmony_ci    
2795bd8deadSopenharmony_ci    where the dimensions of the previous array are
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci        size(i) x size(j) x size(k)
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    and
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci                   /  2**x + 2*border,   x > 0
2865bd8deadSopenharmony_ci        size(x) = (
2875bd8deadSopenharmony_ci                   \  1 + 2*border,      x <= 0
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci    Each array in a 3-dimensional mipmap is transmitted to the GL using
2905bd8deadSopenharmony_ci    TexImage3DEXT; the array being set is indicated with the <level>
2915bd8deadSopenharmony_ci    parameter.  The rules for completeness of the set of arrays are as
2925bd8deadSopenharmony_ci    described in the GL Specification, augmented in EXT_texture.  The rules
2935bd8deadSopenharmony_ci    for mipmap array selection, and for filtering of the two selected
2945bd8deadSopenharmony_ci    arrays, are also as described in the GL Specification.  Finally, the
2955bd8deadSopenharmony_ci    rules for texture magnification are also exactly as described in the
2965bd8deadSopenharmony_ci    GL Specification.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    Texture Application
2995bd8deadSopenharmony_ci    -------------------
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    3-dimensional texture mapping is enabled and disabled using the generic
3025bd8deadSopenharmony_ci    Enable and Disable commands, with <cap> specified as TEXTURE_3D_EXT.  If
3035bd8deadSopenharmony_ci    either or both TEXTURE_1D or TEXTURE_2D are enabled at the same time as
3045bd8deadSopenharmony_ci    TEXTURE_3D_EXT, the 3-dimensional texture is used.
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    Query support
3075bd8deadSopenharmony_ci    -------------
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    The proxy texture PROXY_TEXTURE_3D_EXT can be used by applications to
3105bd8deadSopenharmony_ci    query an implementations maximum configurations just as it can be for
3115bd8deadSopenharmony_ci    1-dimensional and 2-dimensional textures.
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    Alternate sets of partial per-level texture state are defined for
3145bd8deadSopenharmony_ci    the proxy texture PROXY_TEXTURE_3D_EXT.  Specifically,
3155bd8deadSopenharmony_ci    TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_DEPTH_EXT, TEXTURE_BORDER,
3165bd8deadSopenharmony_ci    TEXTURE_COMPONENTS, TEXTURE_RED_SIZE_EXT, TEXTURE_GREEN_SIZE_EXT,
3175bd8deadSopenharmony_ci    TEXTURE_BLUE_SIZE_EXT, TEXTURE_ALPHA_SIZE_EXT,
3185bd8deadSopenharmony_ci    TEXTURE_LUMINANCE_SIZE_EXT, and TEXTURE_INTENSITY_SIZE_EXT are
3195bd8deadSopenharmony_ci    maintained the the proxy texture.  When TexImage3DEXT is called
3205bd8deadSopenharmony_ci    with <target> set to PROXY_TEXTURE_3D_EXT, these proxy state
3215bd8deadSopenharmony_ci    values are always respecified, even if the texture is too large to
3225bd8deadSopenharmony_ci    actually be used.  If the texture is too large, all of these state
3235bd8deadSopenharmony_ci    variables are set to zero.  If the texture could be accommodated
3245bd8deadSopenharmony_ci    by TexImage3DEXT called with <target> TEXTURE_3D_EXT, these values
3255bd8deadSopenharmony_ci    are set as though TEXTURE_3D_EXT were being defined.  All of these
3265bd8deadSopenharmony_ci    state value can be queried with GetTexLevelParameteriv with
3275bd8deadSopenharmony_ci    <target> set to PROXY_TEXTURE_3D_EXT.  Calling TexImage3DEXT with
3285bd8deadSopenharmony_ci    <target> PROXY_TEXTURE_3D_EXT has no effect on the actual
3295bd8deadSopenharmony_ci    3-dimensional texture or its state.
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    There is no image associated with PROXY_TEXTURE_3D_EXT.  Therefore
3325bd8deadSopenharmony_ci    PROXY_TEXTURE_3D_EXT cannot be used as a texture, and its image must
3335bd8deadSopenharmony_ci    never be queried using GetTexImage.  (The error INVALID_ENUM results if
3345bd8deadSopenharmony_ci    this is attempted.)  Likewise, there is no nonlevel-related state
3355bd8deadSopenharmony_ci    associated with a proxy texture, so calling GetTexParameteriv or
3365bd8deadSopenharmony_ci    GetTexParameterfv with <target> PROXY_TEXTURE_3D_EXT results in the
3375bd8deadSopenharmony_ci    error INVALID_ENUM.
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment Operations
3405bd8deadSopenharmony_ciand the Framebuffer)
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    None
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions)
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci    TexImage3DEXT with a proxy target is not included in display
3475bd8deadSopenharmony_ci    lists, but is instead executed immediately.
3485bd8deadSopenharmony_ci
3495bd8deadSopenharmony_ciAdditions to Chapter 6 of the GL Specification (State and State Requests)
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    3-dimensional texture images are queried using GetTexImage with its
3525bd8deadSopenharmony_ci    <target> parameter set to TEXTURE_3D_EXT.  The assignment of texel
3535bd8deadSopenharmony_ci    component values to the initial R, G, B, and A components of a pixel
3545bd8deadSopenharmony_ci    group is described in EXT_texture.  Pixel transfer and pixel storage
3555bd8deadSopenharmony_ci    operations are applied as if the image were 2-dimensional, except that
3565bd8deadSopenharmony_ci    the additional pixel storage state values PACK_IMAGE_HEIGHT_EXT and
3575bd8deadSopenharmony_ci    PACK_SKIP_IMAGES_EXT affect the storage of the image into memory.  The
3585bd8deadSopenharmony_ci    correspondence of texels to memory locations is as defined for
3595bd8deadSopenharmony_ci    TexImage3DEXT above, substituting PACK* state for UNPACK* state in all
3605bd8deadSopenharmony_ci    occurrences.
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ciAdditions to the GLX Specification
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci    None
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ciGLX Protocol
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci    A new GL rendering command is added. This command contains pixel data;
3695bd8deadSopenharmony_ci    thus it is sent to the server either as part of a glXRender request
3705bd8deadSopenharmony_ci    or as part of a glXRenderLarge request:
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci        TexImage3DEXT
3735bd8deadSopenharmony_ci            2           84+n+p          rendering command length
3745bd8deadSopenharmony_ci            2           4114            rendering command opcode
3755bd8deadSopenharmony_ci            1           BOOL            swap_bytes
3765bd8deadSopenharmony_ci            1           BOOL            lsb_first
3775bd8deadSopenharmony_ci            2                           unused
3785bd8deadSopenharmony_ci            4           CARD32          row_length
3795bd8deadSopenharmony_ci            4           CARD32          image_height
3805bd8deadSopenharmony_ci            4           CARD32          image_depth
3815bd8deadSopenharmony_ci            4           CARD32          skip_rows
3825bd8deadSopenharmony_ci            4           CARD32          skip_images
3835bd8deadSopenharmony_ci            4           CARD32          skip_volumes
3845bd8deadSopenharmony_ci            4           CARD32          skip_pixels
3855bd8deadSopenharmony_ci            4           CARD32          alignment
3865bd8deadSopenharmony_ci            4           ENUM            target
3875bd8deadSopenharmony_ci            4           INT32           level
3885bd8deadSopenharmony_ci            4           ENUM            internalformat
3895bd8deadSopenharmony_ci            4           INT32           width
3905bd8deadSopenharmony_ci            4           INT32           height
3915bd8deadSopenharmony_ci            4           INT32           depth
3925bd8deadSopenharmony_ci            4           INT32           size4d
3935bd8deadSopenharmony_ci            4           INT32           border
3945bd8deadSopenharmony_ci            4           ENUM            format
3955bd8deadSopenharmony_ci            4           ENUM            type
3965bd8deadSopenharmony_ci            4           CARD32          null_image
3975bd8deadSopenharmony_ci            n           LISTofBYTE      pixels
3985bd8deadSopenharmony_ci            p                           unused, p=pad(n)
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci            If the command is encoded in a glXRenderLarge request, the command 
4015bd8deadSopenharmony_ci            opcode and command length fields above are expanded to 4 bytes each:
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci            4           88+n+p          rendering command length
4045bd8deadSopenharmony_ci            4           4114            rendering command opcode
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci        If <width> < 0, <height> < 0, <depth> < 0, <format> is invalid or <type> is 
4075bd8deadSopenharmony_ci        invalid, then the command is erroneous and n=0.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci        <pixels> is arranged as a sequence of adjacent rectangles. Each rectangle is a
4105bd8deadSopenharmony_ci        2-dimensional image, whose structure is determined by the image height and the 
4115bd8deadSopenharmony_ci        parameters <swap_bytes>, <lsb_first>, <row_length>, <skip_rows>, <skip_pixels>, 
4125bd8deadSopenharmony_ci        <alignment>, <width>, <format>, and <type> given in the request. If <image_height>
4135bd8deadSopenharmony_ci        is not positive then the number of rows (i.e., the image height) is <height>;
4145bd8deadSopenharmony_ci        otherwise the number of rows is <image_height>.
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ci        <skip_images> allows a sub-volume of the 3-dimensional image to be selected.
4175bd8deadSopenharmony_ci        If <skip_images> is positive, then the pointer is advanced by <skip_images> 
4185bd8deadSopenharmony_ci        times the number of elements in one 2-dimensional image. Then <depth> 
4195bd8deadSopenharmony_ci        2-dimensional images are read, each having a subimage extracted in the 
4205bd8deadSopenharmony_ci        manner described in Appendix A of the GLX Protocol Specification.
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ciDependencies on EXT_abgr
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    If EXT_abgr is supported, the <format> parameter of TexImage3DEXT
4265bd8deadSopenharmony_ci    accepts ABGR_EXT.  Otherwise it does not.
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ciDependencies on EXT_texture
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci    EXT_texture is required.  All of the <components> tokens defined by
4315bd8deadSopenharmony_ci    EXT_texture are accepted by the <internalformat> parameter of
4325bd8deadSopenharmony_ci    TexImage3DEXT, with the same semantics that are defined by EXT_texture.
4335bd8deadSopenharmony_ci
4345bd8deadSopenharmony_ci    The query and error extensions defined by EXT_texture are extended in
4355bd8deadSopenharmony_ci    this document.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ciErrors
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    INVALID_ENUM is generated if <target> is not TEXTURE_3D_EXT or
4405bd8deadSopenharmony_ci    PROXY_TEXTURE_3D_EXT.
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    INVALID_ENUM is generated if the <target> parameter to
4435bd8deadSopenharmony_ci    GetTexParameteriv, GetTexParameterfv or GetTexImage is
4445bd8deadSopenharmony_ci    PROXY_TEXTURE_3D_EXT.
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci    INVALID_VALUE is generated if <level> is less than zero
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    INVALID_ENUM is generated if <internalformat> is not ALPHA, RGB, RGBA,
4495bd8deadSopenharmony_ci    LUMINANCE, LUMINANCE_ALPHA, or one of the tokens defined by the
4505bd8deadSopenharmony_ci    EXT_texture extension.  (Values 1, 2, 3, and 4 are not accepted as
4515bd8deadSopenharmony_ci    internal formats by TexImage3DEXT).
4525bd8deadSopenharmony_ci
4535bd8deadSopenharmony_ci    INVALID_VALUE is generated if <width>, <height>, or <depth> is less than
4545bd8deadSopenharmony_ci    zero, or cannot be represented as 2**k + 2*border for some integer k.
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci    INVALID_VALUE is generated if <border> is not 0 or 1.
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci    INVALID_ENUM is generated if <format> is not COLOR_INDEX, RED, GREEN,
4595bd8deadSopenharmony_ci    BLUE, ALPHA, RGB, RGBA, LUMINANCE, or LUMINANCE_ALPHA (or ABGR_EXT if
4605bd8deadSopenharmony_ci    EXT_abgr is supported).
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci    INVALID_ENUM is generated if <type> is not UNSIGNED_BYTE, BYTE,
4635bd8deadSopenharmony_ci    UNSIGNED_SHORT, SHORT, UNSIGNED_INT, INT, or FLOAT.
4645bd8deadSopenharmony_ci
4655bd8deadSopenharmony_ci    INVALID_OPERATION is generated if TexImage3DEXT is called between
4665bd8deadSopenharmony_ci    execution of Begin and the corresponding execution of End.
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci    TEXTURE_TOO_LARGE_EXT is generated if the texture as specified cannot be
4695bd8deadSopenharmony_ci    accommodated by the implementation.  This error will not occur if none
4705bd8deadSopenharmony_ci    of <width>, <height>, or <depth> is greater than MAX_3D_TEXTURE_SIZE_EXT.
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ciNew State
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci    Get Value                           Get Command             Type                    Initial Value           Attribute
4755bd8deadSopenharmony_ci    ---------                           -----------             ----                    -------------           ---------
4765bd8deadSopenharmony_ci    UNPACK_SKIP_IMAGES_EXT              GetIntegerv             Z+                      0                           -
4775bd8deadSopenharmony_ci    UNPACK_IMAGE_HEIGHT_EXT             GetIntegerv             Z+                      0                           -
4785bd8deadSopenharmony_ci    PACK_SKIP_IMAGES_EXT                GetIntegerv             Z+                      0                           -
4795bd8deadSopenharmony_ci    PACK_IMAGE_HEIGHT_EXT               GetIntegerv             Z+                      0                           -
4805bd8deadSopenharmony_ci    TEXTURE_3D_EXT                      IsEnabled               B                       FALSE                   texture/enable
4815bd8deadSopenharmony_ci    TEXTURE_WRAP_R_EXT                  GetTexParameteriv       1 x Z2                  REPEAT                  texture
4825bd8deadSopenharmony_ci    TEXTURE_DEPTH_EXT                   GetTexLevelParameteriv  1 x 2 x levels x Z+     0                           -
4835bd8deadSopenharmony_ci
4845bd8deadSopenharmony_ci    (old state with new type information)
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci    TEXTURE                             GetTexImage             3 x 1 x levels x I      null                        -
4875bd8deadSopenharmony_ci    TEXTURE_RED_SIZE_EXT                GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4885bd8deadSopenharmony_ci    TEXTURE_GREEN_SIZE_EXT              GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4895bd8deadSopenharmony_ci    TEXTURE_BLUE_SIZE_EXT               GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4905bd8deadSopenharmony_ci    TEXTURE_ALPHA_SIZE_EXT              GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4915bd8deadSopenharmony_ci    TEXTURE_LUMINANCE_SIZE_EXT          GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4925bd8deadSopenharmony_ci    TEXTURE_INTENSITY_SIZE_EXT          GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4935bd8deadSopenharmony_ci    TEXTURE_WIDTH                       GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4945bd8deadSopenharmony_ci    TEXTURE_HEIGHT                      GetTexLevelParameteriv  2 x 2 x levels x Z+     0                           -
4955bd8deadSopenharmony_ci    TEXTURE_BORDER                      GetTexLevelParameteriv  3 x 2 x levels x Z+     0                           -
4965bd8deadSopenharmony_ci    TEXTURE_COMPONENTS (1D and 2D)      GetTexLevelParameteriv  2 x 2 x levels x Z42    1                           -
4975bd8deadSopenharmony_ci    TEXTURE_COMPONENTS (3D)             GetTexLevelParameteriv  1 x 2 x levels x Z38    LUMINANCE                   -
4985bd8deadSopenharmony_ci    TEXTURE_BORDER_COLOR                GetTexParameteriv       3 x C                   0, 0, 0, 0              texture
4995bd8deadSopenharmony_ci    TEXTURE_MIN_FILTER                  GetTexParameteriv       3 x Z6                  NEAREST_MIPMAP_LINEAR   texture
5005bd8deadSopenharmony_ci    TEXTURE_MAG_FILTER                  GetTexParameteriv       3 x Z2                  LINEAR                  texture
5015bd8deadSopenharmony_ci    TEXTURE_WRAP_S                      GetTexParameteriv       3 x Z2                  REPEAT                  texture
5025bd8deadSopenharmony_ci    TEXTURE_WRAP_T                      GetTexParameteriv       2 x Z2                  REPEAT                  texture
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ciNew Implementation Dependent State
5055bd8deadSopenharmony_ci
5065bd8deadSopenharmony_ci    Get Value                           Get Command             Type            Minimum Value
5075bd8deadSopenharmony_ci    ---------                           -----------             ----            -------------
5085bd8deadSopenharmony_ci    MAX_3D_TEXTURE_SIZE_EXT             GetIntegerv             Z+              16
509