15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_pixel_buffer_object
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_pixel_buffer_object
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciNotice
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Copyright (c) 2004-2013 The Khronos Group Inc. Copyright terms at
125bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciSpecification Update Policy
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
175bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
185bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
195bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
205bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
215bd8deadSopenharmony_ci    described in more detail at
225bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciStatus
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    Complete. Approved by ARB on December 7, 2004.
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciContributors
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Ralf Biermann
315bd8deadSopenharmony_ci    Nick Carter
325bd8deadSopenharmony_ci    Derek Cornish
335bd8deadSopenharmony_ci    Matt Craighead
345bd8deadSopenharmony_ci    Mark Kilgard
355bd8deadSopenharmony_ci    Dale Kirkland
365bd8deadSopenharmony_ci    Jon Leech
375bd8deadSopenharmony_ci    Brian Paul
385bd8deadSopenharmony_ci    Thomas Roell
395bd8deadSopenharmony_ci    Ian Romanick
405bd8deadSopenharmony_ci    Jeremy Sandmel
415bd8deadSopenharmony_ci    Shazia Rahman
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciContact
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)
465bd8deadSopenharmony_ci    Ralf Biermann, NVIDIA Corporation (rbiermann 'at' nvidia.com)
475bd8deadSopenharmony_ci    Derek Cornish, NVIDIA Corporation (dcornish 'at' nvidia.com)
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciIP Status
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    None.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciVersion
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    Last Modified Date: October 8, 2013
565bd8deadSopenharmony_ci    Revision: 1.2
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciNumber
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    ARB Extension #42
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ciDependencies
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 2.0 specification.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    Assumes support for (at least) OpenGL 1.5 or the
675bd8deadSopenharmony_ci    ARB_vertex_buffer_object extension.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    NV_pixel_data_range affects the definition of this extension.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    EXT_pixel_buffer_object interacts with this extension.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ciOverview
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    This extension expands on the interface provided by the
765bd8deadSopenharmony_ci    ARB_vertex_buffer_object extension (and later integrated into OpenGL
775bd8deadSopenharmony_ci    1.5) in order to permit buffer objects to be used not only with vertex
785bd8deadSopenharmony_ci    array data, but also with pixel data.  The intent is to provide more
795bd8deadSopenharmony_ci    acceleration opportunities for OpenGL pixel commands.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    While a single buffer object can be bound for both vertex arrays and
825bd8deadSopenharmony_ci    pixel commands, we use the designations vertex buffer object (VBO)
835bd8deadSopenharmony_ci    and pixel buffer object (PBO) to indicate their particular usage in
845bd8deadSopenharmony_ci    a given situation.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    Recall that buffer objects conceptually are nothing more than arrays
875bd8deadSopenharmony_ci    of bytes, just like any chunk of memory.  ARB_vertex_buffer_object
885bd8deadSopenharmony_ci    allows GL commands to source data from a buffer object by binding the
895bd8deadSopenharmony_ci    buffer object to a given target and then overloading a certain set of
905bd8deadSopenharmony_ci    GL commands' pointer arguments to refer to offsets inside the buffer,
915bd8deadSopenharmony_ci    rather than pointers to user memory.  An offset is encoded in a
925bd8deadSopenharmony_ci    pointer by adding the offset to a null pointer.
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    This extension does not add any new functionality to buffer objects
955bd8deadSopenharmony_ci    themselves.  It simply adds two new targets to which buffer objects
965bd8deadSopenharmony_ci    can be bound: GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER.  When a
975bd8deadSopenharmony_ci    buffer object is bound to the GL_PIXEL_PACK_BUFFER target, commands
985bd8deadSopenharmony_ci    such as glReadPixels pack (write) their data into a buffer object.
995bd8deadSopenharmony_ci    When a buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target,
1005bd8deadSopenharmony_ci    commands such as glDrawPixels and glTexImage2D unpack (read) their
1015bd8deadSopenharmony_ci    data from a buffer object.
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    There are a several approaches to improve graphics performance
1045bd8deadSopenharmony_ci    with PBOs.  Some of the most interesting approaches are:
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    - Streaming texture updates:  If the application uses
1075bd8deadSopenharmony_ci      glMapBuffer/glUnmapBuffer to write its data for glTexSubImage into
1085bd8deadSopenharmony_ci      a buffer object, at least one of the data copies usually required
1095bd8deadSopenharmony_ci      to download a texture can be eliminated, significantly increasing
1105bd8deadSopenharmony_ci      texture download performance.
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    - Streaming draw pixels: When glDrawPixels sources client memory,
1135bd8deadSopenharmony_ci      OpenGL says the client memory can be modified immediately after the
1145bd8deadSopenharmony_ci      glDrawPixels command returns without disturbing the drawn image.
1155bd8deadSopenharmony_ci      This typically necessitates unpacking and copying the image prior
1165bd8deadSopenharmony_ci      to glDrawPixels returning.  However, when using glDrawPixels with
1175bd8deadSopenharmony_ci      a pixel pack buffer object, glDrawPixels may return prior to image
1185bd8deadSopenharmony_ci      unpacking because future modification of the buffer data requires
1195bd8deadSopenharmony_ci      explicit commands (glMapBuffer, glBufferData, or glBufferSubData).
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    - Asynchronous glReadPixels:  If an application needs to read back a
1225bd8deadSopenharmony_ci      number of images and process them with the CPU, the existing GL
1235bd8deadSopenharmony_ci      interface makes it nearly impossible to pipeline this operation.
1245bd8deadSopenharmony_ci      The driver will typically send the hardware a readback command
1255bd8deadSopenharmony_ci      when glReadPixels is called, and then wait for all of the data to
1265bd8deadSopenharmony_ci      be available before returning control to the application.  Then,
1275bd8deadSopenharmony_ci      the application can either process the data immediately or call
1285bd8deadSopenharmony_ci      glReadPixels again; in neither case will the readback overlap with
1295bd8deadSopenharmony_ci      the processing.  If the application issues several readbacks
1305bd8deadSopenharmony_ci      into several buffer objects, however, and then maps each one to
1315bd8deadSopenharmony_ci      process its data, then the readbacks can proceed in parallel with
1325bd8deadSopenharmony_ci      the data processing.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    - Render to vertex array:  The application can use a fragment
1355bd8deadSopenharmony_ci      program to render some image into one of its buffers, then read
1365bd8deadSopenharmony_ci      this image out into a buffer object via glReadPixels.  Then, it can
1375bd8deadSopenharmony_ci      use this buffer object as a source of vertex data.
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ciIssues
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    1)  How does this extension relate to ARB_vertex_buffer_object?
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci        It builds on the ARB_vertex_buffer_object framework by adding
1445bd8deadSopenharmony_ci        two new targets that buffers can be bound to.
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    2)  How does this extension relate to NV_pixel_data_range?
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci        This extension relates to NV_pixel_data_range in the same way
1495bd8deadSopenharmony_ci        that ARB_vertex_buffer_object relates to NV_vertex_array_range.
1505bd8deadSopenharmony_ci        To paraphrase the ARB_vertex_buffer_object spec, here are the
1515bd8deadSopenharmony_ci        main differences:
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci        - Applications are no longer responsible for memory management
1545bd8deadSopenharmony_ci          and synchronization.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci        - Applications may still access high-performance memory directly,
1575bd8deadSopenharmony_ci          but this is optional, and such access is more restricted.
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci        - Buffer changes (glBindBuffer) are generally expected to be
1605bd8deadSopenharmony_ci          very lightweight, rather than extremely heavyweight
1615bd8deadSopenharmony_ci          (glPixelDataRangeNV).
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci        - A platform-specific allocator such as wgl/glXAllocateMemoryNV
1645bd8deadSopenharmony_ci          is no longer required.
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    3)  Can a given buffer be used for both vertex and pixel data?
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci        RESOLVED: YES.  All buffers can be used with all buffer bindings,
1695bd8deadSopenharmony_ci        in whatever combinations the application finds useful.  Consider
1705bd8deadSopenharmony_ci        yourself warned, however, by the following issue.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    4)  May implementations make use of the target as a hint to select
1735bd8deadSopenharmony_ci        an appropriate memory space for the buffer?
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci        RESOLVED: YES, as long as such behavior is transparent to the
1765bd8deadSopenharmony_ci        application.  Some implementations may choose, for example, that
1775bd8deadSopenharmony_ci        they would rather stream vertex data from AGP memory, element
1785bd8deadSopenharmony_ci        (index) data from video memory, and pixel data from video memory.
1795bd8deadSopenharmony_ci        In fact, one can imagine arbitrarily complicated heuristics for
1805bd8deadSopenharmony_ci        selecting the memory space, based on factors such as the target,
1815bd8deadSopenharmony_ci        the "usage" argument, and the application's observed behavior.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci        While it is entirely legal to create a buffer object by binding
1845bd8deadSopenharmony_ci        it to GL_ARRAY_BUFFER and loading it with data, then using it
1855bd8deadSopenharmony_ci        with the GL_PIXEL_UNPACK_BUFFER_ARB or GL_PIXEL_PACK_BUFFER_ARB
1865bd8deadSopenharmony_ci        binding, such behavior is liable to confuse the driver and may
1875bd8deadSopenharmony_ci        hurt performance.  If the driver implemented the hypothetical
1885bd8deadSopenharmony_ci        heuristic described earlier, such a buffer might have already
1895bd8deadSopenharmony_ci        been located in AGP memory, and so the driver would have to choose
1905bd8deadSopenharmony_ci        between two bad options: relocate the buffer into video memory, or
1915bd8deadSopenharmony_ci        accept lower performance caused by streaming pixel data from AGP.
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    5)  Should all pixel path commands be supported, or just a subset
1945bd8deadSopenharmony_ci        of them?
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci        RESOLVED: ALL.  While there is little reason to believe that,
1975bd8deadSopenharmony_ci        say, glConvolutionFilter2D would benefit from this extension,
1985bd8deadSopenharmony_ci        there is no reason _not_ to support it.  The complete list of
1995bd8deadSopenharmony_ci        commands affected by this extension is listed in issues 17 and 18.
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    6)  Should glPixelMap and glGetPixelMap be supported?
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci        RESOLVED: YES.  They're not really pixel path operations, but,
2045bd8deadSopenharmony_ci        again, there is no good reason to omit operations, and they _are_
2055bd8deadSopenharmony_ci        operations that pass around big chunks of pixel-related data.
2065bd8deadSopenharmony_ci        If we support glPolygonStipple, surely we should support this.
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    7)  How does the buffer binding state push/pop?
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci        RESOLVED: As part of the pixel store client state.  This is
2115bd8deadSopenharmony_ci        analogous to how the ARB_vertex_buffer_object bindings
2125bd8deadSopenharmony_ci        pushed/popped as part of the vertex array client state.
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    8)  Should NV_pixel_data_range (PDR) be used concurrently with pixel
2155bd8deadSopenharmony_ci        buffer objects ?
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci        RESOLVED: NO. While it would be possible to allocate a memory
2185bd8deadSopenharmony_ci        range for PDR, using a pointer into this memory range with one
2195bd8deadSopenharmony_ci        of the commands affected by PBOs will not work if a pixel buffer
2205bd8deadSopenharmony_ci        object other than zero is bound to the buffer binding point
2215bd8deadSopenharmony_ci        affecting the command.
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci        Pixel buffer objects always have higher precedence than PDR.
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci    9)  Should the INVALID_OPERATION error be generated if a pixel
2265bd8deadSopenharmony_ci        command would access data outside the range of the bound PBO?
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci        RESOLVED:  YES.  This requires considering the command parameters
2295bd8deadSopenharmony_ci        (such as width/height/depth/format/type/pointer), the current
2305bd8deadSopenharmony_ci        pixel store (pack/unpack) state, and the command operation itself
2315bd8deadSopenharmony_ci        to determine the maximum addressed byte for the pixel command.
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci        Brian Paul strongly recommends this behavior.
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci        This behavior should increase the reliability of using PBO and
2365bd8deadSopenharmony_ci        guard against programmer mistakes.
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci        This is particularly important for glReadPixels where returning
2395bd8deadSopenharmony_ci        data into a region outside the PBO could cause corruption of
2405bd8deadSopenharmony_ci        application memory.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci        Such bounds checking is substantially more expensive for VBO
2435bd8deadSopenharmony_ci        accesses because bounds checking on a per-vertex element basis
2445bd8deadSopenharmony_ci        for each of multiple enabled vertex arrays prior to performing
2455bd8deadSopenharmony_ci        the command compromises the performance justification of VBO.
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci    10) If a pixel command with a bound PBO accesses data outside the
2485bd8deadSopenharmony_ci        range of the PBO, thereby generating a GL_INVALID_OPERATION error,
2495bd8deadSopenharmony_ci        can the pixel command end up being partially processed?
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci        RESOLVED:  NO.  As for all GL errors excepting GL_OUT_OF_MEMORY
2525bd8deadSopenharmony_ci        situations, "the command generating the error is ignored so that
2535bd8deadSopenharmony_ci        it has no effect on GL state or framebuffer contents."
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci        This means implementations must determine before the pixel command
2565bd8deadSopenharmony_ci        is performed whether the resulting read or write operations on
2575bd8deadSopenharmony_ci        the bound PBO will exceed the size of the PBO.
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci        This means an implementation is NOT allowed to detect out of
2605bd8deadSopenharmony_ci        bounds accesses in the middle of performing the command.
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    11) How expensive is it to predetermine whether a pixel command
2635bd8deadSopenharmony_ci        accessing a PBO would have an out of bounds access?
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci        See the "Appendix on Pack/Unpack Range" to see the computations
2665bd8deadSopenharmony_ci        involved in computing the access limit.
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci        Implementations can further specialize and optimize the check
2695bd8deadSopenharmony_ci        to make this out of bounds checking negligible for any sizable
2705bd8deadSopenharmony_ci        pixel payload.
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    12) Should feedback and select buffers output results into a
2735bd8deadSopenharmony_ci        buffer object?
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci        RESOLVED:  That might be useful for a future extension but is
2765bd8deadSopenharmony_ci        not appropriate for this extension.  New targets (other than
2775bd8deadSopenharmony_ci        PIXEL_PACK_BUFFER_ARB and PIXEL_UNPACK_BUFFER_ARB) make sense.
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci    13) Should NV_pixel_data_range interactions be documented in
2805bd8deadSopenharmony_ci        this specification?
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci        RESOLVED:  YES.  Interactions with NV_pixel_data_range are
2835bd8deadSopenharmony_ci        important to document to facilitate developers migrating to
2845bd8deadSopenharmony_ci        the multi-vendor ARB_pixel_buffer_object extension.  Discussion of
2855bd8deadSopenharmony_ci        interactions is limited to the issues and example usage sections.
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci        Other ARB specifications follow this policy, and Jon Leech agrees
2885bd8deadSopenharmony_ci        with this policy.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    14) Should an INVALID_OPERATION error be generated if the offset
2915bd8deadSopenharmony_ci        within a pixel buffer to a datum comprising of N basic machine
2925bd8deadSopenharmony_ci        units is not a multiple of N?
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci        RESOLVED:  YES.  This was stated for VBOs but no error was
2955bd8deadSopenharmony_ci        defined if the rule was violated.  Perhaps this needs to be
2965bd8deadSopenharmony_ci        better specified for VBO.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci        For PBO, it is reasonable and cheap to enforce the alignment rule.
2995bd8deadSopenharmony_ci        For pixel commands it means making sure the offset is evenly
3005bd8deadSopenharmony_ci        divisible by the component or group size in basic machine units.
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci        This check is independent of the pixel store state because the
3035bd8deadSopenharmony_ci        pixel store state is specified in terms of pixels (not basic
3045bd8deadSopenharmony_ci        machine units) so pixel store addressing cannot create an
3055bd8deadSopenharmony_ci        unaligned access as long as the base offset is aligned.
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci        Certain commands (specifically glPolygonStipple,
3085bd8deadSopenharmony_ci        glGetPolygonStipple, glBitmap, glCompressedTexImage1D,
3095bd8deadSopenharmony_ci        glCompressedTexImage2D, glCompressedTexImage3D,
3105bd8deadSopenharmony_ci        glCompressedTexSubImage1D, glCompressedTexSubImage2D,
3115bd8deadSopenharmony_ci        glCompressedTexSubImage3D, and glGetCompressedTexImage) are not
3125bd8deadSopenharmony_ci        affected by this error because the data accessed is addressed
3135bd8deadSopenharmony_ci        at the granularity of basic machine units.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    15) Various commands do not make explicit reference to supporting
3165bd8deadSopenharmony_ci        packing or unpacking from a pixel buffer object but rather specify
3175bd8deadSopenharmony_ci        that parameters are handled in the same manner as glDrawPixels,
3185bd8deadSopenharmony_ci        glReadPixels, or the glCompressedTexImage commands.  So do such
3195bd8deadSopenharmony_ci        commands (example: glCompressedTexSubImage2D) use pixel buffers?
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci        RESOLVED:  YES.  Commands that have their behavior defined based
3225bd8deadSopenharmony_ci        on commands that read or write from pixel buffers will themselves
3235bd8deadSopenharmony_ci        read or write from pixel buffers.  Relying on this reduces the
3245bd8deadSopenharmony_ci        amount of specification language to be updated.
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    16) What is the complete list of commands that can unpack (read)
3275bd8deadSopenharmony_ci        pixels from the current pixel unpack buffer object?
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci            glBitmap
3305bd8deadSopenharmony_ci            glColorSubTable
3315bd8deadSopenharmony_ci            glColorTable
3325bd8deadSopenharmony_ci            glCompressedTexImage1D
3335bd8deadSopenharmony_ci            glCompressedTexImage2D
3345bd8deadSopenharmony_ci            glCompressedTexImage3D
3355bd8deadSopenharmony_ci            glCompressedTexSubImage1D
3365bd8deadSopenharmony_ci            glCompressedTexSubImage2D
3375bd8deadSopenharmony_ci            glCompressedTexSubImage3D
3385bd8deadSopenharmony_ci            glConvolutionFilter1D
3395bd8deadSopenharmony_ci            glConvolutionFilter2D
3405bd8deadSopenharmony_ci            glDrawPixels
3415bd8deadSopenharmony_ci            glPixelMapfv
3425bd8deadSopenharmony_ci            glPixelMapuiv
3435bd8deadSopenharmony_ci            glPixelMapusv
3445bd8deadSopenharmony_ci            glPolygonStipple
3455bd8deadSopenharmony_ci            glSeparableFilter2D
3465bd8deadSopenharmony_ci            glTexImage1D
3475bd8deadSopenharmony_ci            glTexImage2D
3485bd8deadSopenharmony_ci            glTexImage3D
3495bd8deadSopenharmony_ci            glTexSubImage1D
3505bd8deadSopenharmony_ci            glTexSubImage2D
3515bd8deadSopenharmony_ci            glTexSubImage3D
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci    17) What is the complete list of commands that can pack (write)
3545bd8deadSopenharmony_ci        pixels into the current pixel pack buffer object?
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci            glGetCompressedTexImage
3575bd8deadSopenharmony_ci            glGetConvolutionFilter
3585bd8deadSopenharmony_ci            glGetHistogram
3595bd8deadSopenharmony_ci            glGetMinmax
3605bd8deadSopenharmony_ci            glGetPixelMapfv
3615bd8deadSopenharmony_ci            glGetPixelMapuiv
3625bd8deadSopenharmony_ci            glGetPixelMapusv
3635bd8deadSopenharmony_ci            glGetPolygonStipple
3645bd8deadSopenharmony_ci            glGetSeparableFilter,
3655bd8deadSopenharmony_ci            glGetTexImage
3665bd8deadSopenharmony_ci            glReadPixels
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci    18) How does support for pixel buffer objects affect the GLX protocol?
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ci        UNRESOLVED:  See the "GLX Protocol" section.
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci    19) Prior to this extension, passing zero for the data argument of
3735bd8deadSopenharmony_ci        glTexImage1D, glTexImage2D, and glTexImage3D defined a texture
3745bd8deadSopenharmony_ci        image level without supplying an image.  How does this behavior
3755bd8deadSopenharmony_ci        change with this extension?
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci        RESOLVED:  The "unspecified image" behavior of the glTexImage
3785bd8deadSopenharmony_ci        calls only applies when bound to a zero pixel unpack buffer
3795bd8deadSopenharmony_ci        object.
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci        When bound to a non-zero pixel unpack buffer object, the data
3825bd8deadSopenharmony_ci        argument to these calls is treated as an offset rather than
3835bd8deadSopenharmony_ci        a pointer so zero is a reasonable and even likely value that
3845bd8deadSopenharmony_ci        corresponds to the very beginning of the buffer object's data.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci        So to create a texture image level with unspecified image data,
3875bd8deadSopenharmony_ci        you MUST bind to the zero pixel unpack buffer object.
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci        See the ammended language at the end of section 3.8.1.
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci    20) How does this extension support video frame grabbers?
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci        RESOLVED:  This extension extends buffer objects so they can
3945bd8deadSopenharmony_ci        operate with pixel commands, rather than just vertex array
3955bd8deadSopenharmony_ci        commands.
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci        We anticipate that a future extension may provide a mechanism
3985bd8deadSopenharmony_ci        for transferring video frames from video frame grabber hardware
3995bd8deadSopenharmony_ci        or vertices from motion capture hardware (or any other source
4005bd8deadSopenharmony_ci        of aquired real-time data) directly into a buffer object to
4015bd8deadSopenharmony_ci        eliminate a copy.  Ideally, such transfers would be possible
4025bd8deadSopenharmony_ci        without requiring mapping of the buffer object.  But this
4035bd8deadSopenharmony_ci        extension does not provide such functionality.
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci        We anticipate such functionality to involve binding a buffer
4065bd8deadSopenharmony_ci        object to a new target type, configuring a source (or sink) for
4075bd8deadSopenharmony_ci        data (video frames, motion capture vertex sets, etc.), and then
4085bd8deadSopenharmony_ci        commands to initiate data transfers to the bound buffer object.
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ci    21) Can this ARB extension share the same enumerants with the EXT
4115bd8deadSopenharmony_ci        version of this functionality?
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci        RESOLVED:  YES.  The ARB extension is functionally compatible
4145bd8deadSopenharmony_ci        with EXT_pixel_buffer_object except that the ARB version adds
4155bd8deadSopenharmony_ci        additional error checks for alignment and buffer bounds checking.
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci        The EXT behavior in the case of alignment violations and buffer
4185bd8deadSopenharmony_ci        bounds overflow are technically undefined.  The ARB extension
4195bd8deadSopenharmony_ci        simply defines the EXT extension's undefined behavior to be an
4205bd8deadSopenharmony_ci        OpenGL error.
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci        Using the same enumerants with firmed up error checking (that
4235bd8deadSopenharmony_ci        would otherwise indicate buggy usage) is preferable to two sets
4245bd8deadSopenharmony_ci        of enumerants where the older EXT set simply allows sloppy usage.
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci    22) The expected usage parameters (GL_STREAM_DRAW, etc.) for
4275bd8deadSopenharmony_ci        glBufferData are not clearly specified.  How can they be improved?
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci        RESOLVED:  To improve the clarity, replace the phrase "specified
4305bd8deadSopenharmony_ci        once" with "specified once per repetition of the usage pattern" so
4315bd8deadSopenharmony_ci        that it is clear for the STREAM_* usage modes (and the STATIC_*
4325bd8deadSopenharmony_ci        usage modes too, just much less frequently) that the repeated
4335bd8deadSopenharmony_ci        specification is part of a pattern and it is expected that the
4345bd8deadSopenharmony_ci        buffer can be, and will be for the STREAM_* usage patterns,
4355bd8deadSopenharmony_ci        specified again after being used and this is likely to repeat.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ci        Additionally, the *_COPY and *_DRAW usage patterns can source
4385bd8deadSopenharmony_ci        the data with "a GL drawing command" but also with image
4395bd8deadSopenharmony_ci        specification commands so change this phrase to "a GL drawing
4405bd8deadSopenharmony_ci        or image specification command."
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    23) Is this the "right" way to expose render-to-vertex-array?
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci        DISCUSSION:  You can use this extension to render an image
4455bd8deadSopenharmony_ci        into a framebuffer, copy the pixels into a buffer object with
4465bd8deadSopenharmony_ci        glReadPixels, and then configure vertex arrays to source the pixel
4475bd8deadSopenharmony_ci        data as vertex attributes.  This necessarily involves a copy
4485bd8deadSopenharmony_ci        from the framebuffer to the buffer object.  Future extensions
4495bd8deadSopenharmony_ci        may provide mechanisms for copy-free render-to-vertex-array
4505bd8deadSopenharmony_ci        capabilities but that is not a design goal of this extension.
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ciNew Procedures and Functions
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci    None.
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ciNew Tokens
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci    Accepted by the <target> parameters of BindBuffer, BufferData,
4605bd8deadSopenharmony_ci    BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData,
4615bd8deadSopenharmony_ci    GetBufferParameteriv, and GetBufferPointerv:
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci        PIXEL_PACK_BUFFER_ARB                        0x88EB
4645bd8deadSopenharmony_ci        PIXEL_UNPACK_BUFFER_ARB                      0x88EC
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
4675bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
4685bd8deadSopenharmony_ci
4695bd8deadSopenharmony_ci        PIXEL_PACK_BUFFER_BINDING_ARB                0x88ED
4705bd8deadSopenharmony_ci        PIXEL_UNPACK_BUFFER_BINDING_ARB              0x88EF
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation)
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci    None
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci -- Section 2.9 "Buffer Objects"
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci    Replace the first two paragraphs with:
4805bd8deadSopenharmony_ci
4815bd8deadSopenharmony_ci    "The vertex data arrays described in section 2.8 are stored in
4825bd8deadSopenharmony_ci    client memory.  It is sometimes desirable to store frequently accessed
4835bd8deadSopenharmony_ci    client data, such as vertex array and pixel data, in high-performance
4845bd8deadSopenharmony_ci    server memory.  GL buffer objects provide a mechanism for clients to
4855bd8deadSopenharmony_ci    use to allocate, initialize, and access such memory."
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ci    The name space for buffer objects is the unsigned integer, with zero
4885bd8deadSopenharmony_ci    reserved for the GL.  A buffer object is created by binding an unused
4895bd8deadSopenharmony_ci    name to a buffer target.  A buffer object is bound by calling
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci       void BindBuffer(enum target, uint buffer);
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci    /target/ must be one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER,
4945bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_ARB, or PIXEL_PACK_BUFFER_ARB.  The ARRAY_BUFFER
4955bd8deadSopenharmony_ci    target is discussed in section 2.9.1  The ELEMENT_ARRAY_BUFFER target
4965bd8deadSopenharmony_ci    is discussed in section 2.9.2.  The PIXEL_UNPACK_BUFFER_ARB and
4975bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_ARB targets are discussed later in sections 3.6,
4985bd8deadSopenharmony_ci    4.3.2, and 6.1.  If the buffer object named /buffer/ has not been
4995bd8deadSopenharmony_ci    previously bound or has been deleted since the last binding, the
5005bd8deadSopenharmony_ci    GL creates a new state vector, initialized with a zero-sized memory
5015bd8deadSopenharmony_ci    buffer and comprising the state values listed in table 2.6."
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    Replace the 5th paragraph with:
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci    "Initially, each buffer object target is bound to zero.  There is
5065bd8deadSopenharmony_ci    no buffer object corresponding to the name zero so client attempts
5075bd8deadSopenharmony_ci    to modify or query buffer object state for a target bound to zero
5085bd8deadSopenharmony_ci    generate an INVALID_OPERATION error."
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci    Replace the phrase listing the valid targets for BufferData in the
5115bd8deadSopenharmony_ci    9th paragraph with:
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci    "with target set to one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER,
5145bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_ARB, or PIXEL_PACK_BUFFER_ARB,"
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci    In the 10th paragraph describing buffer object usage modes, replace
5175bd8deadSopenharmony_ci    the phrase "specified once" with "specified once per repetition of
5185bd8deadSopenharmony_ci    the usage pattern" for the STREAM_* and STATIC_* usage values.
5195bd8deadSopenharmony_ci
5205bd8deadSopenharmony_ci    Also in the 10th paragraph describing buffer object usage modes,
5215bd8deadSopenharmony_ci    replace the phrases "of a GL drawing command." and "for GL drawing
5225bd8deadSopenharmony_ci    commands." with "for GL drawing and image specification commands." for
5235bd8deadSopenharmony_ci    the *_DRAW and *_COPY usage values.
5245bd8deadSopenharmony_ci
5255bd8deadSopenharmony_ci    Replace the phrase listing the valid targets for BufferSubData in
5265bd8deadSopenharmony_ci    the 15th paragraph with:
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci    "with target set to one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER,
5295bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_ARB, or PIXEL_PACK_BUFFER_ARB."
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci    Replace the phrase listing the valid targets for MapBuffer in the
5325bd8deadSopenharmony_ci    16th paragraph with:
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci    "with target set to one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER,
5355bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_ARB, or PIXEL_PACK_BUFFER_ARB."
5365bd8deadSopenharmony_ci
5375bd8deadSopenharmony_ci    Replace the phrase listing the valid targets for UnmapBuffer in the
5385bd8deadSopenharmony_ci    21st paragraph with:
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci    "with target set to one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER,
5415bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_ARB, or PIXEL_PACK_BUFFER_ARB."
5425bd8deadSopenharmony_ci
5435bd8deadSopenharmony_ci -- Section 2.9.2 "Array Indices in Buffer Objects"
5445bd8deadSopenharmony_ci
5455bd8deadSopenharmony_ci    Delete the 3rd paragraph that explains how the ELEMENT_ARRAY_BUFFER
5465bd8deadSopenharmony_ci    target is acceptable for the commands specified in section 2.9.
5475bd8deadSopenharmony_ci    The updated section 2.9 language already says this.
5485bd8deadSopenharmony_ci
5495bd8deadSopenharmony_ci -- NEW Section 2.9.3 "Buffer Object Required State"
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci    "The state required to support buffer objects consists of binding
5525bd8deadSopenharmony_ci    names for the array buffer, element buffer, pixel unpack buffer, and
5535bd8deadSopenharmony_ci    pixel pack buffer.  Additionally, each vertex array has an associated
5545bd8deadSopenharmony_ci    binding so there is a buffer object binding for each of the vertex
5555bd8deadSopenharmony_ci    array, normal array, color array, index array, multiple texture
5565bd8deadSopenharmony_ci    coordinate arrays, edge flag array, secondary color array, fog
5575bd8deadSopenharmony_ci    coordinate array, and vertex attribute arrays.  The initial values for
5585bd8deadSopenharmony_ci    all buffer object bindings is zero.
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ci    The state of each buffer object consists of a buffer size in basic
5615bd8deadSopenharmony_ci    machine units, a usage parameter, an access parameter, a mapped
5625bd8deadSopenharmony_ci    boolean, a pointer to the mapped buffer (NULL if unmapped), and the
5635bd8deadSopenharmony_ci    sized array of basic machine units for the buffer data."
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2.1 Specification (Rasterization)
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci -- Section 3.6 "Pixel Rectangles"
5695bd8deadSopenharmony_ci
5705bd8deadSopenharmony_ci    Replace the 1st sentence in the 2nd paragraph:
5715bd8deadSopenharmony_ci
5725bd8deadSopenharmony_ci    "A number of parameters control the encoding of pixels in buffer
5735bd8deadSopenharmony_ci    object or client memory (for reading and writing) and how pixels
5745bd8deadSopenharmony_ci    are processed before being placed in or after being read from the
5755bd8deadSopenharmony_ci    framebuffer (for reading, writing, and copying)."
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci -- RENAME Section 3.6.1 "Pixel Storage Modes and Pixel Buffer Objects"
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ci    Add to the end of the section:
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci    "In addition to storing pixel data in client memory, pixel data
5825bd8deadSopenharmony_ci    may also be stored in buffer objects (described in section 2.9).
5835bd8deadSopenharmony_ci    The current pixel unpack and pack buffer objects are designated
5845bd8deadSopenharmony_ci    by the PIXEL_UNPACK_BUFFER_ARB and PIXEL_PACK_BUFFER_ARB targets
5855bd8deadSopenharmony_ci    respectively.
5865bd8deadSopenharmony_ci
5875bd8deadSopenharmony_ci    Initially, zero is bound for the PIXEL_UNPACK_BUFFER_ARB, indicating
5885bd8deadSopenharmony_ci    that image specification commands such as DrawPixels source their
5895bd8deadSopenharmony_ci    pixels from client memory pointer parameters.  However, if a non-zero
5905bd8deadSopenharmony_ci    buffer object is bound as the current pixel unpack buffer, then
5915bd8deadSopenharmony_ci    the pointer parameter is treated as an offset into the designated
5925bd8deadSopenharmony_ci    buffer object."
5935bd8deadSopenharmony_ci
5945bd8deadSopenharmony_ci -- Section 3.6.3 "Pixel Transfer Modes", page 116.
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ci    Replace the last phrase in the 2nd paragraph with:
5975bd8deadSopenharmony_ci
5985bd8deadSopenharmony_ci    "and /values/ refers to an array of size map values."
5995bd8deadSopenharmony_ci
6005bd8deadSopenharmony_ci    [values is no longer necessarily a pointer.]
6015bd8deadSopenharmony_ci
6025bd8deadSopenharmony_ci    Add the following paragraph after the third paragraph:
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci    "If a pixel unpack buffer is bound (as indicated by a non-zero
6055bd8deadSopenharmony_ci    value of PIXEL_UNPACK_BUFFER_BINDING_ARB), /values/ is an offset
6065bd8deadSopenharmony_ci    into the pixel unpack buffer; otherwise, /values/ is a pointer to a
6075bd8deadSopenharmony_ci    block client memory.  All pixel storage and pixel transfer modes are
6085bd8deadSopenharmony_ci    ignored when specifying a pixel map.  n machine units are read where
6095bd8deadSopenharmony_ci    n is the /size/ of the pixel map times the size of a float, uint,
6105bd8deadSopenharmony_ci    or ushort datum in basic machine units, depending on the respective
6115bd8deadSopenharmony_ci    PixelMap version.  If a pixel unpack buffer object is bound and data+n
6125bd8deadSopenharmony_ci    is greater than the size of the pixel buffer, INVALID_OPERATION
6135bd8deadSopenharmony_ci    results.  If a pixel unpack buffer object is bound and /values/ is
6145bd8deadSopenharmony_ci    not evenly divisible into the number of basic machine units needed
6155bd8deadSopenharmony_ci    to store in memory a float, uint, or ushort datum depending on their
6165bd8deadSopenharmony_ci    respective PixelMap version, INVALID_OPERATION results."
6175bd8deadSopenharmony_ci
6185bd8deadSopenharmony_ci -- Section 3.6.4 "Rasterization of Pixel Rectangles", page 126.
6195bd8deadSopenharmony_ci
6205bd8deadSopenharmony_ci    Change the 1st sentence of the 1st paragraph to read:
6215bd8deadSopenharmony_ci
6225bd8deadSopenharmony_ci    "The process of drawing pixels encoded in buffer objects or client
6235bd8deadSopenharmony_ci    memory is diagrammed in figure 3.7."
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ci    Change the 4th sentence of the 2nd paragraph to read:
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci    "/data/ refers to the data to be drawn."
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci    [data is no longer necessarily a pointer.]
6305bd8deadSopenharmony_ci
6315bd8deadSopenharmony_ci    Change the initial phrase in the 1st sentence of the 1st paragraph
6325bd8deadSopenharmony_ci    after "Unpacking" to read:
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ci    "Data are taken from the currently bound pixel unpack buffer or
6355bd8deadSopenharmony_ci    client memory as a sequence of..."
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci    Insert this paragraph after the 1st paragraph after "Unpacking":
6385bd8deadSopenharmony_ci
6395bd8deadSopenharmony_ci    "If a pixel unpack buffer is bound (as indicated by a non-zero
6405bd8deadSopenharmony_ci    value of PIXEL_UNPACK_BUFFER_BINDING_ARB), /data/ is an offset
6415bd8deadSopenharmony_ci    into the pixel unpack buffer and the pixels are unpacked from the
6425bd8deadSopenharmony_ci    buffer relative to this offset; otherwise, /data/ is a pointer to
6435bd8deadSopenharmony_ci    a block client memory and the pixels are unpacked from the client
6445bd8deadSopenharmony_ci    memory relative to the pointer.  If a pixel unpack buffer object
6455bd8deadSopenharmony_ci    is bound and unpacking the pixel data according to the process
6465bd8deadSopenharmony_ci    described below would access memory beyond the size of the pixel
6475bd8deadSopenharmony_ci    unpack buffer's memory size, INVALID_OPERATION results.  If a pixel
6485bd8deadSopenharmony_ci    unpack buffer object is bound and /data/ is not evenly divisible
6495bd8deadSopenharmony_ci    into the number of basic machine units needed to store in memory the
6505bd8deadSopenharmony_ci    corresponding GL data type from table 3.5 for the /type/ parameter,
6515bd8deadSopenharmony_ci    INVALID_OPERATION results."
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci -- Section 3.8.1 "Texture Image Specification", page 150.
6545bd8deadSopenharmony_ci
6555bd8deadSopenharmony_ci    Replace the last phrase in the 2nd to last sentence in the 1st
6565bd8deadSopenharmony_ci    paragraph with:
6575bd8deadSopenharmony_ci
6585bd8deadSopenharmony_ci    "and a reference to the image data in the currently bound pixel unpack
6595bd8deadSopenharmony_ci    buffer or client memory."
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci    Replace the 1st sentence in the 13th paragraph with:
6625bd8deadSopenharmony_ci
6635bd8deadSopenharmony_ci    "The image itself (referred to by /data/) is a sequence of groups
6645bd8deadSopenharmony_ci    of values."
6655bd8deadSopenharmony_ci
6665bd8deadSopenharmony_ci    Replace the last paragraph with:
6675bd8deadSopenharmony_ci
6685bd8deadSopenharmony_ci    "If the data argument of TexImage1D, TexImage2D, or TexImage3D
6695bd8deadSopenharmony_ci    is a null pointer (a zero-valued pointer in the C implementation)
6705bd8deadSopenharmony_ci    and the pixel unpack buffer object is zero, a one-, two-, or three-
6715bd8deadSopenharmony_ci    dimensional texture array is created with the specified target, level,
6725bd8deadSopenharmony_ci    internalformat, width, height, and depth border, but with unspecified
6735bd8deadSopenharmony_ci    image contents.  In this case no pixel values are access in client
6745bd8deadSopenharmony_ci    memory, and no pixel processing is performed.  Errors are generated,
6755bd8deadSopenharmony_ci    however, exactly as though the data pointer were valid.  Otherwise if
6765bd8deadSopenharmony_ci    the pixel unpack buffer object is non-zero, the data argument is
6775bd8deadSopenharmony_ci    treatedly normally to refer to the beginning of the pixel unpack
6785bd8deadSopenharmony_ci    buffer object's data."
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci -- Section 3.8.3 "Compressed Texture Images", page 163.
6815bd8deadSopenharmony_ci
6825bd8deadSopenharmony_ci    Replace the 3rd sentence of the 2nd paragraph with:
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci    "/data/ refers to compressed image data stored in the compressed
6855bd8deadSopenharmony_ci    image format corresponding to internalformat.  If a pixel
6865bd8deadSopenharmony_ci    unpack buffer is bound (as indicated by a non-zero value of
6875bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB), /data/ is an offset into the
6885bd8deadSopenharmony_ci    pixel unpack buffer and the compressed data is read from the buffer
6895bd8deadSopenharmony_ci    relative to this offset; otherwise, /data/ is a pointer to a block
6905bd8deadSopenharmony_ci    client memory and the compressed data is read from the client memory
6915bd8deadSopenharmony_ci    relative to the pointer."
6925bd8deadSopenharmony_ci
6935bd8deadSopenharmony_ci    Replace the 2nd sentence in the 3rd paragraph with:
6945bd8deadSopenharmony_ci
6955bd8deadSopenharmony_ci    "Compressed texture images are treated as an array of /imageSize/
6965bd8deadSopenharmony_ci    ubytes relative to /data/.  If a pixel unpack buffer object is bound
6975bd8deadSopenharmony_ci    and data+imageSize is greater than the size of the pixel buffer,
6985bd8deadSopenharmony_ci    INVALID_OPERATION results."
6995bd8deadSopenharmony_ci
7005bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2.1 Specification (Per-Fragment
7015bd8deadSopenharmony_ciOperations and the Frame Buffer)
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci -- Section 4.3.2 "Reading Pixels", page 219.
7045bd8deadSopenharmony_ci
7055bd8deadSopenharmony_ci    Replace 1st sentence of the 1st paragraph with:
7065bd8deadSopenharmony_ci
7075bd8deadSopenharmony_ci    "The method for reading pixels from the framebuffer and placing them in
7085bd8deadSopenharmony_ci    pixel pack buffer or client memory is diagrammed in figure 4.2."
7095bd8deadSopenharmony_ci
7105bd8deadSopenharmony_ci    Add this paragraph after the 1st paragraph:
7115bd8deadSopenharmony_ci
7125bd8deadSopenharmony_ci    "Initially, zero is bound for the PIXEL_PACK_BUFFER_ARB, indicating
7135bd8deadSopenharmony_ci    that image read and query commands such as ReadPixels return
7145bd8deadSopenharmony_ci    pixels results into client memory pointer parameters.  However, if
7155bd8deadSopenharmony_ci    a non-zero buffer object is bound as the current pixel pack buffer,
7165bd8deadSopenharmony_ci    then the pointer parameter is treated as an offset into the designated
7175bd8deadSopenharmony_ci    buffer object."
7185bd8deadSopenharmony_ci
7195bd8deadSopenharmony_ci    Rename "Placement in Client Memory" to "Placement in Pixel Pack
7205bd8deadSopenharmony_ci    Buffer or Client Memory".
7215bd8deadSopenharmony_ci
7225bd8deadSopenharmony_ci    Insert this paragraph after the newly renamed "Placement in Pixel
7235bd8deadSopenharmony_ci    Pack Buffer or Client Memory" heading:
7245bd8deadSopenharmony_ci
7255bd8deadSopenharmony_ci    "If a pixel pack buffer is bound (as indicated by a non-zero value
7265bd8deadSopenharmony_ci    of PIXEL_PACK_BUFFER_BINDING_ARB), /data/ is an offset into the
7275bd8deadSopenharmony_ci    pixel pack buffer and the pixels are packed into the
7285bd8deadSopenharmony_ci    buffer relative to this offset; otherwise, /data/ is a pointer to a
7295bd8deadSopenharmony_ci    block client memory and the pixels are packed into the client memory
7305bd8deadSopenharmony_ci    relative to the pointer.  If a pixel pack buffer object is bound and
7315bd8deadSopenharmony_ci    packing the pixel data according to the pixel pack storage state
7325bd8deadSopenharmony_ci    would access memory beyond the size of the pixel pack buffer's
7335bd8deadSopenharmony_ci    memory size, INVALID_OPERATION results.  If a pixel pack buffer object
7345bd8deadSopenharmony_ci    is bound and /data/ is not evenly divisible into the number of basic
7355bd8deadSopenharmony_ci    machine units needed to store in memory the corresponding GL data type
7365bd8deadSopenharmony_ci    from table 3.5 for the /type/ parameter, INVALID_OPERATION results."
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci
7395bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2.1 Specification (Special Functions)
7405bd8deadSopenharmony_ci
7415bd8deadSopenharmony_ci    None
7425bd8deadSopenharmony_ci
7435bd8deadSopenharmony_ci
7445bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2.1 Specification (State and State
7455bd8deadSopenharmony_ciRequests)
7465bd8deadSopenharmony_ci
7475bd8deadSopenharmony_ci -- Section 6.1.3 "Enumerated Queries".
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci    After the sentence in the last paragraph describing GetPixelMap, add:
7505bd8deadSopenharmony_ci
7515bd8deadSopenharmony_ci    "The GetPixelMapfv, GetPixelMapuiv, and GetPixelMapusv commands
7525bd8deadSopenharmony_ci    write all the values in the named pixel map to /data/.  If a
7535bd8deadSopenharmony_ci    pixel pack buffer is bound (as indicated by a non-zero value of
7545bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_BINDING_ARB), /data/ is an offset into the pixel
7555bd8deadSopenharmony_ci    pack buffer; otherwise, /data/ is a pointer to a block client memory.
7565bd8deadSopenharmony_ci    All pixel storage and pixel transfer modes are ignored when returning a
7575bd8deadSopenharmony_ci    pixel map.  n machine units are written where n is the size of the
7585bd8deadSopenharmony_ci    pixel map times the size of FLOAT, UNSIGNED_INT, or UNSIGNED_SHORT
7595bd8deadSopenharmony_ci    respectively in basic machine units.  If a pixel pack buffer object
7605bd8deadSopenharmony_ci    is bound and data+n is greater than the size of the pixel buffer,
7615bd8deadSopenharmony_ci    generate INVALID_OPERATION."
7625bd8deadSopenharmony_ci
7635bd8deadSopenharmony_ci -- Section 6.1.4 "Texture Queries".
7645bd8deadSopenharmony_ci
7655bd8deadSopenharmony_ci    Remove the mention of img in the last phrase in the last sentence
7665bd8deadSopenharmony_ci    of the 1st paragraph so the sentence reads:
7675bd8deadSopenharmony_ci
7685bd8deadSopenharmony_ci    "lod is a level-of-detail number, format is a pixel format from
7695bd8deadSopenharmony_ci    table 3.6, and type is a pixel type from table 3.5."
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci    Replace the 3rd sentence of the 2nd paragraph with:
7725bd8deadSopenharmony_ci
7735bd8deadSopenharmony_ci    "These groups are then packed and placed in client or pixel buffer
7745bd8deadSopenharmony_ci    object memory.  If a pixel pack buffer is bound (as indicated by a
7755bd8deadSopenharmony_ci    non-zero value of PIXEL_PACK_BUFFER_BINDING_ARB), /img/ is an offset
7765bd8deadSopenharmony_ci    into the pixel pack buffer; otherwise, /img/ is a pointer to a block
7775bd8deadSopenharmony_ci    client memory."
7785bd8deadSopenharmony_ci
7795bd8deadSopenharmony_ci    Add to the end of the 4th paragraph:
7805bd8deadSopenharmony_ci
7815bd8deadSopenharmony_ci    "If a pixel pack buffer object is bound and packing the texture
7825bd8deadSopenharmony_ci    image into the buffer's memory would exceed the size of the buffer,
7835bd8deadSopenharmony_ci    generate INVALID_OPERATION."
7845bd8deadSopenharmony_ci
7855bd8deadSopenharmony_ci    Replace the 2nd sentence of the 5th paragraph with:
7865bd8deadSopenharmony_ci
7875bd8deadSopenharmony_ci    "When called, GetCompressedTexImage writes n ubytes of compressed
7885bd8deadSopenharmony_ci    image data to the pixel pack buffer or client memory pointed to by
7895bd8deadSopenharmony_ci    ptr, where n is the texture image's TEXTURE_COMPRESSED_IMAGE_SIZE
7905bd8deadSopenharmony_ci    value.
7915bd8deadSopenharmony_ci
7925bd8deadSopenharmony_ci    Add to the end of the 6th paragraph:
7935bd8deadSopenharmony_ci
7945bd8deadSopenharmony_ci    "If a pixel pack buffer object is bound and ptr+n is greater than
7955bd8deadSopenharmony_ci    the size of the buffer, generate INVALID_OPERATION."
7965bd8deadSopenharmony_ci
7975bd8deadSopenharmony_ci -- Section 6.1.5 "Stipple Query".
7985bd8deadSopenharmony_ci
7995bd8deadSopenharmony_ci    "The pattern is packed into client or pixel pack buffer memory
8005bd8deadSopenharmony_ci    according to the procedures given in section 4.3.2 for ReadPixels;
8015bd8deadSopenharmony_ci    ..."
8025bd8deadSopenharmony_ci
8035bd8deadSopenharmony_ci -- Section 6.1.7 "Color Table Query".
8045bd8deadSopenharmony_ci
8055bd8deadSopenharmony_ci    "The one-dimensional color table image is returned to client or
8065bd8deadSopenharmony_ci    pixel pack buffer memory starting at table."
8075bd8deadSopenharmony_ci
8085bd8deadSopenharmony_ci -- Section 6.1.8 "Convolution Query".
8095bd8deadSopenharmony_ci
8105bd8deadSopenharmony_ci    "The one-dimensional or two-dimensional image is returned to client
8115bd8deadSopenharmony_ci    or pixel pack buffer memory starting at image."
8125bd8deadSopenharmony_ci
8135bd8deadSopenharmony_ci    "The row and column images are returned to client or pixel pack
8145bd8deadSopenharmony_ci    buffer memory starting at row and column respectively."
8155bd8deadSopenharmony_ci
8165bd8deadSopenharmony_ci -- Section 6.1.9 "Histogram Query".
8175bd8deadSopenharmony_ci
8185bd8deadSopenharmony_ci    "The one-dimensional histogram table image is returned to client or
8195bd8deadSopenharmony_ci    pixel pack buffer memory starting at values."
8205bd8deadSopenharmony_ci
8215bd8deadSopenharmony_ci -- Section 6.1.10 "Minmax Query".
8225bd8deadSopenharmony_ci
8235bd8deadSopenharmony_ci    "A one-dimensional image of width 2 is returned to client or pixel
8245bd8deadSopenharmony_ci    pack buffer memory starting at values."
8255bd8deadSopenharmony_ci
8265bd8deadSopenharmony_ci -- Section 6.1.13 "Buffer Object Queries".
8275bd8deadSopenharmony_ci
8285bd8deadSopenharmony_ci    Change the 2nd sentence of the 2nd paragraph to read:
8295bd8deadSopenharmony_ci
8305bd8deadSopenharmony_ci    "target is ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, PIXEL_PACK_BUFFER_ARB,
8315bd8deadSopenharmony_ci    or PIXEL_UNPACK_BUFFER_ARB."
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci    Change the last phrase in the 1st sentence of the 4th paragraph to:
8345bd8deadSopenharmony_ci
8355bd8deadSopenharmony_ci    "with target set to ARRAY_BUFFER, ELMENT_ARRAY_BUFFER,
8365bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_ARB, or PIXEL_UNPACK_BUFFER_ARB and pname set
8375bd8deadSopenharmony_ci    to BUFFER_MAP_POINTER."
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci
8405bd8deadSopenharmony_ciGLX Protocol
8415bd8deadSopenharmony_ci
8425bd8deadSopenharmony_ci    Pixel buffers, like texture objects and display lists, are server-side
8435bd8deadSopenharmony_ci    state.
8445bd8deadSopenharmony_ci
8455bd8deadSopenharmony_ci    Prior to pixel buffer objects, pixel storage state for image packing
8465bd8deadSopenharmony_ci    and unpacking was considered client-side state. However, pixel
8475bd8deadSopenharmony_ci    buffers create the new situation where the server performs packing
8485bd8deadSopenharmony_ci    and unpacking into server-side pixel buffers.
8495bd8deadSopenharmony_ci
8505bd8deadSopenharmony_ci    Fortunately, the GLX protocol, through foresight or oversight,
8515bd8deadSopenharmony_ci    has GLX protocol and non-rendering command opcodes (109 and 110)
8525bd8deadSopenharmony_ci    assigned for glPixelStoref and glPixelStorei respectively.
8535bd8deadSopenharmony_ci
8545bd8deadSopenharmony_ci    It is better to use the existing protocol to send glPixelStorei and
8555bd8deadSopenharmony_ci    glPixelStoref GLX commands. This solves the problem of server-side
8565bd8deadSopenharmony_ci    pixel state the same way for both pack and unpack state. It may also
8575bd8deadSopenharmony_ci    allow implementations to minimize validation overhead for pixel
8585bd8deadSopenharmony_ci    commands because the pixel store modes are stateful rather than
8595bd8deadSopenharmony_ci    being parameters sent with every pixel command.
8605bd8deadSopenharmony_ci
8615bd8deadSopenharmony_ci    When bound to a pixel unpack buffer object, the pixel payload for a 
8625bd8deadSopenharmony_ci    pixel command with no reply (for exmaple, glTexImage2D) is not sent.
8635bd8deadSopenharmony_ci    Instead, the pointer itself is sent as a 64-bit offset.
8645bd8deadSopenharmony_ci    Pixel storage modes are also not included in non-reply pixel commands.
8655bd8deadSopenharmony_ci
8665bd8deadSopenharmony_ci    Therefore, the following new protocol for pixel commands that use the
8675bd8deadSopenharmony_ci    currently bound pixel unpack buffer object is specified:
8685bd8deadSopenharmony_ci
8695bd8deadSopenharmony_ci        BitmapPBO
8705bd8deadSopenharmony_ci        ColorSubTablePBO
8715bd8deadSopenharmony_ci        ColorTablePBO
8725bd8deadSopenharmony_ci        CompressedTexImage1DPBO
8735bd8deadSopenharmony_ci        CompressedTexImage2DPBO
8745bd8deadSopenharmony_ci        CompressedTexImage3DPBO
8755bd8deadSopenharmony_ci        CompressedTexSubImage1DPBO
8765bd8deadSopenharmony_ci        CompressedTexSubImage2DPBO
8775bd8deadSopenharmony_ci        CompressedTexSubImage3DPBO
8785bd8deadSopenharmony_ci        ConvolutionFilter1DPBO
8795bd8deadSopenharmony_ci        ConvolutionFilter2DPBO
8805bd8deadSopenharmony_ci        DrawPixelsPBO
8815bd8deadSopenharmony_ci        PixelMapfvPBO
8825bd8deadSopenharmony_ci        PixelMapuivPBO
8835bd8deadSopenharmony_ci        PixelMapusvPBO
8845bd8deadSopenharmony_ci        PolygonStipplePBO
8855bd8deadSopenharmony_ci        SeparableFilter2DPBO
8865bd8deadSopenharmony_ci        TexImage1DPBO
8875bd8deadSopenharmony_ci        TexImage2DPBO
8885bd8deadSopenharmony_ci        TexImage3DPBO**
8895bd8deadSopenharmony_ci        TexSubImage1DPBO
8905bd8deadSopenharmony_ci        TexSubImage2DPBO
8915bd8deadSopenharmony_ci        TexSubImage3DPBO
8925bd8deadSopenharmony_ci
8935bd8deadSopenharmony_ci    When bound to a pixel pack buffer object, the reply for pixel commands
8945bd8deadSopenharmony_ci    that return pixel data (for example, glReadPixels) is not required
8955bd8deadSopenharmony_ci    since the pixel data is actually transferred to the server-side pixel
8965bd8deadSopenharmony_ci    pack buffer object.  Indeed, forcing an unnecessary reply would hinder
8975bd8deadSopenharmony_ci    the performance advantages of using pixel buffer objects
8985bd8deadSopenharmony_ci
8995bd8deadSopenharmony_ci    Therefore, protocol for "no reply" version of the following commands
9005bd8deadSopenharmony_ci    is specified:
9015bd8deadSopenharmony_ci
9025bd8deadSopenharmony_ci        GetColorTablePBO
9035bd8deadSopenharmony_ci        GetCompressedTexImagePBO
9045bd8deadSopenharmony_ci        GetConvolutionFilterPBO
9055bd8deadSopenharmony_ci        GetHistogramPBO
9065bd8deadSopenharmony_ci        GetMinmaxPBO
9075bd8deadSopenharmony_ci        GetPixelMapfvPBO
9085bd8deadSopenharmony_ci        GetPixelMapuivPBO
9095bd8deadSopenharmony_ci        GetPixelMapusvPBO
9105bd8deadSopenharmony_ci        GetPolygonStipplePBO
9115bd8deadSopenharmony_ci        GetSeparableFilterPBO
9125bd8deadSopenharmony_ci        GetTexImagePBO
9135bd8deadSopenharmony_ci        ReadPixelsPBO
9145bd8deadSopenharmony_ci
9155bd8deadSopenharmony_ci    If a "no reply" command is sent when the current pixel pack
9165bd8deadSopenharmony_ci    buffer object binding is zero, a GLXBadContextState error should
9175bd8deadSopenharmony_ci    be generated by the server.
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci
9205bd8deadSopenharmony_ci    The following rendering commands are sent to the server as part of a
9215bd8deadSopenharmony_ci    glXRender request:
9225bd8deadSopenharmony_ci
9235bd8deadSopenharmony_ci       BitmapPBO
9245bd8deadSopenharmony_ci
9255bd8deadSopenharmony_ci            2           36              rendering command length
9265bd8deadSopenharmony_ci            2           311             rendering command opcode
9275bd8deadSopenharmony_ci            8           CARD64          bitmap
9285bd8deadSopenharmony_ci            4           CARD32          width
9295bd8deadSopenharmony_ci            4           CARD32          height
9305bd8deadSopenharmony_ci            4           FLOAT32         xorig
9315bd8deadSopenharmony_ci            4           FLOAT32         yorig
9325bd8deadSopenharmony_ci            4           FLOAT32         xmove
9335bd8deadSopenharmony_ci            4           FLOAT32         ymove
9345bd8deadSopenharmony_ci
9355bd8deadSopenharmony_ci        ColorSubTablePBO
9365bd8deadSopenharmony_ci
9375bd8deadSopenharmony_ci            2           32              rendering command length
9385bd8deadSopenharmony_ci            2           312             rendering command opcode
9395bd8deadSopenharmony_ci            8           CARD64          table
9405bd8deadSopenharmony_ci            4           ENUM            target
9415bd8deadSopenharmony_ci            4           CARD32          start
9425bd8deadSopenharmony_ci            4           CARD32          count
9435bd8deadSopenharmony_ci            4           ENUM            apiFormat  
9445bd8deadSopenharmony_ci            4           ENUM            apiType
9455bd8deadSopenharmony_ci
9465bd8deadSopenharmony_ci        ColorTablePBO
9475bd8deadSopenharmony_ci
9485bd8deadSopenharmony_ci            2           32              rendering command length
9495bd8deadSopenharmony_ci            2           313             rendering command opcode
9505bd8deadSopenharmony_ci            8           CARD64          table
9515bd8deadSopenharmony_ci            4           ENUM            target
9525bd8deadSopenharmony_ci            4           ENUM            internalformat
9535bd8deadSopenharmony_ci            4           CARD32          width
9545bd8deadSopenharmony_ci            4           ENUM            apiFormat
9555bd8deadSopenharmony_ci            4           ENUM            apiType
9565bd8deadSopenharmony_ci
9575bd8deadSopenharmony_ci        CompressedTexImage1DPBO
9585bd8deadSopenharmony_ci
9595bd8deadSopenharmony_ci            2           36              rendering command length
9605bd8deadSopenharmony_ci            2           314             rendering command opcode
9615bd8deadSopenharmony_ci            8           CARD64          data
9625bd8deadSopenharmony_ci            4           ENUM            target
9635bd8deadSopenharmony_ci            4           CARD32          level
9645bd8deadSopenharmony_ci            4           ENUM            internalFormat
9655bd8deadSopenharmony_ci            4           CARD32          width
9665bd8deadSopenharmony_ci            4           CARD32          border
9675bd8deadSopenharmony_ci            4           CARD32          imageSize
9685bd8deadSopenharmony_ci
9695bd8deadSopenharmony_ci       CompressedTexImage2DPBO
9705bd8deadSopenharmony_ci
9715bd8deadSopenharmony_ci            2           40              rendering command length
9725bd8deadSopenharmony_ci            2           315             rendering command opcode
9735bd8deadSopenharmony_ci            8           CARD64          data
9745bd8deadSopenharmony_ci            4           ENUM            target
9755bd8deadSopenharmony_ci            4           CARD32          level
9765bd8deadSopenharmony_ci            4           ENUM            internalFormat
9775bd8deadSopenharmony_ci            4           CARD32          width
9785bd8deadSopenharmony_ci            4           CARD32          height
9795bd8deadSopenharmony_ci            4           CARD32          border
9805bd8deadSopenharmony_ci            4           CARD32          imageSize
9815bd8deadSopenharmony_ci
9825bd8deadSopenharmony_ci        CompressedTexImage3DPBO
9835bd8deadSopenharmony_ci
9845bd8deadSopenharmony_ci            2           44              rendering command length
9855bd8deadSopenharmony_ci            2           316             rendering command opcode
9865bd8deadSopenharmony_ci            8           CARD64          data
9875bd8deadSopenharmony_ci            4           ENUM            target
9885bd8deadSopenharmony_ci            4           CARD32          level
9895bd8deadSopenharmony_ci            4           ENUM            internalFormat
9905bd8deadSopenharmony_ci            4           CARD32          width
9915bd8deadSopenharmony_ci            4           CARD32          height
9925bd8deadSopenharmony_ci            4           CARD32          depth
9935bd8deadSopenharmony_ci            4           CARD32          border
9945bd8deadSopenharmony_ci            4           CARD32          imageSize
9955bd8deadSopenharmony_ci
9965bd8deadSopenharmony_ci        CompressedTexSubImage1DPBO
9975bd8deadSopenharmony_ci
9985bd8deadSopenharmony_ci            2           36              rendering command length
9995bd8deadSopenharmony_ci            2           317             rendering command opcode
10005bd8deadSopenharmony_ci            8           CARD64          data
10015bd8deadSopenharmony_ci            4           ENUM            target
10025bd8deadSopenharmony_ci            4           CARD32          level
10035bd8deadSopenharmony_ci            4           CARD32          xoffset
10045bd8deadSopenharmony_ci            4           CARD32          width
10055bd8deadSopenharmony_ci            4           ENUM            apiFormat
10065bd8deadSopenharmony_ci            4           CARD32          imageSize
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci        CompressedTexSubImage2DPBO
10095bd8deadSopenharmony_ci
10105bd8deadSopenharmony_ci            2           44              rendering command length
10115bd8deadSopenharmony_ci            2           318             rendering command opcode
10125bd8deadSopenharmony_ci            8           CARD64          data
10135bd8deadSopenharmony_ci            4           ENUM            target
10145bd8deadSopenharmony_ci            4           CARD32          level
10155bd8deadSopenharmony_ci            4           CARD32          xoffset
10165bd8deadSopenharmony_ci            4           CARD32          yoffset
10175bd8deadSopenharmony_ci            4           CARD32          width
10185bd8deadSopenharmony_ci            4           CARD32          height
10195bd8deadSopenharmony_ci            4           ENUM            apiFormat
10205bd8deadSopenharmony_ci            4           CARD32          imageSize
10215bd8deadSopenharmony_ci
10225bd8deadSopenharmony_ci        CompressedTexSubImage3DPBO
10235bd8deadSopenharmony_ci
10245bd8deadSopenharmony_ci            2           52              rendering command length
10255bd8deadSopenharmony_ci            2           319             rendering command opcode
10265bd8deadSopenharmony_ci            8           CARD64          data
10275bd8deadSopenharmony_ci            4           ENUM            target
10285bd8deadSopenharmony_ci            4           CARD32          level
10295bd8deadSopenharmony_ci            4           CARD32          xoffset
10305bd8deadSopenharmony_ci            4           CARD32          yoffset
10315bd8deadSopenharmony_ci            4           CARD32          zoffset
10325bd8deadSopenharmony_ci            4           CARD32          width
10335bd8deadSopenharmony_ci            4           CARD32          height
10345bd8deadSopenharmony_ci            4           CARD32          depth
10355bd8deadSopenharmony_ci            4           ENUM            apiFormat
10365bd8deadSopenharmony_ci            4           CARD32          imageSize
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci        ConvolutionFilter1DPBO
10395bd8deadSopenharmony_ci
10405bd8deadSopenharmony_ci            2           32              rendering command length
10415bd8deadSopenharmony_ci            2           320             rendering command opcode
10425bd8deadSopenharmony_ci            8           CARD64          image
10435bd8deadSopenharmony_ci            4           ENUM            target
10445bd8deadSopenharmony_ci            4           ENUM            internalformat
10455bd8deadSopenharmony_ci            4           CARD32          width
10465bd8deadSopenharmony_ci            4           ENUM            apiFormat
10475bd8deadSopenharmony_ci            4           ENUM            apiType
10485bd8deadSopenharmony_ci
10495bd8deadSopenharmony_ci        ConvolutionFilter2DPBO
10505bd8deadSopenharmony_ci
10515bd8deadSopenharmony_ci            2           36              rendering command length
10525bd8deadSopenharmony_ci            2           321             rendering command opcode
10535bd8deadSopenharmony_ci            8           CARD64          image
10545bd8deadSopenharmony_ci            4           ENUM            target
10555bd8deadSopenharmony_ci            4           ENUM            internalformat
10565bd8deadSopenharmony_ci            4           CARD32          width
10575bd8deadSopenharmony_ci            4           CARD32          height
10585bd8deadSopenharmony_ci            4           ENUM            apiFormat
10595bd8deadSopenharmony_ci            4           ENUM            apiType
10605bd8deadSopenharmony_ci
10615bd8deadSopenharmony_ci        DrawPixelsPBO
10625bd8deadSopenharmony_ci
10635bd8deadSopenharmony_ci            2           28              rendering command length
10645bd8deadSopenharmony_ci            2           322             rendering command opcode
10655bd8deadSopenharmony_ci            8           CARD64          image
10665bd8deadSopenharmony_ci            4           CARD32          width
10675bd8deadSopenharmony_ci            4           CARD32          height
10685bd8deadSopenharmony_ci            4           ENUM            apiFormat
10695bd8deadSopenharmony_ci            4           ENUM            apiType
10705bd8deadSopenharmony_ci   
10715bd8deadSopenharmony_ci        PixelMapfvPBO
10725bd8deadSopenharmony_ci
10735bd8deadSopenharmony_ci            2           20              rendering command length
10745bd8deadSopenharmony_ci            2           323             rendering command opcode
10755bd8deadSopenharmony_ci            8           CARD64          values
10765bd8deadSopenharmony_ci            4           ENUM            map
10775bd8deadSopenharmony_ci            4           CARD32          mapsize
10785bd8deadSopenharmony_ci
10795bd8deadSopenharmony_ci        PixelMapuivPBO
10805bd8deadSopenharmony_ci
10815bd8deadSopenharmony_ci            2           20              rendering command length
10825bd8deadSopenharmony_ci            2           324             rendering command opcode
10835bd8deadSopenharmony_ci            8           CARD64          values
10845bd8deadSopenharmony_ci            4           ENUM            map
10855bd8deadSopenharmony_ci            4           CARD32          mapsize
10865bd8deadSopenharmony_ci
10875bd8deadSopenharmony_ci        PixelMapusvPBO
10885bd8deadSopenharmony_ci
10895bd8deadSopenharmony_ci            2           20              rendering command length
10905bd8deadSopenharmony_ci            2           325             rendering command opcode
10915bd8deadSopenharmony_ci            8           CARD64          values
10925bd8deadSopenharmony_ci            4           ENUM            map
10935bd8deadSopenharmony_ci            4           CARD32          mapsize
10945bd8deadSopenharmony_ci   
10955bd8deadSopenharmony_ci        PolygonStipplePBO
10965bd8deadSopenharmony_ci
10975bd8deadSopenharmony_ci            2           12              rendering command length
10985bd8deadSopenharmony_ci            2           326             rendering command opcode
10995bd8deadSopenharmony_ci            8           CARD64          mask
11005bd8deadSopenharmony_ci
11015bd8deadSopenharmony_ci        SeparableFilter2DPBO
11025bd8deadSopenharmony_ci
11035bd8deadSopenharmony_ci            2           44              rendering command length
11045bd8deadSopenharmony_ci            2           327             rendering command opcode
11055bd8deadSopenharmony_ci            8           CARD64          row
11065bd8deadSopenharmony_ci            8           CARD64          column
11075bd8deadSopenharmony_ci            4           ENUM            target
11085bd8deadSopenharmony_ci            4           ENUM            internalFormat
11095bd8deadSopenharmony_ci            4           CARD32          width
11105bd8deadSopenharmony_ci            4           CARD32          height
11115bd8deadSopenharmony_ci            4           ENUM            apiFormat
11125bd8deadSopenharmony_ci            4           ENUM            apiType
11135bd8deadSopenharmony_ci
11145bd8deadSopenharmony_ci        TexImage1DPBO
11155bd8deadSopenharmony_ci
11165bd8deadSopenharmony_ci            2           40              rendering command length
11175bd8deadSopenharmony_ci            2           328             rendering command opcode
11185bd8deadSopenharmony_ci            8           CARD64          image
11195bd8deadSopenharmony_ci            4           ENUM            target
11205bd8deadSopenharmony_ci            4           CARD32          level
11215bd8deadSopenharmony_ci            4           CARD32          components
11225bd8deadSopenharmony_ci            4           CARD32          width
11235bd8deadSopenharmony_ci            4           CARD32          border
11245bd8deadSopenharmony_ci            4           ENUM            apiFormat
11255bd8deadSopenharmony_ci            4           ENUM            apiType
11265bd8deadSopenharmony_ci
11275bd8deadSopenharmony_ci        TexImage2DPBO
11285bd8deadSopenharmony_ci
11295bd8deadSopenharmony_ci            2           44              rendering command length
11305bd8deadSopenharmony_ci            2           329             rendering command opcode
11315bd8deadSopenharmony_ci            8           CARD64          image
11325bd8deadSopenharmony_ci            4           ENUM            target
11335bd8deadSopenharmony_ci            4           CARD32          level
11345bd8deadSopenharmony_ci            4           CARD32          components
11355bd8deadSopenharmony_ci            4           CARD32          width
11365bd8deadSopenharmony_ci            4           CARD32          height
11375bd8deadSopenharmony_ci            4           CARD32          border
11385bd8deadSopenharmony_ci            4           ENUM            apiFormat
11395bd8deadSopenharmony_ci            4           ENUM            apiType
11405bd8deadSopenharmony_ci
11415bd8deadSopenharmony_ci        TexImage3DPBO
11425bd8deadSopenharmony_ci
11435bd8deadSopenharmony_ci            2           48              rendering command length
11445bd8deadSopenharmony_ci            2           330             rendering command opcode
11455bd8deadSopenharmony_ci            8           CARD64          image
11465bd8deadSopenharmony_ci            4           ENUM            target
11475bd8deadSopenharmony_ci            4           CARD32          level
11485bd8deadSopenharmony_ci            4           CARD32          components
11495bd8deadSopenharmony_ci            4           CARD32          width
11505bd8deadSopenharmony_ci            4           CARD32          height
11515bd8deadSopenharmony_ci            4           CARD32          depth
11525bd8deadSopenharmony_ci            4           CARD32          border
11535bd8deadSopenharmony_ci            4           ENUM            apiFormat
11545bd8deadSopenharmony_ci            4           ENUM            apiType
11555bd8deadSopenharmony_ci
11565bd8deadSopenharmony_ci        TexSubImage1DPBO
11575bd8deadSopenharmony_ci
11585bd8deadSopenharmony_ci            2           36              rendering command length
11595bd8deadSopenharmony_ci            2           331             rendering command opcode
11605bd8deadSopenharmony_ci            8           CARD64          image
11615bd8deadSopenharmony_ci            4           ENUM            target
11625bd8deadSopenharmony_ci            4           CARD32          level
11635bd8deadSopenharmony_ci            4           CARD32          xoffset
11645bd8deadSopenharmony_ci            4           CARD32          width
11655bd8deadSopenharmony_ci            4           ENUM            apiFormat
11665bd8deadSopenharmony_ci            4           ENUM            apiType
11675bd8deadSopenharmony_ci
11685bd8deadSopenharmony_ci        TexSubImage2DPBO
11695bd8deadSopenharmony_ci
11705bd8deadSopenharmony_ci            2           44              rendering command length
11715bd8deadSopenharmony_ci            2           332             rendering command opcode
11725bd8deadSopenharmony_ci            8           CARD64          image
11735bd8deadSopenharmony_ci            4           ENUM            target
11745bd8deadSopenharmony_ci            4           CARD32          level
11755bd8deadSopenharmony_ci            4           CARD32          xoffset
11765bd8deadSopenharmony_ci            4           CARD32          yoffset
11775bd8deadSopenharmony_ci            4           CARD32          width
11785bd8deadSopenharmony_ci            4           CARD32          height
11795bd8deadSopenharmony_ci            4           ENUM            apiFormat
11805bd8deadSopenharmony_ci            4           ENUM            apiType
11815bd8deadSopenharmony_ci
11825bd8deadSopenharmony_ci        TexSubImage3DPBO
11835bd8deadSopenharmony_ci
11845bd8deadSopenharmony_ci            2           52              rendering command length
11855bd8deadSopenharmony_ci            2           333             rendering command opcode
11865bd8deadSopenharmony_ci            8           CARD64          image
11875bd8deadSopenharmony_ci            4           ENUM            target
11885bd8deadSopenharmony_ci            4           CARD32          level
11895bd8deadSopenharmony_ci            4           CARD32          xoffset
11905bd8deadSopenharmony_ci            4           CARD32          yoffset
11915bd8deadSopenharmony_ci            4           CARD32          zoffset
11925bd8deadSopenharmony_ci            4           CARD32          width
11935bd8deadSopenharmony_ci            4           CARD32          height
11945bd8deadSopenharmony_ci            4           CARD32          depth
11955bd8deadSopenharmony_ci            4           ENUM            apiFormat
11965bd8deadSopenharmony_ci            4           ENUM            apiType
11975bd8deadSopenharmony_ci
11985bd8deadSopenharmony_ci        GetColorTablePBO
11995bd8deadSopenharmony_ci
12005bd8deadSopenharmony_ci            2           24              rendering command length
12015bd8deadSopenharmony_ci            2           334             rendering command opcode
12025bd8deadSopenharmony_ci            8           CARD64          table
12035bd8deadSopenharmony_ci            4           ENUM            target
12045bd8deadSopenharmony_ci            4           ENUM            apiFormat
12055bd8deadSopenharmony_ci            4           ENUM            apiType
12065bd8deadSopenharmony_ci 
12075bd8deadSopenharmony_ci        GetCompressedTexImagePBO
12085bd8deadSopenharmony_ci
12095bd8deadSopenharmony_ci            2           20              rendering command length
12105bd8deadSopenharmony_ci            2           335             rendering command opcode
12115bd8deadSopenharmony_ci            8           CARD64          img
12125bd8deadSopenharmony_ci            4           ENUM            target
12135bd8deadSopenharmony_ci            4           CARD32          lod
12145bd8deadSopenharmony_ci
12155bd8deadSopenharmony_ci        GetConvolutionFilterPBO
12165bd8deadSopenharmony_ci
12175bd8deadSopenharmony_ci            2           24              rendering command length
12185bd8deadSopenharmony_ci            2           336             rendering command opcode
12195bd8deadSopenharmony_ci            8           CARD64          image
12205bd8deadSopenharmony_ci            4           ENUM            target
12215bd8deadSopenharmony_ci            4           ENUM            apiFormat
12225bd8deadSopenharmony_ci            4           ENUM            apiType
12235bd8deadSopenharmony_ci
12245bd8deadSopenharmony_ci        GetHistogramPBO
12255bd8deadSopenharmony_ci
12265bd8deadSopenharmony_ci            2           28              rendering command length
12275bd8deadSopenharmony_ci            2           337             rendering command opcode
12285bd8deadSopenharmony_ci            8           CARD64          values
12295bd8deadSopenharmony_ci            4           ENUM            target
12305bd8deadSopenharmony_ci            4           ENUM            apiFormat
12315bd8deadSopenharmony_ci            4           ENUM            apiType
12325bd8deadSopenharmony_ci            1           BOOL            reset
12335bd8deadSopenharmony_ci            3                           unused
12345bd8deadSopenharmony_ci
12355bd8deadSopenharmony_ci        GetMinmaxPBO
12365bd8deadSopenharmony_ci
12375bd8deadSopenharmony_ci            2           28              rendering command length
12385bd8deadSopenharmony_ci            2           338             rendering command opcode
12395bd8deadSopenharmony_ci            8           CARD64          values
12405bd8deadSopenharmony_ci            4           ENUM            target
12415bd8deadSopenharmony_ci            4           ENUM            apiFormat
12425bd8deadSopenharmony_ci            4           ENUM            apiType
12435bd8deadSopenharmony_ci            1           BOOL            reset
12445bd8deadSopenharmony_ci            3                           unused
12455bd8deadSopenharmony_ci
12465bd8deadSopenharmony_ci        GetPixelMapfvPBO
12475bd8deadSopenharmony_ci
12485bd8deadSopenharmony_ci            2           16              rendering command length
12495bd8deadSopenharmony_ci            2           339             rendering command opcode
12505bd8deadSopenharmony_ci            8           CARD64          values
12515bd8deadSopenharmony_ci            4           ENUM            map
12525bd8deadSopenharmony_ci
12535bd8deadSopenharmony_ci        GetPixelMapuivPBO
12545bd8deadSopenharmony_ci
12555bd8deadSopenharmony_ci            2           16              rendering command length
12565bd8deadSopenharmony_ci            2           340             rendering command opcode
12575bd8deadSopenharmony_ci            8           CARD64          values
12585bd8deadSopenharmony_ci            4           ENUM            map
12595bd8deadSopenharmony_ci
12605bd8deadSopenharmony_ci        GetPixelMapusvPBO
12615bd8deadSopenharmony_ci
12625bd8deadSopenharmony_ci            2           16              rendering command length
12635bd8deadSopenharmony_ci            2           341             rendering command opcode
12645bd8deadSopenharmony_ci            8           CARD64          values
12655bd8deadSopenharmony_ci            4           ENUM            map
12665bd8deadSopenharmony_ci
12675bd8deadSopenharmony_ci        GetPolygonStipplePBO
12685bd8deadSopenharmony_ci
12695bd8deadSopenharmony_ci            2           12              rendering command length
12705bd8deadSopenharmony_ci            2           342             rendering command opcode
12715bd8deadSopenharmony_ci            8           CARD64          mask
12725bd8deadSopenharmony_ci
12735bd8deadSopenharmony_ci        GetSeparableFilterPBO
12745bd8deadSopenharmony_ci
12755bd8deadSopenharmony_ci            2           40              rendering command length
12765bd8deadSopenharmony_ci            2           343             rendering command opcode
12775bd8deadSopenharmony_ci            8           CARD64          row
12785bd8deadSopenharmony_ci            8           CARD64          column
12795bd8deadSopenharmony_ci            8           CARD64          span
12805bd8deadSopenharmony_ci            4           ENUM            target
12815bd8deadSopenharmony_ci            4           ENUM            apiFormat
12825bd8deadSopenharmony_ci            4           ENUM            apiType
12835bd8deadSopenharmony_ci
12845bd8deadSopenharmony_ci        GetTexImagePBO
12855bd8deadSopenharmony_ci
12865bd8deadSopenharmony_ci            2           28              rendering command length
12875bd8deadSopenharmony_ci            2           344             rendering command opcode
12885bd8deadSopenharmony_ci            8           CARD64          texels
12895bd8deadSopenharmony_ci            4           ENUM            target
12905bd8deadSopenharmony_ci            4           CARD32          level
12915bd8deadSopenharmony_ci            4           ENUM            apiFormat
12925bd8deadSopenharmony_ci            4           ENUM            apiType
12935bd8deadSopenharmony_ci
12945bd8deadSopenharmony_ci        ReadPixelsPBO
12955bd8deadSopenharmony_ci
12965bd8deadSopenharmony_ci            2           36              rendering command length
12975bd8deadSopenharmony_ci            2           345             rendering command opcode
12985bd8deadSopenharmony_ci            8           CARD64          pixels
12995bd8deadSopenharmony_ci            4           CARD32          x
13005bd8deadSopenharmony_ci            4           CARD32          y
13015bd8deadSopenharmony_ci            4           CARD32          width
13025bd8deadSopenharmony_ci            4           CARD32          height
13035bd8deadSopenharmony_ci            4           ENUM            apiFormat
13045bd8deadSopenharmony_ci            4           ENUM            apiType
13055bd8deadSopenharmony_ci
13065bd8deadSopenharmony_ci
13075bd8deadSopenharmony_ciErrors
13085bd8deadSopenharmony_ci
13095bd8deadSopenharmony_ci    INVALID_ENUM is generated if the <target> parameter of
13105bd8deadSopenharmony_ci    BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer,
13115bd8deadSopenharmony_ci    GetBufferSubData, GetBufferParameteriv, or GetBufferPointerv is not
13125bd8deadSopenharmony_ci    one of ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, PIXEL_PACK_BUFFER_ARB,
13135bd8deadSopenharmony_ci    or PIXEL_UNPACK_BUFFER_ARB.
13145bd8deadSopenharmony_ci
13155bd8deadSopenharmony_ci    INVALID_OPERATION is generated if Bitmap, ColorSubTable, ColorTable,
13165bd8deadSopenharmony_ci    CompressedTexImage1D, CompressedTexImage2D, CompressedTexImage3D,
13175bd8deadSopenharmony_ci    CompressedTexSubImage1D, CompressedTexSubImage2D,
13185bd8deadSopenharmony_ci    CompressedTexSubImage3D, ConvolutionFilter1D, ConvolutionFilter2D,
13195bd8deadSopenharmony_ci    DrawPixels, PixelMapfv, PixelMapuiv, PixelMapusv, PolygonStipple,
13205bd8deadSopenharmony_ci    SeparableFilter2D, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D,
13215bd8deadSopenharmony_ci    TexSubImage2D, or TexSubImage3D would unpack (read) data from the
13225bd8deadSopenharmony_ci    currently bound PIXEL_UNPACK_BUFFER_ARB buffer object such that
13235bd8deadSopenharmony_ci    the memory reads required for the command would exceed the memory
13245bd8deadSopenharmony_ci    (data store) size of the buffer object.
13255bd8deadSopenharmony_ci
13265bd8deadSopenharmony_ci    INVALID_OPERATION is generated if GetColorTable,
13275bd8deadSopenharmony_ci    GetCompressedTexImage, GetConvolutionFilter, GetHistogram, GetMinmax,
13285bd8deadSopenharmony_ci    GetPixelMapfv, GetPixelMapuiv, GetPixelMapusv, GetPolygonStipple,
13295bd8deadSopenharmony_ci    GetSeparableFilter, GetTexImage, or ReadPixels would pack (write) data
13305bd8deadSopenharmony_ci    to the currently bound PIXEL_PACK_BUFFER_ARB buffer object such that
13315bd8deadSopenharmony_ci    the memory writes required for the command would exceed the memory
13325bd8deadSopenharmony_ci    (data store) size of the buffer object.
13335bd8deadSopenharmony_ci
13345bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GetColorTable, GetConvolutionFilter,
13355bd8deadSopenharmony_ci    GetHistogram, GetMinmax, GetSeparableFilter, GetTexImage and ReadPixels
13365bd8deadSopenharmony_ci    if the current PIXEL_PACK_BUFFER_BINDING_ARB value is non-zero and the
13375bd8deadSopenharmony_ci    table/image/values/span/img/data parameter is not evenly divisible
13385bd8deadSopenharmony_ci    into the number of basic machine units needed to store in memory a
13395bd8deadSopenharmony_ci    datum indicated by the type parameter.
13405bd8deadSopenharmony_ci
13415bd8deadSopenharmony_ci    INVALID_OPERATION is generated by ColorTable, ColorSubTable,
13425bd8deadSopenharmony_ci    ConvolutionFilter2D, ConvolutionFilter1D, SeparableFilter2D,
13435bd8deadSopenharmony_ci    TexImage1D, TexImage2D, TexImage3D, TexSubImage1D,
13445bd8deadSopenharmony_ci    TexSubImage2D, TexSubImage3D, and DrawPixels if the current
13455bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data
13465bd8deadSopenharmony_ci    parameter is not evenly divisible into the number of basic machine
13475bd8deadSopenharmony_ci    units needed to store in memory a datum indicated by the type
13485bd8deadSopenharmony_ci    parameter.
13495bd8deadSopenharmony_ci
13505bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GetPixelMapfv if the current
13515bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_BINDING_ARB value is non-zero and the data parameter
13525bd8deadSopenharmony_ci    is not evenly divisible into the number of basic machine units needed
13535bd8deadSopenharmony_ci    to store in memory a float datum.
13545bd8deadSopenharmony_ci
13555bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GetPixelMapuiv if the current
13565bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_BINDING_ARB value is non-zero and the data parameter
13575bd8deadSopenharmony_ci    is not evenly divisible into the number of basic machine units needed
13585bd8deadSopenharmony_ci    to store in memory a uint datum.
13595bd8deadSopenharmony_ci
13605bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GetPixelMapusv if the current
13615bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_BINDING_ARB value is non-zero and the data parameter
13625bd8deadSopenharmony_ci    is not evenly divisible into the number of basic machine units needed
13635bd8deadSopenharmony_ci    to store in memory a ushort datum.
13645bd8deadSopenharmony_ci
13655bd8deadSopenharmony_ci    INVALID_OPERATION is generated by PixelMapfv if the current
13665bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data
13675bd8deadSopenharmony_ci    parameter is not evenly divisible into the number of basic machine
13685bd8deadSopenharmony_ci    units needed to store in memory a float datum.
13695bd8deadSopenharmony_ci
13705bd8deadSopenharmony_ci    INVALID_OPERATION is generated by PixelMapuiv if the current
13715bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data
13725bd8deadSopenharmony_ci    parameter is not evenly divisible into the number of basic machine
13735bd8deadSopenharmony_ci    units needed to store in memory a uint datum.
13745bd8deadSopenharmony_ci
13755bd8deadSopenharmony_ci    INVALID_OPERATION is generated by PixelMapusv if the current
13765bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data
13775bd8deadSopenharmony_ci    parameter is not evenly divisible into the number of basic machine
13785bd8deadSopenharmony_ci    units needed to store in memory a ushort datum.
13795bd8deadSopenharmony_ci
13805bd8deadSopenharmony_ci
13815bd8deadSopenharmony_ciDependencies on EXT_pixel_buffer_object
13825bd8deadSopenharmony_ci
13835bd8deadSopenharmony_ci    When this extension is supported, the EXT_pixel_buffer_object
13845bd8deadSopenharmony_ci    functionality adopts the tighter alignment and buffer bounds overflow
13855bd8deadSopenharmony_ci    error generation behavior of ARB_pixel_buffer_object (previously,
13865bd8deadSopenharmony_ci    EXT_pixel_buffer_object was not explicit about what happened in
13875bd8deadSopenharmony_ci    these situations).  This is because the two extensions share the
13885bd8deadSopenharmony_ci    same enumerants.
13895bd8deadSopenharmony_ci
13905bd8deadSopenharmony_ciDependencies on NV_pixel_data_range
13915bd8deadSopenharmony_ci
13925bd8deadSopenharmony_ci    A non-zero pixel pack buffer binding takes priority over the
13935bd8deadSopenharmony_ci    READ_PIXEL_DATA_RANGE_NV  enable.
13945bd8deadSopenharmony_ci
13955bd8deadSopenharmony_ci    A non-zero pixel unpack buffer binding takes priority over the
13965bd8deadSopenharmony_ci    WRITE_PIXEL_DATA_RANGE_NV enable.
13975bd8deadSopenharmony_ci
13985bd8deadSopenharmony_ci
13995bd8deadSopenharmony_ciNew State
14005bd8deadSopenharmony_ci
14015bd8deadSopenharmony_ci(table 6.20, Pixels, p. 235)
14025bd8deadSopenharmony_ci
14035bd8deadSopenharmony_ci                                                         Initial
14045bd8deadSopenharmony_ci    Get Value                        Type   Get Command  Value    Sec     Attribute
14055bd8deadSopenharmony_ci    -------------------------------  ----   -----------  -------  ------  -----------
14065bd8deadSopenharmony_ci    PIXEL_PACK_BUFFER_BINDING_ARB    Z+     GetIntegerv  0        4.3.5   pixel-store
14075bd8deadSopenharmony_ci    PIXEL_UNPACK_BUFFER_BINDING_ARB  Z+     GetIntegerv  0        6.1.13  pixel-store
14085bd8deadSopenharmony_ci
14095bd8deadSopenharmony_ci
14105bd8deadSopenharmony_ciNew Implementation Dependent State
14115bd8deadSopenharmony_ci
14125bd8deadSopenharmony_ci    (none)
14135bd8deadSopenharmony_ci
14145bd8deadSopenharmony_ci
14155bd8deadSopenharmony_ciUsage Examples
14165bd8deadSopenharmony_ci
14175bd8deadSopenharmony_ci    Convenient macro definition for specifying buffer offsets:
14185bd8deadSopenharmony_ci
14195bd8deadSopenharmony_ci        #define BUFFER_OFFSET(i) ((char *)NULL + (i))
14205bd8deadSopenharmony_ci
14215bd8deadSopenharmony_ci    Example 1: Render to vertex array:
14225bd8deadSopenharmony_ci
14235bd8deadSopenharmony_ci        const int numberVertices = 100;
14245bd8deadSopenharmony_ci
14255bd8deadSopenharmony_ci        // Create a buffer object for a number of vertices consisting of
14265bd8deadSopenharmony_ci        // 4 float values per vertex
14275bd8deadSopenharmony_ci        glGenBuffers(1, vertexBuffer);
14285bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, vertexBuffer);
14295bd8deadSopenharmony_ci        glBufferData(GL_PIXEL_PACK_BUFFER_ARB, numberVertices*4,
14305bd8deadSopenharmony_ci                     NULL, GL_DYNAMIC_DRAW);
14315bd8deadSopenharmony_ci
14325bd8deadSopenharmony_ci        // Render vertex data into 100x1 strip of framebuffer using a
14335bd8deadSopenharmony_ci        // fragment program
14345bd8deadSopenharmony_ci        glBindProgram(FRAGMENT_PROGRAM_ARB, fragmentProgram);
14355bd8deadSopenharmony_ci        glDrawBuffer(GL_BACK);
14365bd8deadSopenharmony_ci        renderVertexData();
14375bd8deadSopenharmony_ci        glBindProgramARB(FRAGMENT_PROGRAM_ARB, 0);
14385bd8deadSopenharmony_ci
14395bd8deadSopenharmony_ci        // Read the vertex data back from framebuffer
14405bd8deadSopenharmony_ci        glReadBuffer(GL_BACK);
14415bd8deadSopenharmony_ci        glReadPixels(0, 0, numberVertices, 1, GL_BGRA, GL_FLOAT,
14425bd8deadSopenharmony_ci                     BUFFER_OFFSET(0));
14435bd8deadSopenharmony_ci
14445bd8deadSopenharmony_ci        // Change the binding point of the buffer object to
14455bd8deadSopenharmony_ci        // the vertex array binding point
14465bd8deadSopenharmony_ci        glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
14475bd8deadSopenharmony_ci
14485bd8deadSopenharmony_ci        glEnableClientState(VERTEX_ARRAY);
14495bd8deadSopenharmony_ci        glVertexPointer(4, GL_FLOAT, 0, BUFFER_OFFSET(0));
14505bd8deadSopenharmony_ci        glDrawArrays(TRIANGLE_STRIP, 0, numberVertices);
14515bd8deadSopenharmony_ci
14525bd8deadSopenharmony_ci
14535bd8deadSopenharmony_ci    Example 2: Streaming textures
14545bd8deadSopenharmony_ci
14555bd8deadSopenharmony_ci    Streaming textures using NV_pixel_data_range:
14565bd8deadSopenharmony_ci
14575bd8deadSopenharmony_ci        const int texWidth = 256;
14585bd8deadSopenharmony_ci        const int texHeight = 256;
14595bd8deadSopenharmony_ci        const int texsize = texWidth * texHeight * 4;
14605bd8deadSopenharmony_ci        void *pdrMemory, *texData;
14615bd8deadSopenharmony_ci
14625bd8deadSopenharmony_ci        pdrMemory = glAllocateMemoryNV(texsize, 0.0, 1.0, 1.0);
14635bd8deadSopenharmony_ci
14645bd8deadSopenharmony_ci        glPixelDataRangeNV(GL_WRITE_PIXEL_DATA_RANGE_NV, texsize,
14655bd8deadSopenharmony_ci                           pdrMemory);
14665bd8deadSopenharmony_ci
14675bd8deadSopenharmony_ci        glEnableClientState(GL_WRITE_PIXEL_DATA_RANGE_NV);
14685bd8deadSopenharmony_ci
14695bd8deadSopenharmony_ci        // Define texture level (without an image)
14705bd8deadSopenharmony_ci        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texWidth, texHeight, 0,
14715bd8deadSopenharmony_ci                     GL_BGRA, GL_UNSIGNED_BYTE, NULL);
14725bd8deadSopenharmony_ci        // Setup texture environment
14735bd8deadSopenharmony_ci        ...
14745bd8deadSopenharmony_ci
14755bd8deadSopenharmony_ci        texData = getNextImage();
14765bd8deadSopenharmony_ci
14775bd8deadSopenharmony_ci        while (texData) {
14785bd8deadSopenharmony_ci
14795bd8deadSopenharmony_ci            memcpy(pdrMemory, texData, texsize);
14805bd8deadSopenharmony_ci
14815bd8deadSopenharmony_ci            glFlushPixelDataRangeNV(GL_WRITE_PIXEL_DATA_RANGE_NV);
14825bd8deadSopenharmony_ci
14835bd8deadSopenharmony_ci            glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, texWidth, texHeight,
14845bd8deadSopenharmony_ci                            GL_BGRA, GL_UNSIGNED_BYTE, pdrMemory);
14855bd8deadSopenharmony_ci
14865bd8deadSopenharmony_ci            // Draw textured geometry
14875bd8deadSopenharmony_ci            glBegin(GL_QUADS);
14885bd8deadSopenharmony_ci            ...
14895bd8deadSopenharmony_ci            glEnd();
14905bd8deadSopenharmony_ci
14915bd8deadSopenharmony_ci            texData = getNextImage();
14925bd8deadSopenharmony_ci        }
14935bd8deadSopenharmony_ci
14945bd8deadSopenharmony_ci        glDisableClientState(GL_WRITE_PIXEL_DATA_RANGE_NV);
14955bd8deadSopenharmony_ci
14965bd8deadSopenharmony_ci        glFreeMemoryNV(pdrMemory);
14975bd8deadSopenharmony_ci
14985bd8deadSopenharmony_ci
14995bd8deadSopenharmony_ci    Streaming textures using pixel buffer objects:
15005bd8deadSopenharmony_ci
15015bd8deadSopenharmony_ci        const int texWidth = 256;
15025bd8deadSopenharmony_ci        const int texHeight = 256;
15035bd8deadSopenharmony_ci        const int texsize = texWidth * texHeight * 4;
15045bd8deadSopenharmony_ci        void *pboMemory, *texData;
15055bd8deadSopenharmony_ci
15065bd8deadSopenharmony_ci        // Define texture level zero (without an image); notice the
15075bd8deadSopenharmony_ci        // explicit bind to the zero pixel unpack buffer object so that
15085bd8deadSopenharmony_ci        // pass NULL for the image data leaves the texture image
15095bd8deadSopenharmony_ci        // unspecified.
15105bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
15115bd8deadSopenharmony_ci        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texWidth, texHeight, 0,
15125bd8deadSopenharmony_ci                     GL_BGRA, GL_UNSIGNED_BYTE, NULL);
15135bd8deadSopenharmony_ci
15145bd8deadSopenharmony_ci        // Create and bind texture image buffer object
15155bd8deadSopenharmony_ci        glGenBuffers(1, &texBuffer);
15165bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, texBuffer);
15175bd8deadSopenharmony_ci
15185bd8deadSopenharmony_ci        // Setup texture environment
15195bd8deadSopenharmony_ci        ...
15205bd8deadSopenharmony_ci
15215bd8deadSopenharmony_ci        texData = getNextImage();
15225bd8deadSopenharmony_ci
15235bd8deadSopenharmony_ci        while (texData) {
15245bd8deadSopenharmony_ci
15255bd8deadSopenharmony_ci            // Reset the contents of the texSize-sized buffer object
15265bd8deadSopenharmony_ci            glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, texSize, NULL,
15275bd8deadSopenharmony_ci                         GL_STREAM_DRAW);
15285bd8deadSopenharmony_ci
15295bd8deadSopenharmony_ci            // Map the texture image buffer (the contents of which
15305bd8deadSopenharmony_ci            // are undefined due to the previous glBufferData)
15315bd8deadSopenharmony_ci            pboMemory = glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,
15325bd8deadSopenharmony_ci                                    GL_WRITE_ONLY);
15335bd8deadSopenharmony_ci
15345bd8deadSopenharmony_ci            // Modify (sub-)buffer data
15355bd8deadSopenharmony_ci            memcpy(pboMemory, texData, texsize);
15365bd8deadSopenharmony_ci
15375bd8deadSopenharmony_ci            // Unmap the texture image buffer
15385bd8deadSopenharmony_ci            glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
15395bd8deadSopenharmony_ci
15405bd8deadSopenharmony_ci            // Update (sub-)teximage from texture image buffer
15415bd8deadSopenharmony_ci            glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, texWidth, texHeight,
15425bd8deadSopenharmony_ci                            GL_BGRA, GL_UNSIGNED_BYTE, BUFFER_OFFSET(0));
15435bd8deadSopenharmony_ci
15445bd8deadSopenharmony_ci            // Draw textured geometry
15455bd8deadSopenharmony_ci            glBegin(GL_QUADS);
15465bd8deadSopenharmony_ci            ...
15475bd8deadSopenharmony_ci            glEnd();
15485bd8deadSopenharmony_ci
15495bd8deadSopenharmony_ci            texData = getNextImage();
15505bd8deadSopenharmony_ci        }
15515bd8deadSopenharmony_ci
15525bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
15535bd8deadSopenharmony_ci
15545bd8deadSopenharmony_ci
15555bd8deadSopenharmony_ci    Example 3: Asynchronous glReadPixels
15565bd8deadSopenharmony_ci
15575bd8deadSopenharmony_ci    Traditional glReadPixels:
15585bd8deadSopenharmony_ci
15595bd8deadSopenharmony_ci        const int imagewidth = 640;
15605bd8deadSopenharmony_ci        const int imageheight = 480;
15615bd8deadSopenharmony_ci        GLubyte readBuffer[imagewidth*imageheight*4];
15625bd8deadSopenharmony_ci
15635bd8deadSopenharmony_ci        // Render to framebuffer
15645bd8deadSopenharmony_ci        glDrawBuffer(GL_BACK);
15655bd8deadSopenharmony_ci        renderScene()
15665bd8deadSopenharmony_ci
15675bd8deadSopenharmony_ci        // Read image from framebuffer
15685bd8deadSopenharmony_ci        glReadBuffer(GL_BACK);
15695bd8deadSopenharmony_ci        glReadPixels(0, 0, imagewidth, imageheight, GL_BGRA,
15705bd8deadSopenharmony_ci                     GL_UNSIGNED_BYTE, readBuffer);
15715bd8deadSopenharmony_ci
15725bd8deadSopenharmony_ci        // Process image when glReadPixels returns after reading the
15735bd8deadSopenharmony_ci        // whole buffer
15745bd8deadSopenharmony_ci        processImage(readBuffer);
15755bd8deadSopenharmony_ci
15765bd8deadSopenharmony_ci
15775bd8deadSopenharmony_ci    Asynchronous glReadPixels:
15785bd8deadSopenharmony_ci
15795bd8deadSopenharmony_ci        const int imagewidth = 640;
15805bd8deadSopenharmony_ci        const int imageheight = 480;
15815bd8deadSopenharmony_ci        const int imageSize = imagewidth*imageheight*4;
15825bd8deadSopenharmony_ci
15835bd8deadSopenharmony_ci        glGenBuffers(2, imageBuffers);
15845bd8deadSopenharmony_ci
15855bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[0]);
15865bd8deadSopenharmony_ci        glBufferData(GL_PIXEL_PACK_BUFFER_ARB, imageSize / 2, NULL,
15875bd8deadSopenharmony_ci                     GL_STREAM_READ);
15885bd8deadSopenharmony_ci
15895bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[1]);
15905bd8deadSopenharmony_ci        glBufferData(GL_PIXEL_PACK_BUFFER_ARB, imageSize / 2, NULL,
15915bd8deadSopenharmony_ci                     GL_STREAM_READ);
15925bd8deadSopenharmony_ci
15935bd8deadSopenharmony_ci        // Render to framebuffer
15945bd8deadSopenharmony_ci        glDrawBuffer(GL_BACK);
15955bd8deadSopenharmony_ci        renderScene();
15965bd8deadSopenharmony_ci
15975bd8deadSopenharmony_ci        // Bind two different buffer objects and start the glReadPixels
15985bd8deadSopenharmony_ci        // asynchronously. Each call will return directly after
15995bd8deadSopenharmony_ci        // starting the DMA transfer.
16005bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[0]);
16015bd8deadSopenharmony_ci        glReadPixels(0, 0, imagewidth, imageheight/2, GL_BGRA,
16025bd8deadSopenharmony_ci                     GL_UNSIGNED_BYTE, BUFFER_OFFSET(0));
16035bd8deadSopenharmony_ci
16045bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[1]);
16055bd8deadSopenharmony_ci        glReadPixels(0, imageheight/2, imagewidth, imageheight/2, GL_BGRA,
16065bd8deadSopenharmony_ci                     GL_UNSIGNED_BYTE, BUFFER_OFFSET(0));
16075bd8deadSopenharmony_ci
16085bd8deadSopenharmony_ci        // Process partial images.  Mapping the buffer waits for
16095bd8deadSopenharmony_ci        // outstanding DMA transfers into the buffer to finish.
16105bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[0]);
16115bd8deadSopenharmony_ci        pboMemory1 = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,
16125bd8deadSopenharmony_ci                                 GL_READ_ONLY);
16135bd8deadSopenharmony_ci        processImage(pboMemory1);
16145bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[1]);
16155bd8deadSopenharmony_ci        pboMemory2 = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,
16165bd8deadSopenharmony_ci                                 GL_READ_ONLY);
16175bd8deadSopenharmony_ci        processImage(pboMemory2);
16185bd8deadSopenharmony_ci
16195bd8deadSopenharmony_ci        // Unmap the image buffers
16205bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[0]);
16215bd8deadSopenharmony_ci        glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
16225bd8deadSopenharmony_ci        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, imageBuffers[1]);
16235bd8deadSopenharmony_ci        glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
16245bd8deadSopenharmony_ci
16255bd8deadSopenharmony_ci
16265bd8deadSopenharmony_ciAppendix on Pack/Unpack Range
16275bd8deadSopenharmony_ci
16285bd8deadSopenharmony_ci    The complexity of OpenGL's pixel pack/unpack state makes it difficult
16295bd8deadSopenharmony_ci    to express succinctly what range of a pixel buffer object will be
16305bd8deadSopenharmony_ci    accessed by a pixel command.
16315bd8deadSopenharmony_ci
16325bd8deadSopenharmony_ci    The following code, following the conventions of the SGI OpenGL
16335bd8deadSopenharmony_ci    Sample Implementation, returns the limit (one byte more than the
16345bd8deadSopenharmony_ci    maximum allowed offset into the buffer object) for the memory a
16355bd8deadSopenharmony_ci    pixel command will read/write.
16365bd8deadSopenharmony_ci
16375bd8deadSopenharmony_ci    /*
16385bd8deadSopenharmony_ci    ** Compute offset limit into user's data considering all pixel
16395bd8deadSopenharmony_ci    ** store modes.  This offset limit is ONE MORE than the largest byte
16405bd8deadSopenharmony_ci    ** offset for the image.
16415bd8deadSopenharmony_ci    */
16425bd8deadSopenharmony_ci    static GLsizeiptr OffsetLimitImage3D(__GLpixelStoreMode *pixelStoreMode,
16435bd8deadSopenharmony_ci                                         GLsizei width, GLsizei height,
16445bd8deadSopenharmony_ci                                         GLsizei depth,
16455bd8deadSopenharmony_ci                                         GLenum format, GLenum type,
16465bd8deadSopenharmony_ci                                         const void *userdata,
16475bd8deadSopenharmony_ci                                         GLint skip_images)
16485bd8deadSopenharmony_ci    {
16495bd8deadSopenharmony_ci        const GLint line_length = pixelStoreMode->lineLength;
16505bd8deadSopenharmony_ci        const GLint image_height = pixelStoreMode->imageHeight;
16515bd8deadSopenharmony_ci        const GLint alignment = pixelStoreMode->alignment;
16525bd8deadSopenharmony_ci        const GLint skip_pixels = pixelStoreMode->skipPixels;
16535bd8deadSopenharmony_ci        const GLint skip_lines = pixelStoreMode->skipLines;
16545bd8deadSopenharmony_ci
16555bd8deadSopenharmony_ci        GLsizeiptr offsetLimit = (GLsizeiptr) userdata;
16565bd8deadSopenharmony_ci
16575bd8deadSopenharmony_ci        GLint rowsize;
16585bd8deadSopenharmony_ci        GLint padding;
16595bd8deadSopenharmony_ci        GLint imagesize;
16605bd8deadSopenharmony_ci
16615bd8deadSopenharmony_ci        assert(width > 0);
16625bd8deadSopenharmony_ci        assert(height > 0);
16635bd8deadSopenharmony_ci        assert(depth > 0);
16645bd8deadSopenharmony_ci
16655bd8deadSopenharmony_ci        assert(line_length >= 0);
16665bd8deadSopenharmony_ci        assert(image_height >= 0);
16675bd8deadSopenharmony_ci
16685bd8deadSopenharmony_ci        assert(skip_pixels >= 0);
16695bd8deadSopenharmony_ci        assert(skip_lines >= 0);
16705bd8deadSopenharmony_ci        assert(skip_images >= 0);
16715bd8deadSopenharmony_ci
16725bd8deadSopenharmony_ci        assert((alignment == 1) ||
16735bd8deadSopenharmony_ci               (alignment == 2) ||
16745bd8deadSopenharmony_ci               (alignment == 4) ||
16755bd8deadSopenharmony_ci               (alignment == 8));
16765bd8deadSopenharmony_ci
16775bd8deadSopenharmony_ci        /* All formats except GL_BITMAP fall out trivially */
16785bd8deadSopenharmony_ci        if (type == GL_BITMAP) {
16795bd8deadSopenharmony_ci            const GLint groups_per_line = (line_length > 0) ?
16805bd8deadSopenharmony_ci                                          line_length : width;
16815bd8deadSopenharmony_ci            const GLint rows_per_image = (image_height > 0) ?
16825bd8deadSopenharmony_ci                                         image_height : height;
16835bd8deadSopenharmony_ci
16845bd8deadSopenharmony_ci            assert(1 == __glElementsPerGroup(format, type));
16855bd8deadSopenharmony_ci
16865bd8deadSopenharmony_ci            rowsize = (groups_per_line + 7) / 8;
16875bd8deadSopenharmony_ci            padding = rowsize & (alignment-1);
16885bd8deadSopenharmony_ci            if (padding) {
16895bd8deadSopenharmony_ci                rowsize += alignment - padding;
16905bd8deadSopenharmony_ci            }
16915bd8deadSopenharmony_ci            imagesize = rows_per_image * rowsize;
16925bd8deadSopenharmony_ci
16935bd8deadSopenharmony_ci            offsetLimit += imagesize    * (skip_images + depth-1);
16945bd8deadSopenharmony_ci            offsetLimit += rowsize      * (skip_lines  + height-1);
16955bd8deadSopenharmony_ci            offsetLimit += (skip_pixels + width+7)/8;
16965bd8deadSopenharmony_ci        } else {
16975bd8deadSopenharmony_ci            const GLint components = __glElementsPerGroup(format, type);
16985bd8deadSopenharmony_ci            const GLint element_size = __glBytesPerElement(type);
16995bd8deadSopenharmony_ci            const GLint group_size = element_size * components;
17005bd8deadSopenharmony_ci
17015bd8deadSopenharmony_ci            if (0 == (line_length | image_height | skip_pixels |
17025bd8deadSopenharmony_ci                      skip_lines | skip_pixels)) {
17035bd8deadSopenharmony_ci                // Fast path: when above pixel store modes are all zero.
17045bd8deadSopenharmony_ci                rowsize = width * group_size;
17055bd8deadSopenharmony_ci                // Default alignment is 4 so allow arbitrary alignment
17065bd8deadSopenharmony_ci                // on fast path.
17075bd8deadSopenharmony_ci                padding = rowsize & (alignment-1);
17085bd8deadSopenharmony_ci                if (padding) {
17095bd8deadSopenharmony_ci                    rowsize += alignment - padding;
17105bd8deadSopenharmony_ci                }
17115bd8deadSopenharmony_ci                imagesize = depth * height * rowsize;
17125bd8deadSopenharmony_ci                offsetLimit += imagesize;
17135bd8deadSopenharmony_ci            } else {
17145bd8deadSopenharmony_ci                // General path: when one or more non-zero pixel store modes.
17155bd8deadSopenharmony_ci                const GLint groups_per_line = (line_length > 0) ?
17165bd8deadSopenharmony_ci                                              line_length : width;
17175bd8deadSopenharmony_ci                const GLint rows_per_image = (image_height > 0) ?
17185bd8deadSopenharmony_ci                                             image_height : height;
17195bd8deadSopenharmony_ci
17205bd8deadSopenharmony_ci                rowsize = groups_per_line * group_size;
17215bd8deadSopenharmony_ci                padding = rowsize & (alignment-1);
17225bd8deadSopenharmony_ci                if (padding) {
17235bd8deadSopenharmony_ci                    rowsize += alignment - padding;
17245bd8deadSopenharmony_ci                }
17255bd8deadSopenharmony_ci                imagesize = rows_per_image * rowsize;
17265bd8deadSopenharmony_ci
17275bd8deadSopenharmony_ci                offsetLimit += imagesize    * (skip_images  + depth-1);
17285bd8deadSopenharmony_ci                offsetLimit += rowsize      * (skip_lines   + height-1);
17295bd8deadSopenharmony_ci                offsetLimit += group_size   * (skip_pixels  + width);
17305bd8deadSopenharmony_ci            }
17315bd8deadSopenharmony_ci        }
17325bd8deadSopenharmony_ci        return offsetLimit;
17335bd8deadSopenharmony_ci    }
17345bd8deadSopenharmony_ci
17355bd8deadSopenharmony_ci    GLsizeiptr __glOffsetLimitImage3D(__GLpixelStoreMode *pixelStoreMode,
17365bd8deadSopenharmony_ci                                      GLsizei width, GLsizei height,
17375bd8deadSopenharmony_ci                                      GLsizei depth,
17385bd8deadSopenharmony_ci                                      GLenum format, GLenum type,
17395bd8deadSopenharmony_ci                                      const void *userdata)
17405bd8deadSopenharmony_ci    {
17415bd8deadSopenharmony_ci        return OffsetLimitImage3D(pixelStoreMode,
17425bd8deadSopenharmony_ci                                  width, height, depth, format, type,
17435bd8deadSopenharmony_ci                                  userdata,
17445bd8deadSopenharmony_ci                                  pixelStoreMode->skipImages);
17455bd8deadSopenharmony_ci    }
17465bd8deadSopenharmony_ci
17475bd8deadSopenharmony_ci    GLsizeiptr __glOffsetLimitImage(__GLpixelStoreMode *pixelStoreMode,
17485bd8deadSopenharmony_ci                                    GLsizei width, GLsizei height,
17495bd8deadSopenharmony_ci                                    GLenum format, GLenum type,
17505bd8deadSopenharmony_ci                                    const void *userdata)
17515bd8deadSopenharmony_ci    {
17525bd8deadSopenharmony_ci        /* NOTE: Non-3D image max offset computations ignore (treat as zero)
17535bd8deadSopenharmony_ci           the unpackModes.skipImages state! */
17545bd8deadSopenharmony_ci        return OffsetLimitImage3D(pixelStoreMode,
17555bd8deadSopenharmony_ci                                  width, height, 1, format, type,
17565bd8deadSopenharmony_ci                                  userdata,
17575bd8deadSopenharmony_ci                                  0);  // Treat skipImages as zero.
17585bd8deadSopenharmony_ci    }
17595bd8deadSopenharmony_ci
17605bd8deadSopenharmony_ci
17615bd8deadSopenharmony_ciRevision History
17625bd8deadSopenharmony_ci
17635bd8deadSopenharmony_ci    revision 0.3: mjk
17645bd8deadSopenharmony_ci
17655bd8deadSopenharmony_ci        Numbered issues.
17665bd8deadSopenharmony_ci
17675bd8deadSopenharmony_ci        Add issues 14 through 18.
17685bd8deadSopenharmony_ci
17695bd8deadSopenharmony_ci        Remove all gl/GL prefix/suffixing in specification sections.  Use
17705bd8deadSopenharmony_ci        gl/GL prefix/suffixing in sections other than the specification
17715bd8deadSopenharmony_ci        sections. Leaving off prefixes in non-specification sections is
17725bd8deadSopenharmony_ci        ambiguous, particularly within example source code.
17735bd8deadSopenharmony_ci
17745bd8deadSopenharmony_ci        Base specification language updates on OpenGL 2.0 specification.
17755bd8deadSopenharmony_ci
17765bd8deadSopenharmony_ci        Add buffer object required state section.
17775bd8deadSopenharmony_ci
17785bd8deadSopenharmony_ci        Added GL_INVALID_OPERATION when an offset accessed (read or
17795bd8deadSopenharmony_ci        written) for a pixel command from/to a pixel buffer object would
17805bd8deadSopenharmony_ci        exceed the size of the buffer object.
17815bd8deadSopenharmony_ci
17825bd8deadSopenharmony_ci        Added GL_INVALID_OPERATION when for misaligned offsets.
17835bd8deadSopenharmony_ci
17845bd8deadSopenharmony_ci        Added "Appendix on Pack/Unpack Range".
17855bd8deadSopenharmony_ci
17865bd8deadSopenharmony_ci        Add GLX protocol discussion.
17875bd8deadSopenharmony_ci
17885bd8deadSopenharmony_ci    revision 0.4: mjk
17895bd8deadSopenharmony_ci
17905bd8deadSopenharmony_ci        Fixed grammar issues from Brian Paul.
17915bd8deadSopenharmony_ci
17925bd8deadSopenharmony_ci        Improved example code and fixed grammar from Nick Carter.
17935bd8deadSopenharmony_ci
17945bd8deadSopenharmony_ci        Explain how a NULL data parameter to glTexImage commands works.
17955bd8deadSopenharmony_ci
17965bd8deadSopenharmony_ci    revision 0.5: mjk
17975bd8deadSopenharmony_ci
17985bd8deadSopenharmony_ci        Clarify that glBufferData usage modes apply to drawing _and_
17995bd8deadSopenharmony_ci        image specification commands.
18005bd8deadSopenharmony_ci
18015bd8deadSopenharmony_ci    revision 0.6: mjk
18025bd8deadSopenharmony_ci
18035bd8deadSopenharmony_ci        Add "streaming draw pixels" to the list of interesting approaches
18045bd8deadSopenharmony_ci        for this extension in the Overview.
18055bd8deadSopenharmony_ci
18065bd8deadSopenharmony_ci        Add issue discussing the relationship of this extension to data
18075bd8deadSopenharmony_ci        aquisition hardware.
18085bd8deadSopenharmony_ci
18095bd8deadSopenharmony_ci    revision 0.7: mjk
18105bd8deadSopenharmony_ci
18115bd8deadSopenharmony_ci        Assign enumerant values to match the EXT_pixel_buffer_object values.
18125bd8deadSopenharmony_ci
18135bd8deadSopenharmony_ci        Add issue explaining why the ARB extension shares enums with
18145bd8deadSopenharmony_ci        EXT_pixel_buffer_object.
18155bd8deadSopenharmony_ci
18165bd8deadSopenharmony_ci        Apply Dale's suggestion to improve the clarity of the usage
18175bd8deadSopenharmony_ci        pattern parameters to glBufferData.
18185bd8deadSopenharmony_ci
18195bd8deadSopenharmony_ci    revision 0.8 mjk
18205bd8deadSopenharmony_ci
18215bd8deadSopenharmony_ci        Typo fixes from Ian Romanick and Nick Carter.
18225bd8deadSopenharmony_ci
18235bd8deadSopenharmony_ci    revision 1.0 mjk
18245bd8deadSopenharmony_ci
18255bd8deadSopenharmony_ci        Add issue 23 for Jeremy about render-to-vertex-array.  Move
18265bd8deadSopenharmony_ci        render-to-vertex-array justification in overview to bottom of
18275bd8deadSopenharmony_ci        the list.
18285bd8deadSopenharmony_ci
18295bd8deadSopenharmony_ci   revision 1.1 srahman
18305bd8deadSopenharmony_ci
18315bd8deadSopenharmony_ci       Add GLX protocol support. 
18325bd8deadSopenharmony_ci
18335bd8deadSopenharmony_ci   revision 1.2 Jon Leech
18345bd8deadSopenharmony_ci
18355bd8deadSopenharmony_ci       Change GLvoid -> void (Bug 10412).
1836