15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_texture_buffer_object
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_texture_buffer_object
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright (c) 2008-2013 The Khronos Group Inc. Copyright terms at
165bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciSpecification Update Policy
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
215bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
225bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
235bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
245bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
255bd8deadSopenharmony_ci    described in more detail at
265bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciStatus
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Approved by the ARB on July 11, 2008
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciVersion
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Last Modified Date:         06/04/2015
355bd8deadSopenharmony_ci    Revision:                   8
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciNumber
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    ARB Extension #51
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciDependencies
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    OpenGL 2.0 is required.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    NV_gpu_program4 or EXT_gpu_shader4 is required.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    This extension is written against the OpenGL 2.0 specification.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension depends trivially on EXT_texture_array.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension depends trivially on NV_texture_shader.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension depends trivially on EXT_texture_integer.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    This extension depends trivially on ARB_texture_float.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension depends trivially on ARB_half_float_pixel.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    This extension interacts with ARB_map_buffer_range.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ciOverview
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    This extension provides a new texture type, called a buffer texture.
645bd8deadSopenharmony_ci    Buffer textures are one-dimensional arrays of texels whose storage comes
655bd8deadSopenharmony_ci    from an attached buffer object.  When a buffer object is bound to a buffer
665bd8deadSopenharmony_ci    texture, a format is specified, and the data in the buffer object is
675bd8deadSopenharmony_ci    treated as an array of texels of the specified format.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    The use of a buffer object to provide storage allows the texture data to
705bd8deadSopenharmony_ci    be specified in a number of different ways:  via buffer object loads
715bd8deadSopenharmony_ci    (BufferData), direct CPU writes (MapBuffer), framebuffer readbacks
725bd8deadSopenharmony_ci    (EXT_pixel_buffer_object extension).  A buffer object can also be loaded
735bd8deadSopenharmony_ci    by transform feedback (NV_transform_feedback extension), which captures
745bd8deadSopenharmony_ci    selected transformed attributes of vertices processed by the GL.  Several
755bd8deadSopenharmony_ci    of these mechanisms do not require an extra data copy, which would be
765bd8deadSopenharmony_ci    required when using conventional TexImage-like entry points.
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    Buffer textures do not support mipmapping, texture lookups with normalized
795bd8deadSopenharmony_ci    floating-point texture coordinates, and texture filtering of any sort, and
805bd8deadSopenharmony_ci    may not be used in fixed-function fragment processing.  They can be
815bd8deadSopenharmony_ci    accessed via single texel fetch operations in programmable shaders.  For
825bd8deadSopenharmony_ci    assembly shaders (NV_gpu_program4), the TXF instruction is used.  For GLSL
835bd8deadSopenharmony_ci    (EXT_gpu_shader4), a new sampler type and texel fetch function are used.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    While buffer textures can be substantially larger than equivalent
865bd8deadSopenharmony_ci    one-dimensional textures; the maximum texture size supported for buffer
875bd8deadSopenharmony_ci    textures in the initial implementation of this extension is 2^27 texels,
885bd8deadSopenharmony_ci    versus 2^13 (8192) texels for otherwise equivalent one-dimensional
895bd8deadSopenharmony_ci    textures.  When a buffer object is attached to a buffer texture, a size is
905bd8deadSopenharmony_ci    not specified; rather, the number of texels in the texture is taken by
915bd8deadSopenharmony_ci    dividing the size of the buffer object by the size of each texel.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ciNew Procedures and Functions
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    void TexBufferARB(enum target, enum internalformat, uint buffer);
965bd8deadSopenharmony_ci    
975bd8deadSopenharmony_ciNew Tokens
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    Accepted by the <target> parameter of BindBuffer, BufferData,
1005bd8deadSopenharmony_ci    BufferSubData, MapBuffer, MapBufferRangeARB, BindTexture, UnmapBuffer,
1015bd8deadSopenharmony_ci    GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBufferARB,
1025bd8deadSopenharmony_ci    and the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, and
1035bd8deadSopenharmony_ci    GetIntegerv:
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci        TEXTURE_BUFFER_ARB                              0x8C2A
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    Accepted by the <pname> parameters of GetBooleanv, GetDoublev,
1085bd8deadSopenharmony_ci    GetFloatv, and GetIntegerv:
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci        MAX_TEXTURE_BUFFER_SIZE_ARB                     0x8C2B
1115bd8deadSopenharmony_ci        TEXTURE_BINDING_BUFFER_ARB                      0x8C2C
1125bd8deadSopenharmony_ci        TEXTURE_BUFFER_DATA_STORE_BINDING_ARB           0x8C2D
1135bd8deadSopenharmony_ci        TEXTURE_BUFFER_FORMAT_ARB                       0x8C2E
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    None.
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    (Insert new Section 3.8.4, Buffer Textures.  Renumber subsequent
1225bd8deadSopenharmony_ci    sections.)
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    In addition to one-, two-, and three-dimensional and cube map textures
1255bd8deadSopenharmony_ci    described in previous sections, one additional type of texture is
1265bd8deadSopenharmony_ci    supported.  A buffer texture is similar to a one-dimensional texture.
1275bd8deadSopenharmony_ci    However, unlike other texture types, the texel array is not stored as part
1285bd8deadSopenharmony_ci    of the texture.  Instead, a buffer object is attached to a buffer texture
1295bd8deadSopenharmony_ci    and the texel array is taken from the data store of an attached buffer
1305bd8deadSopenharmony_ci    object.  When the contents of a buffer object's data store are modified,
1315bd8deadSopenharmony_ci    those changes are reflected in the contents of any buffer texture to which
1325bd8deadSopenharmony_ci    the buffer object is attached.  Also unlike other textures, buffer
1335bd8deadSopenharmony_ci    textures do not have multiple image levels; only a single data store is
1345bd8deadSopenharmony_ci    available.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    The command
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci      void TexBufferARB(enum target, enum internalformat, uint buffer);
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    attaches the storage for the buffer object named <buffer> to the active
1415bd8deadSopenharmony_ci    buffer texture, and specifies an internal format for the texel array found
1425bd8deadSopenharmony_ci    in the attached buffer object.  If <buffer> is zero, any buffer object
1435bd8deadSopenharmony_ci    attached to the buffer texture is detached, and no new buffer object is
1445bd8deadSopenharmony_ci    attached.  If <buffer> is non-zero, but is not the name of an existing
1455bd8deadSopenharmony_ci    buffer object, the error INVALID_OPERATION is generated.  <target> must be
1465bd8deadSopenharmony_ci    TEXTURE_BUFFER_ARB.  <internalformat> specifies the storage format, and
1475bd8deadSopenharmony_ci    must be one of the sized internal formats found in Table X.1.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    When a buffer object is attached to a buffer texture, the buffer object's
1505bd8deadSopenharmony_ci    data store is taken as the texture's texel array.  The number of texels in
1515bd8deadSopenharmony_ci    the buffer texture's texel array is given by 
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci      floor(<buffer_size> / (<components> * sizeof(<base_type>)),
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    where <buffer_size> is the size of the buffer object, in basic machine
1565bd8deadSopenharmony_ci    units and <components> and <base_type> are the element count and base data
1575bd8deadSopenharmony_ci    type for elements, as specified in Table X.1.  The number of texels in the
1585bd8deadSopenharmony_ci    texel array is then clamped to the implementation-dependent limit
1595bd8deadSopenharmony_ci    MAX_TEXTURE_BUFFER_SIZE_ARB.  When a buffer texture is accessed in a
1605bd8deadSopenharmony_ci    shader, the results of a texel fetch are undefined if the specified texel
1615bd8deadSopenharmony_ci    number is greater than or equal to the clamped number of texels in the
1625bd8deadSopenharmony_ci    texel array.
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    When a buffer texture is accessed in a shader, an integer is provided to
1655bd8deadSopenharmony_ci    indicate the texel number being accessed.  If no buffer object is bound to
1665bd8deadSopenharmony_ci    the buffer texture, the results of the texel access are undefined.
1675bd8deadSopenharmony_ci    Otherwise, the attached buffer object's data store is interpreted as an
1685bd8deadSopenharmony_ci    array of elements of the GL data type corresponding to <internalformat>.
1695bd8deadSopenharmony_ci    Each texel consists of one to four elements that are mapped to texture
1705bd8deadSopenharmony_ci    components (R, G, B, A, L, and I).  Element <m> of the texel numbered <n>
1715bd8deadSopenharmony_ci    is taken from element <n> * <components> + <m> of the attached buffer
1725bd8deadSopenharmony_ci    object's data store.  Elements and texels are both numbered starting with
1735bd8deadSopenharmony_ci    zero.  For texture formats with normalized components, the extracted
1745bd8deadSopenharmony_ci    values are converted to floating-point values according to Table 2.9.  The
1755bd8deadSopenharmony_ci    components of the texture are then converted to an (R,G,B,A) vector
1765bd8deadSopenharmony_ci    according to Table X.21, and returned to the shader as a four-component
1775bd8deadSopenharmony_ci    result vector with components of the appropriate data type for the
1785bd8deadSopenharmony_ci    texture's internal format.  The base data type, component count,
1795bd8deadSopenharmony_ci    normalized component information, and mapping of data store elements to
1805bd8deadSopenharmony_ci    texture components is specified in Table X.1.
1815bd8deadSopenharmony_ci    
1825bd8deadSopenharmony_ci                                                             Component
1835bd8deadSopenharmony_ci      Sized Internal Format     Base Type  Components  Norm   0 1 2 3
1845bd8deadSopenharmony_ci      ------------------------  ---------  ----------  ----   -------
1855bd8deadSopenharmony_ci      ALPHA8                     ubyte         1        Y     A . . .
1865bd8deadSopenharmony_ci      ALPHA16                    ushort        1        Y     A . . .
1875bd8deadSopenharmony_ci      ALPHA16F_ARB               half          1        N     A . . .
1885bd8deadSopenharmony_ci      ALPHA32F_ARB               float         1        N     A . . .
1895bd8deadSopenharmony_ci      ALPHA8I_EXT                byte          1        N     A . . .
1905bd8deadSopenharmony_ci      ALPHA16I_EXT               short         1        N     A . . .
1915bd8deadSopenharmony_ci      ALPHA32I_EXT               int           1        N     A . . .
1925bd8deadSopenharmony_ci      ALPHA8UI_EXT               ubyte         1        N     A . . .
1935bd8deadSopenharmony_ci      ALPHA16UI_EXT              ushort        1        N     A . . .
1945bd8deadSopenharmony_ci      ALPHA32UI_EXT              uint          1        N     A . . .
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci      LUMINANCE8                 ubyte         1        Y     L . . .
1975bd8deadSopenharmony_ci      LUMINANCE16                ushort        1        Y     L . . .
1985bd8deadSopenharmony_ci      LUMINANCE16F_ARB           half          1        N     L . . .
1995bd8deadSopenharmony_ci      LUMINANCE32F_ARB           float         1        N     L . . .
2005bd8deadSopenharmony_ci      LUMINANCE8I_EXT            byte          1        N     L . . .
2015bd8deadSopenharmony_ci      LUMINANCE16I_EXT           short         1        N     L . . .
2025bd8deadSopenharmony_ci      LUMINANCE32I_EXT           int           1        N     L . . .
2035bd8deadSopenharmony_ci      LUMINANCE8UI_EXT           ubyte         1        N     L . . .
2045bd8deadSopenharmony_ci      LUMINANCE16UI_EXT          ushort        1        N     L . . .
2055bd8deadSopenharmony_ci      LUMINANCE32UI_EXT          uint          1        N     L . . .
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci      LUMINANCE8_ALPHA8          ubyte         2        Y     L A . .
2085bd8deadSopenharmony_ci      LUMINANCE16_ALPHA16        ushort        2        Y     L A . .
2095bd8deadSopenharmony_ci      LUMINANCE_ALPHA16F_ARB     half          2        N     L A . .
2105bd8deadSopenharmony_ci      LUMINANCE_ALPHA32F_ARB     float         2        N     L A . .
2115bd8deadSopenharmony_ci      LUMINANCE_ALPHA8I_EXT      byte          2        N     L A . .
2125bd8deadSopenharmony_ci      LUMINANCE_ALPHA16I_EXT     short         2        N     L A . .
2135bd8deadSopenharmony_ci      LUMINANCE_ALPHA32I_EXT     int           2        N     L A . .
2145bd8deadSopenharmony_ci      LUMINANCE_ALPHA8UI_EXT     ubyte         2        N     L A . .
2155bd8deadSopenharmony_ci      LUMINANCE_ALPHA16UI_EXT    ushort        2        N     L A . .
2165bd8deadSopenharmony_ci      LUMINANCE_ALPHA32UI_EXT    uint          2        N     L A . .
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci      INTENSITY8                 ubyte         1        Y     I . . .
2195bd8deadSopenharmony_ci      INTENSITY16                ushort        1        Y     I . . .
2205bd8deadSopenharmony_ci      INTENSITY16F_ARB           half          1        N     I . . .
2215bd8deadSopenharmony_ci      INTENSITY32F_ARB           float         1        N     I . . .
2225bd8deadSopenharmony_ci      INTENSITY8I_EXT            byte          1        N     I . . .
2235bd8deadSopenharmony_ci      INTENSITY16I_EXT           short         1        N     A . . .
2245bd8deadSopenharmony_ci      INTENSITY32I_EXT           int           1        N     A . . .
2255bd8deadSopenharmony_ci      INTENSITY8UI_EXT           ubyte         1        N     A . . .
2265bd8deadSopenharmony_ci      INTENSITY16UI_EXT          ushort        1        N     A . . .
2275bd8deadSopenharmony_ci      INTENSITY32UI_EXT          uint          1        N     A . . .
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci      RGBA8                      ubyte         4        Y     R G B A
2305bd8deadSopenharmony_ci      RGBA16                     ushort        4        Y     R G B A
2315bd8deadSopenharmony_ci      RGBA16F_ARB                half          4        N     R G B A
2325bd8deadSopenharmony_ci      RGBA32F_ARB                float         4        N     R G B A
2335bd8deadSopenharmony_ci      RGBA8I_EXT                 byte          4        N     R G B A
2345bd8deadSopenharmony_ci      RGBA16I_EXT                short         4        N     R G B A
2355bd8deadSopenharmony_ci      RGBA32I_EXT                int           4        N     R G B A
2365bd8deadSopenharmony_ci      RGBA8UI_EXT                ubyte         4        N     R G B A
2375bd8deadSopenharmony_ci      RGBA16UI_EXT               ushort        4        N     R G B A
2385bd8deadSopenharmony_ci      RGBA32UI_EXT               uint          4        N     R G B A
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci      Table X.1, Internal Formats for Buffer Textures.  For each format, the
2415bd8deadSopenharmony_ci      data type of each element is indicated in the "Base Type" column and the
2425bd8deadSopenharmony_ci      element count is in the "Components" column.  The "Norm" column
2435bd8deadSopenharmony_ci      indicates whether components should be treated as normalized
2445bd8deadSopenharmony_ci      floating-point values.  The "Component 0, 1, 2, and 3" columns indicate
2455bd8deadSopenharmony_ci      the mapping of each element of a texel to texture components.
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci    In addition to attaching buffer objects to textures, buffer objects can be
2485bd8deadSopenharmony_ci    bound to the buffer object target named TEXTURE_BUFFER_ARB, in order to
2495bd8deadSopenharmony_ci    specify, modify, or read the buffer object's data store.  The buffer
2505bd8deadSopenharmony_ci    object bound to TEXTURE_BUFFER_ARB has no effect on rendering.  A buffer
2515bd8deadSopenharmony_ci    object is bound to TEXTURE_BUFFER_ARB by calling BindBuffer with <target>
2525bd8deadSopenharmony_ci    set to TEXTURE_BUFFER_ARB.  If no corresponding buffer object exists, one
2535bd8deadSopenharmony_ci    is initialized as defined in section 2.9.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    The commands BufferData, BufferSubData, MapBuffer, and UnmapBuffer may all
2565bd8deadSopenharmony_ci    be used with <target> set to TEXTURE_BUFFER_ARB.  In this case, these
2575bd8deadSopenharmony_ci    commands operate in the same fashion as described in section 2.9, but on
2585bd8deadSopenharmony_ci    the buffer currently bound to the TEXTURE_BUFFER_ARB target.
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    Modify Section 3.8.11, Texture State and Proxy State (p. 178)
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    (insert into the first paragraph of the section, p. 178) ... a zero
2635bd8deadSopenharmony_ci    compressed size, and zero-sized components).  The buffer texture target
2645bd8deadSopenharmony_ci    contains an integer identifying the buffer object that buffer that
2655bd8deadSopenharmony_ci    provided the data store for the texture, initially zero, and an integer
2665bd8deadSopenharmony_ci    identifying the internal format of the texture, initially LUMINANCE8.
2675bd8deadSopenharmony_ci    Next, there are the two sets of texture properties; ...
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci    Modify Section 3.8.12, Texture Objects (p. 180)
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    (modify first paragraphs of section, p. 180, simply adding references to
2725bd8deadSopenharmony_ci     buffer textures, which are treated as texture objects)
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    In addition to the default textures TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
2755bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, and TEXTURE_BUFFER_ARB, named one-, two-, and
2765bd8deadSopenharmony_ci    three-dimensional, cube map, and buffer texture objects can be created and
2775bd8deadSopenharmony_ci    operated upon. The name space for texture objects is the unsigned
2785bd8deadSopenharmony_ci    integers, with zero reserved by the GL.
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    A texture object is created by binding an unused name to TEXTURE_1D,
2815bd8deadSopenharmony_ci    TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or TEXTURE_BUFFER_ARB. The
2825bd8deadSopenharmony_ci    binding is effected by calling
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci      void BindTexture( enum target, uint texture );
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    with target set to the desired texture target and texture set to the
2875bd8deadSopenharmony_ci    unused name.  The resulting texture object is a new state vector,
2885bd8deadSopenharmony_ci    comprising all the state values listed in section 3.8.11, set to the same
2895bd8deadSopenharmony_ci    initial values. If the new texture object is bound to TEXTURE_1D,
2905bd8deadSopenharmony_ci    TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or TEXTURE_BUFFER_ARB, it is and
2915bd8deadSopenharmony_ci    remains a one-, two-, three-dimensional, cube map, or buffer texture
2925bd8deadSopenharmony_ci    respectively until it is deleted.
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    BindTexture may also be used to bind an existing texture object to either
2955bd8deadSopenharmony_ci    TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or
2965bd8deadSopenharmony_ci    TEXTURE_BUFFER_ARB. The error INVALID_OPERATION is generated if an attempt
2975bd8deadSopenharmony_ci    is made to bind a texture object of different dimensionality than the
2985bd8deadSopenharmony_ci    specified target. If the bind is successful no change is made to the state
2995bd8deadSopenharmony_ci    of the bound texture object, and any previous binding to target is broken.
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    ...
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
3045bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, and TEXTURE_BUFFER_ARB have one-, two-,
3055bd8deadSopenharmony_ci    three-dimensional, cube map, and buffer texture state vectors respectively
3065bd8deadSopenharmony_ci    associated with them. In order that access to these initial textures not
3075bd8deadSopenharmony_ci    be lost, they are treated as texture objects all of whose names are 0. The
3085bd8deadSopenharmony_ci    initial one-, two-, three-dimensional, cube map, and buffer texture is
3095bd8deadSopenharmony_ci    therefore operated upon, queried, and applied as TEXTURE_1D, TEXTURE_2D,
3105bd8deadSopenharmony_ci    TEXTURE_3D, TEXTURE_CUBE_MAP, or TEXTURE_BUFFER_ARB respectively while 0
3115bd8deadSopenharmony_ci    is bound to the corresponding targets.
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    Texture objects are deleted by calling
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci      void DeleteTextures( sizei n, uint *textures );
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    textures contains n names of texture objects to be deleted. After a
3185bd8deadSopenharmony_ci    texture object is deleted, it has no contents or dimensionality, and its
3195bd8deadSopenharmony_ci    name is again unused. If a texture that is currently bound to one of the
3205bd8deadSopenharmony_ci    targets TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or
3215bd8deadSopenharmony_ci    TEXTURE_BUFFER_ARB is deleted, it is as though BindTexture had been
3225bd8deadSopenharmony_ci    executed with the same target and texture zero. Unused names in textures
3235bd8deadSopenharmony_ci    are silently ignored, as is the value zero.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    (modify second paragraph, p. 182, adding buffer textures, plus cube map
3265bd8deadSopenharmony_ci    textures, which is an oversight in the core specification)
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci    The texture object name space, including the initial one-, two-, and
3295bd8deadSopenharmony_ci    three-dimensional, cube map, and buffer texture objects, is shared among
3305bd8deadSopenharmony_ci    all texture units. A texture object may be bound to more than one texture
3315bd8deadSopenharmony_ci    unit simultaneously. After a texture object is bound, any GL operations on
3325bd8deadSopenharmony_ci    that target object affect any other texture units to which the same
3335bd8deadSopenharmony_ci    texture object is bound.
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment
3365bd8deadSopenharmony_ciOperations and the Frame Buffer)
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ci    None.
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci    Modify Section 5.4, Display Lists (p. 237)
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    (modify "Vertex buffer objects" portion of the list of non-listable
3455bd8deadSopenharmony_ci    commands, p. 241)
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci      Buffer objects: GenBuffers, DeleteBuffers, BindBuffer, BufferData,
3485bd8deadSopenharmony_ci      BufferSubData, MapBuffer, UnmapBuffer, and TexBufferARB.
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and
3515bd8deadSopenharmony_ciState Requests)
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci    Modify Section 6.1.13, Buffer Object Queries (p. 255)
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    (modify the first paragraph on p. 256) The command
3565bd8deadSopenharmony_ci    
3575bd8deadSopenharmony_ci      void GetBufferSubData( enum target, intptr offset,
3585bd8deadSopenharmony_ci                             sizeiptr size, void *data );
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    queries the data contents of a buffer object. target is ARRAY_BUFFER,
3615bd8deadSopenharmony_ci    ELEMENT_ARRAY_BUFFER, or TEXTURE_BUFFER_ARB. ...
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci    (modify the last paragraph of the section, p. 256) While the data store of
3645bd8deadSopenharmony_ci    a buffer object is mapped, the pointer to the data store can be queried by
3655bd8deadSopenharmony_ci    calling
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci      void GetBufferPointerv( enum target, enum pname, void **params );
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci    with target set to ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, or
3705bd8deadSopenharmony_ci    TEXTURE_BUFFER_ARB, and pname set to BUFFER MAP POINTER.
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance)
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci    None.
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci    None.
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ciDependencies on EXT_texture_array
3815bd8deadSopenharmony_ci
3825bd8deadSopenharmony_ci    If EXT_texture_array is supported, the introductory language describing
3835bd8deadSopenharmony_ci    buffer textures should acknowledge the existence of array textures.  Other
3845bd8deadSopenharmony_ci    than that, there are no dependencies between the two extensions.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ciDependencies on NV_texture_shader
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci    If NV_texture_shader is not supported, references to the signed normalized
3895bd8deadSopenharmony_ci    internal formats provided by that extension should be removed, and such
3905bd8deadSopenharmony_ci    formats may not be passed to TexBufferARB.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ciDependencies on EXT_texture_integer
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci    If EXT_texture_integer is not supported, references to the signed and
3955bd8deadSopenharmony_ci    unsigned integer internal formats provided by that extension should be
3965bd8deadSopenharmony_ci    removed, and such formats may not be passed to TexBufferARB.
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ciDependencies on ARB_texture_float
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci    If ARB_texture_float is not supported, references to the floating-point
4015bd8deadSopenharmony_ci    internal formats provided by that extension should be removed, and such
4025bd8deadSopenharmony_ci    formats may not be passed to TexBufferARB.
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ciDependencies on ARB_half_float_pixel
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci    If ARB_texture_float is not supported, references to the 16-bit
4075bd8deadSopenharmony_ci    floating-point internal formats provided by ARB_texture_float should be
4085bd8deadSopenharmony_ci    removed, and such formats may not be passed to TexBufferARB.  If an
4095bd8deadSopenharmony_ci    implementation supports ARB_texture_float, but does not support
4105bd8deadSopenharmony_ci    ARB_half_float_pixel, 16-bit floating-point texture formats may be
4115bd8deadSopenharmony_ci    available using normal texture mechanisms, but not with buffer textures.
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ciGLX Protocol
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    The following rendering command is sent to the server as
4165bd8deadSopenharmony_ci    a part of glXRender request:
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    TexBufferARB
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci        2       16              rendering command length
4215bd8deadSopenharmony_ci        2       367             rendering command opcode
4225bd8deadSopenharmony_ci        4       ENUM            target
4235bd8deadSopenharmony_ci        4       ENUM            internalformat
4245bd8deadSopenharmony_ci        4       CARD32          buffer
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ciErrors
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexBufferARB if <buffer> is non-zero and
4295bd8deadSopenharmony_ci    is not the name of an existing buffer object.
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ciNew State
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    (add to table 6.15, Texture State Per Texture Unit/Binding Point p. 276)
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci                                                            Initial
4365bd8deadSopenharmony_ci    Get Value                           Type    Get Command  Value  Description                 Sec.    Attribute
4375bd8deadSopenharmony_ci    ---------------------------------   ----    ----------- ------- --------------------------- ------  ---------
4385bd8deadSopenharmony_ci    TEXTURE_BINDING_BUFFER_ARB          2*xZ+   GetIntegerv    0    Texture object bound to     3.8.12  texture
4395bd8deadSopenharmony_ci                                                                    TEXTURE_BUFFER_ARB
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    (add to table 6.16, Texture State Per Texture Object, p. 276)
4425bd8deadSopenharmony_ci
4435bd8deadSopenharmony_ci                                                            Initial
4445bd8deadSopenharmony_ci    Get Value                           Type    Get Command  Value  Description                 Sec.    Attribute
4455bd8deadSopenharmony_ci    ---------------------------------   ----    ----------- ------- --------------------------- ------  ---------
4465bd8deadSopenharmony_ci    TEXTURE_BUFFER_DATA_STORE_          nxZ+    GetIntegerv    0    Buffer object bound as      3.8.12  texture
4475bd8deadSopenharmony_ci      BINDING_ARB                                                   the data store for the 
4485bd8deadSopenharmony_ci                                                                    active image unit's buffer
4495bd8deadSopenharmony_ci                                                                    texture
4505bd8deadSopenharmony_ci    TEXTURE_BUFFER_FORMAT_ARB           nxZ+    GetIntegerv  LUMIN- Internal format for the     3.8.12  texture
4515bd8deadSopenharmony_ci                                                             ANCE8  active image unit's buffer
4525bd8deadSopenharmony_ci                                                                    texture
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci    (add to table 6.37, Miscellaneous State, p. 298)
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci                                                            Initial
4575bd8deadSopenharmony_ci    Get Value                           Type    Get Command  Value  Description                 Sec.    Attribute
4585bd8deadSopenharmony_ci    ---------------------------------   ----    ----------- ------- --------------------------- ------  ---------
4595bd8deadSopenharmony_ci    TEXTURE_BUFFER_ARB                   Z+     GetIntegerv    0    Buffer object bound to      3.8.12  texture
4605bd8deadSopenharmony_ci                                                                    the generic buffer texture
4615bd8deadSopenharmony_ci                                                                    binding point
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ciNew Implementation Dependent State
4645bd8deadSopenharmony_ci
4655bd8deadSopenharmony_ci    (modify Table 6.32, p. 293)
4665bd8deadSopenharmony_ci                                                    Minimum
4675bd8deadSopenharmony_ci    Get Value                    Type  Get Command   Value   Description            Sec.   Attribute
4685bd8deadSopenharmony_ci    ---------------------------  ----  -----------  -------  ---------------------  -----  ---------
4695bd8deadSopenharmony_ci    MAX_TEXTURE_BUFFER_SIZE_ARB   Z+   GetIntegerv   65536   number of addressable  3.8.4      -
4705bd8deadSopenharmony_ci                                                             texels for buffer
4715bd8deadSopenharmony_ci                                                             textures
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ciIssues
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci    (1) Buffer textures are potentially large one-dimensional arrays that can
4765bd8deadSopenharmony_ci        be accessed with single-texel fetches.  How should this functionality
4775bd8deadSopenharmony_ci        be exposed?
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci      RESOLVED:  Several options were considered.  The final approach creates
4805bd8deadSopenharmony_ci      a new type of texture object, called a buffer texture, whose texel array
4815bd8deadSopenharmony_ci      is taken from the data store from a buffer object.  The combined set of
4825bd8deadSopenharmony_ci      extensions using buffer objects provides numerous locations where the GL
4835bd8deadSopenharmony_ci      can read and write data to a buffer object:
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci        EXT_vertex_buffer_object allows vertex attributes to be pulled from a
4865bd8deadSopenharmony_ci        buffer object.
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ci        EXT_pixel_buffer_object allows pixel operations (DrawPixels,
4895bd8deadSopenharmony_ci        ReadPixels, TexImage) to read or write data to a buffer object.
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci        EXT_parameter_buffer_object and EXT_bindable_uniform allows assembly
4925bd8deadSopenharmony_ci        vertex, fragment, and geometry programs, and all GLSL shaders to read
4935bd8deadSopenharmony_ci        program parameter / uniform data from a buffer object.
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci        ARB_texture_buffer_object allows programs to read texture data from a
4965bd8deadSopenharmony_ci        buffer object.
4975bd8deadSopenharmony_ci
4985bd8deadSopenharmony_ci        NV_transform_feedback allows programs to write transformed vertex
4995bd8deadSopenharmony_ci        attributes to a buffer object.
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ci      When combined, interesting feedback paths are possible, where large
5025bd8deadSopenharmony_ci      arrays of data can be generated by the GPU and the consumed by it in
5035bd8deadSopenharmony_ci      multi-pass algorithms, using the buffer object's storage to hold
5045bd8deadSopenharmony_ci      intermediate data.  This allows applications to run complicated
5055bd8deadSopenharmony_ci      algorithms on the GPU without necessarily pulling data back to host CPU
5065bd8deadSopenharmony_ci      for additional processing.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci      Given that buffer object memory is visible to users as raw memory, all
5095bd8deadSopenharmony_ci      uses of the memory must have well-defined data formats.  For VBO and
5105bd8deadSopenharmony_ci      PBO, those formats are explicitly given by calls such as VertexPointer,
5115bd8deadSopenharmony_ci      TexImage2D, or ReadPixels.  When used as a buffer texture, it is
5125bd8deadSopenharmony_ci      necessary to specify an internal format with which the bytes of the
5135bd8deadSopenharmony_ci      buffer object's data store are interpreted.
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci      Another option considered was to greatly increase the maximum texture
5165bd8deadSopenharmony_ci      size for 1D texture.  This has the advantage of not requiring new
5175bd8deadSopenharmony_ci      mechanisms.  However, there are a couple limitations of this approach.
5185bd8deadSopenharmony_ci      First, conventional textures have their own storage that is not
5195bd8deadSopenharmony_ci      accessible elsewhere, which limits some of the sharing opportunities
5205bd8deadSopenharmony_ci      described above.  Second, buffer textures do have slightly different
5215bd8deadSopenharmony_ci      hardware implementations than 1D textures.  In the hardware of interest,
5225bd8deadSopenharmony_ci      "normal" 1D textures can be mipmapped and filtered, but have a maximum
5235bd8deadSopenharmony_ci      size that is considerably smaller than that supported for buffer
5245bd8deadSopenharmony_ci      textures.  If both texture types used the same API mechanism, it might
5255bd8deadSopenharmony_ci      be necessary to reprogram texture hardware and/or shaders depending on
5265bd8deadSopenharmony_ci      the size of the textures used.  This will incur CPU overhead to
5275bd8deadSopenharmony_ci      determine if such reprogramming is necessary and to perform the
5285bd8deadSopenharmony_ci      reprogramming if so.
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    (2) Since buffer textures borrow storage from buffer objects, whose
5315bd8deadSopenharmony_ci        storage is visible to applications, a format must be imposed on the
5325bd8deadSopenharmony_ci        bytes of the buffer object.  What texture formats are supported for
5335bd8deadSopenharmony_ci        buffer objects?
5345bd8deadSopenharmony_ci
5355bd8deadSopenharmony_ci      RESOLVED:  All sized one-, two-, and four-component internal formats
5365bd8deadSopenharmony_ci      with 8-, 16-, and 32-bit components are supported.  Unsized internal
5375bd8deadSopenharmony_ci      formats, and sized formats with other component sizes are also not
5385bd8deadSopenharmony_ci      supported.  Three-component (RGB) formats are not supported due to
5395bd8deadSopenharmony_ci      hardware limitations.
5405bd8deadSopenharmony_ci
5415bd8deadSopenharmony_ci      All component data types supported for normal textures are also
5425bd8deadSopenharmony_ci      supported for buffer textures.  This includes unsigned [0,1] normalized
5435bd8deadSopenharmony_ci      components (e.g., RGBA8), floating-point components from
5445bd8deadSopenharmony_ci      ARB_texture_float (e.g., RGBA32F_ARB), signed and unsigned integer
5455bd8deadSopenharmony_ci      components from EXT_texture_integer (e.g., RGBA8I_EXT, RGBA16UI_EXT),
5465bd8deadSopenharmony_ci      and signed [-1,+1] normalized components from NV_texture_shader (e.g.,
5475bd8deadSopenharmony_ci      SIGNED_RGBA8_NV).
5485bd8deadSopenharmony_ci
5495bd8deadSopenharmony_ci    (3) How can arrays of three-component vectors be accessed by applications?
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci      RESOLVED:  Several approaches are possible.  
5525bd8deadSopenharmony_ci
5535bd8deadSopenharmony_ci      First, the vectors can be padded out to four components (RGBA), with an
5545bd8deadSopenharmony_ci      extra unused component for each texel.  This has a couple undesirable
5555bd8deadSopenharmony_ci      properties:  it adds 33% to the required storage and adding the extra
5565bd8deadSopenharmony_ci      component may require reformatting of original data generated by the
5575bd8deadSopenharmony_ci      application.  However, the data in this format can be retrieved with a
5585bd8deadSopenharmony_ci      single 32-, 64-, or 128-bit lookup.  
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ci      Alternately, the buffer texture can be defined using a single component,
5615bd8deadSopenharmony_ci      and a shader can perform three lookups to separately fetch texels 3*N,
5625bd8deadSopenharmony_ci      3*N+1, and 3*N+2, combining the result in a three-component vector
5635bd8deadSopenharmony_ci      representing "RGB" texel N.  This doesn't require extra storage or
5645bd8deadSopenharmony_ci      reformatting and doesn't require additional bandwidth for texture
5655bd8deadSopenharmony_ci      fetches.  But it does require additional shader instructions to obtain
5665bd8deadSopenharmony_ci      each texel.
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci    (4) Does this extension support fixed-function fragment processing,
5695bd8deadSopenharmony_ci        somehow allowing buffer textures to be accessed without programmable
5705bd8deadSopenharmony_ci        shaders?
5715bd8deadSopenharmony_ci
5725bd8deadSopenharmony_ci      RESOLVED:  No.  We expect that it would be difficult to properly access
5735bd8deadSopenharmony_ci      a buffer texture and combine the returned texel with other color or
5745bd8deadSopenharmony_ci      texture data, given the extremely limited programming model provided by
5755bd8deadSopenharmony_ci      fixed-function fragment processing.
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci      Note also that the single-precision floating-point representation
5785bd8deadSopenharmony_ci      commonly used by current graphics hardware is not sufficiently precise
5795bd8deadSopenharmony_ci      to exactly represent all texels in a large buffer texture.  For example,
5805bd8deadSopenharmony_ci      it is not possible to represent 2^24+1 using the 32-bit IEEE
5815bd8deadSopenharmony_ci      floating-point representation.
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci    (5) What happens if a buffer object is deleted or respecified when bound
5845bd8deadSopenharmony_ci        to a buffer texture?
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci      RESOLVED: BufferData is allowed to be used to update a buffer object that
5875bd8deadSopenharmony_ci      has already been bound to a texture with TexBuffer. The update to the data
5885bd8deadSopenharmony_ci      is not guaranteed to affect the texture until next time it is bound to a
5895bd8deadSopenharmony_ci      texture image unit.  When DeleteBuffers is called, any buffer that is
5905bd8deadSopenharmony_ci      bound to a texture is removed from the names array, but remains as long as
5915bd8deadSopenharmony_ci      it is bound to a texture.  The buffer is fully removed when the texture
5925bd8deadSopenharmony_ci      unbinds it or when the texture buffer object is deleted.
5935bd8deadSopenharmony_ci
5945bd8deadSopenharmony_ci    (6) Should applications be able to modify the data store of a buffer
5955bd8deadSopenharmony_ci        object while it is bound to a buffer texture?
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci      RESOLVED: An application is allowed to update the data store for a buffer
5985bd8deadSopenharmony_ci      object when the buffer object is bound to a texture.
5995bd8deadSopenharmony_ci
6005bd8deadSopenharmony_ci    (7) Do buffer textures support texture parameters (TexParameter) or
6015bd8deadSopenharmony_ci        queries (GetTexParameter, GetTexLevelParameter, GetTexImage)?
6025bd8deadSopenharmony_ci
6035bd8deadSopenharmony_ci      RESOLVED:  No.  None of the existing parameters apply to buffer
6045bd8deadSopenharmony_ci      textures, and this extension doesn't introduce the need for any new
6055bd8deadSopenharmony_ci      ones.  Buffer textures have no levels, and the size in texels is
6065bd8deadSopenharmony_ci      implicit (based on the data store).  Given that the texels themselves
6075bd8deadSopenharmony_ci      are obtained from a buffer object, it seems more appropriate to retrieve
6085bd8deadSopenharmony_ci      such data with buffer object queries.  The only "parameter" of a buffer
6095bd8deadSopenharmony_ci      texture is the internal format, which is specified at the same time the
6105bd8deadSopenharmony_ci      buffer object is bound.
6115bd8deadSopenharmony_ci
6125bd8deadSopenharmony_ci      Note that the spec edits above don't add explicit error language for any
6135bd8deadSopenharmony_ci      of these cases.  That is because each of the functions enumerate the set
6145bd8deadSopenharmony_ci      of valid <target> parameters.  Not editing the spec to allow
6155bd8deadSopenharmony_ci      TEXTURE_BUFFER_ARB in these cases means that target is not legal, and an
6165bd8deadSopenharmony_ci      INVALID_ENUM error should be generated.
6175bd8deadSopenharmony_ci
6185bd8deadSopenharmony_ci    (8) What about indirect rendering with a mix of big- and little-endian
6195bd8deadSopenharmony_ci        clients?  If components are 16- or 32-bit, how are they interpreted?
6205bd8deadSopenharmony_ci
6215bd8deadSopenharmony_ci      RESOLVED:  Buffer object data are interpreted according to the native
6225bd8deadSopenharmony_ci      representation of the server.  If the server and client have different
6235bd8deadSopenharmony_ci      endianness, applications must perform byte swapping as needed to match
6245bd8deadSopenharmony_ci      the server's representation.  No mechanism is provided to perform this
6255bd8deadSopenharmony_ci      byte swapping on buffer object updates or when texels are fetched.
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci      The same problem also exists when buffer objects are used for vertex
6285bd8deadSopenharmony_ci      arrays (VBO).  For buffer objects used for pixel packing and unpacking
6295bd8deadSopenharmony_ci      (ARB_pixel_buffer_object), the PixelStore byte swapping parameters
6305bd8deadSopenharmony_ci      (PACK_SWAP_BYTES, UNPACK_SWAP_BYTES) would presumably apply and could be
6315bd8deadSopenharmony_ci      used to perform the necessary byte swapping.
6325bd8deadSopenharmony_ci
6335bd8deadSopenharmony_ci    (9) Should the set of formats supported for buffer textures be enumerated,
6345bd8deadSopenharmony_ci        or should the extension instead nominally support all formats, but
6355bd8deadSopenharmony_ci        accept only an implementation-dependent subset?
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci      RESOLVED:  Provide a specified set of supported formats.  This
6385bd8deadSopenharmony_ci      extension simply enumerates all 8-, 16-, and 32-byte internal formats
6395bd8deadSopenharmony_ci      with 1, 2, or 4 components, and specifies the mapping of unformatted
6405bd8deadSopenharmony_ci      buffer object data to texture components.  A follow-on extension could
6415bd8deadSopenharmony_ci      be done to support 3-component texels when better native hardware
6425bd8deadSopenharmony_ci      support is available.  
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci      Other than 3-component texels, the set of formats supported seems pretty
6455bd8deadSopenharmony_ci      compehensive.  We expect that buffer textures would be used for general
6465bd8deadSopenharmony_ci      computational tasks, where there is little need for formats with smaller
6475bd8deadSopenharmony_ci      components (e.g., RGBA4444).  Such formats are generally not supported
6485bd8deadSopenharmony_ci      natively on CPUs today.  With the general computational model provided
6495bd8deadSopenharmony_ci      by NV_gpu_program4 and EXT_gpu_shader4, it would be possible to treat
6505bd8deadSopenharmony_ci      such "packed" formats as larger single-component formats and unpack them
6515bd8deadSopenharmony_ci      with a small number of shader instructions.
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci      If and when double-precision floats or 64-bit integers are supported as
6545bd8deadSopenharmony_ci      basic types usable by shaders, we would expect that an extension would
6555bd8deadSopenharmony_ci      add new texture internal formats with 64-bit components and that those
6565bd8deadSopenharmony_ci      formats would also be supported for general-purpose textures and buffer
6575bd8deadSopenharmony_ci      textures as well.
6585bd8deadSopenharmony_ci
6595bd8deadSopenharmony_ci    (10) How are buffer textures supported in GLSL?
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci      RESOLVED:  Create a new sampler type (samplerBuffer) for buffer textures
6625bd8deadSopenharmony_ci      and add a new lookup function (texelFetchBuffer) to explicitly access
6635bd8deadSopenharmony_ci      them using texture hardware.
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci      Other possibilities considered included extending the notion of bindable
6665bd8deadSopenharmony_ci      uniforms to support uniforms whose corresponding buffer objects can be
6675bd8deadSopenharmony_ci      bound to texture resources (e.g., "texture bindable uniform" instead of
6685bd8deadSopenharmony_ci      "bindable uniform").  We also considered automatically assigning
6695bd8deadSopenharmony_ci      bindable uniforms to texture or shader resources as appropriate.  Note
6705bd8deadSopenharmony_ci      that the restrictions, size limits, and performance characterstics of
6715bd8deadSopenharmony_ci      buffer textures and parameter buffers (NV_parameter_buffer_object)
6725bd8deadSopenharmony_ci      differ.  Automatic handling of uniforms adds driver complexity and may
6735bd8deadSopenharmony_ci      tend to hide performance characteristics since it isn't clear what
6745bd8deadSopenharmony_ci      resource would be used for what variable.  Additionally, it could
6755bd8deadSopenharmony_ci      require shader recompilation if the size of a uniform array is variable,
6765bd8deadSopenharmony_ci      and the hardware resource used depended on the size.  
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci      In the end, the texture approach seemed the simplest, and we chose that.
6795bd8deadSopenharmony_ci      It might be worth doing something more complex in the future.
6805bd8deadSopenharmony_ci
6815bd8deadSopenharmony_ci    (11) What is the TEXTURE_BUFFER_ARB buffer object binding point good for?
6825bd8deadSopenharmony_ci
6835bd8deadSopenharmony_ci      RESOLVED:  It can be used for loading data into buffer objects, and for
6845bd8deadSopenharmony_ci      mapping and unmapping buffers, both without disturbing other binding
6855bd8deadSopenharmony_ci      points.  Otherwise, it has no effect on GL operations, since buffer
6865bd8deadSopenharmony_ci      objects are bound to textures using the TexBufferARB() command that does
6875bd8deadSopenharmony_ci      not affect the buffer object binding point.
6885bd8deadSopenharmony_ci
6895bd8deadSopenharmony_ci      Buffer object binding points have mixed usage.  In the
6905bd8deadSopenharmony_ci      EXT_vertex_buffer_object extension (OpenGL 1.5), there are two binding
6915bd8deadSopenharmony_ci      points.  The ELEMENT_ARRAY_BUFFER has a direct effect on rendering, as
6925bd8deadSopenharmony_ci      it modifies DrawElements() calls.  The effect of ARRAY_BUFFER is much
6935bd8deadSopenharmony_ci      more indirect; it is only used to affect subsequent vertex array calls
6945bd8deadSopenharmony_ci      (e.g., VertexPointer) and has no direct effect on rendering.  The reason
6955bd8deadSopenharmony_ci      for this is that the API was retrofitted on top of existing vertex array
6965bd8deadSopenharmony_ci      APIs.  If a new vertex array API were created that emphasized or even
6975bd8deadSopenharmony_ci      required the use of buffer objects, it seems likely that the buffer
6985bd8deadSopenharmony_ci      object would be included in the calls equivalent to today's
6995bd8deadSopenharmony_ci      VertexPointer() call.
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci    (12) How is the various buffer texture-related state queried?
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci      RESOLVED:  There are three pieces of state that can be queried:  (a) the
7045bd8deadSopenharmony_ci      texture object bound to buffer texture binding point for the active
7055bd8deadSopenharmony_ci      texture image unit, (b) the buffer object whose data store was used by
7065bd8deadSopenharmony_ci      that texture object, and (c) the buffer object bound to the
7075bd8deadSopenharmony_ci      TEXTURE_BUFFER_ARB binding point.
7085bd8deadSopenharmony_ci
7095bd8deadSopenharmony_ci      All three are queried with GetIntegerv, because it didn't seem worth the
7105bd8deadSopenharmony_ci      trouble to add one or more new query functions.  Note that for (a) and
7115bd8deadSopenharmony_ci      (b), the texture queried is the one bound to TEXTURE_BUFFER_ARB on the
7125bd8deadSopenharmony_ci      active texture image unit.
7135bd8deadSopenharmony_ci
7145bd8deadSopenharmony_ci    (13) Should we provide a new set of names for the signed normalized
7155bd8deadSopenharmony_ci         textures introduced in NV_texture_shader that match the convention
7165bd8deadSopenharmony_ci         used for floating-point and integer textures?
7175bd8deadSopenharmony_ci
7185bd8deadSopenharmony_ci      RESOLVED: No.
7195bd8deadSopenharmony_ci
7205bd8deadSopenharmony_ci    (14) Can a buffer object be attached to more than one buffer texture at
7215bd8deadSopenharmony_ci         once?
7225bd8deadSopenharmony_ci
7235bd8deadSopenharmony_ci      RESOLVED: Multiple buffer textures may attach to the same buffer object
7245bd8deadSopenharmony_ci      simultaneously.
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci    (15) How does this extension interact with display lists?
7275bd8deadSopenharmony_ci
7285bd8deadSopenharmony_ci      RESOLVED:  Buffer object commands can't be compiled into a display list.
7295bd8deadSopenharmony_ci      The new command in this extension uses buffer objects, so we specify
7305bd8deadSopenharmony_ci      that it also can't be compiled into a display list.
7315bd8deadSopenharmony_ci
7325bd8deadSopenharmony_ciRevision History
7335bd8deadSopenharmony_ci
7345bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
7355bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------
7365bd8deadSopenharmony_ci      8   06/04/15  srahman   Add GLX protocol specification.
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci      7   07/09/13  Jon Leech Correct suffix on
7395bd8deadSopenharmony_ci                              TEXTURE_BUFFER_DATA_STORE_BINDING_ARB
7405bd8deadSopenharmony_ci                              (was EXT).
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci      6   6/30/08   js        Trivial conversion to ARB from EXT
7435bd8deadSopenharmony_ci
7445bd8deadSopenharmony_ci
7455bd8deadSopenharmony_ci      5   04/16/08  pbrown    Clarify that either NV_gpu_program4 or 
7465bd8deadSopenharmony_ci                              EXT_gpu_shader4 is required, not simply
7475bd8deadSopenharmony_ci                              NV_gpu_program4.
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci      4   10/30/07  ewerness  Add resolutions to various issues
7505bd8deadSopenharmony_ci
7515bd8deadSopenharmony_ci      3      --               Pre-release revisions.
752