15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_texture_buffer_range
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_texture_buffer_range
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Graham Sellers (graham.sellers 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Jon Leech
165bd8deadSopenharmony_ci    Mark Kilgard, NVIDIA
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciNotice
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Copyright (c) 2012-2013 The Khronos Group Inc. Copyright terms at
215bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciSpecification Update Policy
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
265bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
275bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
285bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
295bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
305bd8deadSopenharmony_ci    described in more detail at
315bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciStatus
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Complete.
365bd8deadSopenharmony_ci    Approved by the ARB on 2012/06/12.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciVersion
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Last Modified Date: August 7, 2013
415bd8deadSopenharmony_ci    Version: 8
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciNumber
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    ARB Extension #139
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ciDependencies
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    ARB_texture_buffer_object or OpenGL 3.1 is required.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    The definition of this extension is dependent on EXT_direct_state_access.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.2 (Core) Specification.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciOverview
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    ARB_texture_buffer_object (which was promoted to core in OpenGL 3.1)
585bd8deadSopenharmony_ci    introduced the ability to attach the data store of a buffer object
595bd8deadSopenharmony_ci    to a buffer texture and access it from shaders. The extension only allows
605bd8deadSopenharmony_ci    the entire store of the buffer object to the texture. This extension
615bd8deadSopenharmony_ci    expands on this and allows a sub-range of the buffer's data store to
625bd8deadSopenharmony_ci    be attached to a texture. This can be used, for example, to allow multiple
635bd8deadSopenharmony_ci    buffer textures to be backed by independent sub-ranges of the same buffer
645bd8deadSopenharmony_ci    object, or for different sub-ranges of a single buffer object to be used
655bd8deadSopenharmony_ci    for different purposes.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciIP Status
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    No known IP claims.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciNew Procedures and Functions
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci        void TexBufferRange(enum target,
745bd8deadSopenharmony_ci                            enum internalformat,
755bd8deadSopenharmony_ci                            uint buffer,
765bd8deadSopenharmony_ci                            intptr offset,
775bd8deadSopenharmony_ci                            sizeiptr size);
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    When EXT_direct_state_access is present:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci        void TextureBufferRangeEXT(uint texture,
825bd8deadSopenharmony_ci                                   enum target,
835bd8deadSopenharmony_ci                                   enum internalformat,
845bd8deadSopenharmony_ci                                   uint buffer,
855bd8deadSopenharmony_ci                                   intptr offset,
865bd8deadSopenharmony_ci                                   sizeiptr size);
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ciNew Tokens
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTexLevelParameter:
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci        TEXTURE_BUFFER_OFFSET                               0x919D
935bd8deadSopenharmony_ci        TEXTURE_BUFFER_SIZE                                 0x919E
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
965bd8deadSopenharmony_ci    and GetDoublev:
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci        TEXTURE_BUFFER_OFFSET_ALIGNMENT                     0x919F
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.2 (Core Profile) Specification
1015bd8deadSopenharmony_ci(OpenGL Operation)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    None.
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 4.2 (Core Profile) Specification
1065bd8deadSopenharmony_ci(Rasterization)
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ciModifications to Section 3.8.7 "Buffer Textures"
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Change the description of TexBuffer as follows:
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci        The command
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci        void TexBufferRange(enum target,
1155bd8deadSopenharmony_ci                            enum internalformat,
1165bd8deadSopenharmony_ci                            uint buffer,
1175bd8deadSopenharmony_ci                            intptr offset,
1185bd8deadSopenharmony_ci                            sizeiptr size);
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    attaches the range of the storage for the buffer object named <buffer>
1215bd8deadSopenharmony_ci    for <size> basic machine units, starting at <offset> (also in basic machine
1225bd8deadSopenharmony_ci    units) to the active buffer texture, and specifies an internal format
1235bd8deadSopenharmony_ci    for the texel array found in the range of the attached buffer object. If
1245bd8deadSopenharmony_ci    <buffer> is zero, then any buffer object attached to the buffer texture
1255bd8deadSopenharmony_ci    is detached, the values <offset> and <size> are ignored and the state for
1265bd8deadSopenharmony_ci    <offset> and <size> for the buffer texture are reset to zero. If <buffer>
1275bd8deadSopenharmony_ci    is non-zero, but is not the name of a buffer object, the error
1285bd8deadSopenharmony_ci    INVALID_OPERATION is generated. If <offset> is negative or if <size> is
1295bd8deadSopenharmony_ci    less than or equal to zero or if <offset> + <size> is greater than the
1305bd8deadSopenharmony_ci    value of BUFFER_SIZE for the buffer bound to <target>, of if <offset> is
1315bd8deadSopenharmony_ci    not an integer multiple of TEXTURE_BUFFER_OFFSET_ALIGNMENT, then the error
1325bd8deadSopenharmony_ci    INVALID_VALUE is generated. <internalformat> specifies the storage format
1335bd8deadSopenharmony_ci    and must be one of the sized internal formats found in Table 3.15.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci        The command
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci        void TextureBufferRangeEXT(uint texture,
1385bd8deadSopenharmony_ci                                   enum target,
1395bd8deadSopenharmony_ci                                   enum internalformat,
1405bd8deadSopenharmony_ci                                   uint buffer,
1415bd8deadSopenharmony_ci                                   intptr offset,
1425bd8deadSopenharmony_ci                                   sizeiptr size);
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    behaves identically to TexBufferRange, except rather than updating the
1455bd8deadSopenharmony_ci    currently bound texture object for the texture unit indicated by the current
1465bd8deadSopenharmony_ci    active texture state, the texture object named <texture> is updated
1475bd8deadSopenharmony_ci    directly. <texture> must be a name returned from a previous call to
1485bd8deadSopenharmony_ci    GenTextures or be that of an existing texture matching <target>. If <texture>
1495bd8deadSopenharmony_ci    is not the name of an existing texture, one is created with the name
1505bd8deadSopenharmony_ci    <texture> for <target>.
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci        The command
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci        void TexBuffer(enum target,
1555bd8deadSopenharmony_ci                       enum internalformat,
1565bd8deadSopenharmony_ci                       uint buffer);
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    is equivalent to calling TexBufferRange with the <target>, <internalformat>
1595bd8deadSopenharmony_ci    and <buffer> parameters as specified, with <offset> set to zero, and
1605bd8deadSopenharmony_ci    <size> set to the value of BUFFER_SIZE for <buffer>.
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci        When a range of the storage of a buffer object is attached to a buffer
1635bd8deadSopenharmony_ci    texture, the range of the buffer's data store is taken as the texture's
1645bd8deadSopenharmony_ci    texel array. The number of texels in the buffer texture's texel array is
1655bd8deadSopenharmony_ci    given by
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci                    |                 <size>                 |
1685bd8deadSopenharmony_ci                    |  ------------------------------------  |
1695bd8deadSopenharmony_ci                    |_  <components> x sizeof(<base_type>)  _|
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    where <components> and <base_type> are the element count and base type for
1725bd8deadSopenharmony_ci    elements, as specified in Table 3.15.
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ciModifications to Section 3.9.15 "Texture and Proxy State"
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    Add to the state required for buffer textures:
1775bd8deadSopenharmony_ci    
1785bd8deadSopenharmony_ci    ... The buffer texture target has associated an integer containing the name
1795bd8deadSopenharmony_ci    of the buffer object that provided the data store for the texture,
1805bd8deadSopenharmony_ci    initially zero, and two pointer sized integers containing the offset and
1815bd8deadSopenharmony_ci    range of the buffer object's data store, also initially zero.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.2 (Core Profile) Specification
1845bd8deadSopenharmony_ci(Per-Fragment Operations and the Frame Buffer)
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    None.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 4.2 (Core Profile) Specification
1895bd8deadSopenharmony_ci(Special Functions)
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    None.
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.2 (Core Profile) Specification
1945bd8deadSopenharmony_ci(State and State Requests)
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    None.
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ciErrors
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    INVALID_ENUM is generated by TexBufferRange if <target> is not
2015bd8deadSopenharmony_ci    TEXTURE_BUFFER.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexBufferRange if <offset> is less than zero.
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexBufferRange if <size> is less than zero.
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexBufferRange if <offset> + <size> is
2085bd8deadSopenharmony_ci    greater than the value of BUFFER_SIZE for <buffer>.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexBufferRange if <offset> is not
2115bd8deadSopenharmony_ci    an integer multiple of the value of TEXTURE_BUFFER_OFFSET_ALIGNMENT.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ciNew State
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    Append to Table 6.17. Textures (state per texture image)
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    +-------------------------+---------+----------------------+---------------+------------------------------------------+
2185bd8deadSopenharmony_ci    | Get Value               | Type    | Get Command          | Initial Value | Description                              |
2195bd8deadSopenharmony_ci    +-------------------------+---------+----------------------+---------------+------------------------------------------+
2205bd8deadSopenharmony_ci    | TEXTURE_BUFFER_OFFSET   |  n x Z  | GetTexLevelParameter | 0             | Offset into buffer's data store used for |
2215bd8deadSopenharmony_ci    |                         |         |                      |               | the active image unit's buffer texture   |
2225bd8deadSopenharmony_ci    | TEXTURE_BUFFER_SIZE     |  n x Z  | GetTexLevelParameter | 0             | Size of the buffer's data store used for |
2235bd8deadSopenharmony_ci    |                         |         |                      |               | the active image unit's buffer texture   |
2245bd8deadSopenharmony_ci    +-------------------------+---------+----------------------+---------------+------------------------------------------+
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ciNew Implementation Dependent State
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    +---------------------------------+------+-------------+------------+----------------------------+---------+-----------+
2295bd8deadSopenharmony_ci    |                                 |      |             | Minimum    |                            |         |           |
2305bd8deadSopenharmony_ci    | Get Value                       | Type | Get Command | Value      | Description                | Sec     | Attribute |
2315bd8deadSopenharmony_ci    +---------------------------------+------+-------------+------------+----------------------------+---------+-----------+
2325bd8deadSopenharmony_ci    | TEXTURE_BUFFER_OFFSET_ALIGNMENT | Z+   | GetIntegerv | 1          | Minimum required alignment | 3.8.7   | -         |
2335bd8deadSopenharmony_ci    |                                 |      |             |            | for texture buffer offsets |         |           |
2345bd8deadSopenharmony_ci    +---------------------------------+------+-------------+------------+----------------------------+---------+-----------+
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ciConformance Tests
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    TBD
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ciIssues
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    1) Do we need to have restrictions on the alignment of <offset> and/or
2435bd8deadSopenharmony_ci       <size> for TexBufferRange?
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci       RESOLVED: Yes for offset, no for range. The minimum value here is 1,
2465bd8deadSopenharmony_ci       essentially making it optional for offsets.
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ciDependencies on EXT_direct_state_access
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    If EXT_direct_state_access is not supported, remove all references to
2515bd8deadSopenharmony_ci    TextureBufferRangeEXT.
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ciRevision History
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    Rev.  Date        Author    Changes
2565bd8deadSopenharmony_ci    ----  ----------  --------  -----------------------------------------
2575bd8deadSopenharmony_ci     8    08/07/2013  mjk       Better indicate DSA entrypoints
2585bd8deadSopenharmony_ci     7    05/29/2012  Jon Leech Fix capitalization of <internalformat>.
2595bd8deadSopenharmony_ci     6    05/02/2012  drakos    Add EXT suffix to TextureBufferRange.
2605bd8deadSopenharmony_ci     5    04/30/2012  gsellers  Assign token values.
2615bd8deadSopenharmony_ci                                Add more error behavior.
2625bd8deadSopenharmony_ci                                Minor fixes.
2635bd8deadSopenharmony_ci     4    04/26/2012  gsellers  Clarify that <offset> and <size> are reset for
2645bd8deadSopenharmony_ci                                TexBOs when a buffer is unbound.
2655bd8deadSopenharmony_ci     3    04/02/2012  gsellers  Update token names. Correct typos. (bug 8131).
2665bd8deadSopenharmony_ci                                Add TEXTURE_BUFFER_OFFSET_ALIGNMENT.
2675bd8deadSopenharmony_ci                                Resolve issue (1).
2685bd8deadSopenharmony_ci     2    12/19/2011  gsellers  Document interaction with EXT_dsa. Rename to
2695bd8deadSopenharmony_ci                                ARB. Remove ARB suffixes from APIs and tokens.
2705bd8deadSopenharmony_ci     1    09/26/2011  gsellers  Initial draft
271