15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    GLX_NV_copy_buffer
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GLX_NV_copy_buffer
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Alex Goins, NVIDIA Corporation (agoins 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Alex Goins
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciStatus
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Complete
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciVersion
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Last Modified Date:         July 15, 2014
245bd8deadSopenharmony_ci    Revision:                   5
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNumber
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    OpenGL Extension #457
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciDependencies
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    GL_ARB_copy_buffer is required.
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    This extension interacts with EXT_direct_state_access.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciOverview
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    Extend GL_ARB_copy_buffer to have GLX bindings. 
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciNew Procedures and Functions
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    void glXCopyBufferSubDataNV(Display *dpy,
435bd8deadSopenharmony_ci        GLXContext readCtx, GLXContext writeCtx,
445bd8deadSopenharmony_ci        GLenum readTarget, GLenum writeTarget,
455bd8deadSopenharmony_ci        GLintptr readOffset, GLintptr writeOffset,
465bd8deadSopenharmony_ci        GLsizeiptr size);
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    void glXNamedCopyBufferSubDataNV(Display *dpy,
495bd8deadSopenharmony_ci        GLXContext readCtx, GLXContext writeCtx,
505bd8deadSopenharmony_ci        GLuint readBuffer, GLuint writeBuffer,
515bd8deadSopenharmony_ci        GLintptr readOffset, GLintptr writeOffset,
525bd8deadSopenharmony_ci        GLsizeiptr size);
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciNew Tokens
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    None
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciAdditions to the GLX Specification
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    The functions
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci        void glXCopyBufferSubDataNV(Display *dpy,
635bd8deadSopenharmony_ci            GLXContext readCtx, GLXContext writeCtx,
645bd8deadSopenharmony_ci            GLenum readTarget, GLenum writeTarget,
655bd8deadSopenharmony_ci            GLintptr readOffset, GLintptr writeOffset,
665bd8deadSopenharmony_ci            GLsizeiptr size);
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci        void glXNamedCopyBufferSubDataNV(Display *dpy,
695bd8deadSopenharmony_ci            GLXContext readCtx, GLXContext writeCtx,
705bd8deadSopenharmony_ci            GLuint readBuffer, GLuint writeBuffer,
715bd8deadSopenharmony_ci            GLintptr readOffset, GLintptr writeOffset,
725bd8deadSopenharmony_ci            GLsizeiptr size);
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    behave identically to the core functions glCopyBufferSubData and
755bd8deadSopenharmony_ci    glNamedCopyBufferSubDataEXT, except that the <readCtx> and
765bd8deadSopenharmony_ci    <writeCtx> parameters specify the contexts in which to look up the
775bd8deadSopenharmony_ci    source and destination objects, respectively.  A value of NULL for
785bd8deadSopenharmony_ci    either context indicates that the value which is returned by
795bd8deadSopenharmony_ci    glXGetCurrentContext() should be used instead. Both contexts must
805bd8deadSopenharmony_ci    share the same address space, as described in section 2.3.
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    The operations performed by these functions occur in the current context's
835bd8deadSopenharmony_ci    command stream.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    If neither <readCtx> nor <writeCtx> is current, the error GLXBadContext is
865bd8deadSopenharmony_ci    generated.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    If <readCtx> and <writeCtx> mix direct and indirect contexts, the error
895bd8deadSopenharmony_ci    GLXBadContext is generated.
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    If either <readCtx> or <writeCtx> is not a valid rendering context,
925bd8deadSopenharmony_ci    the error GLXBadContext is generated.
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    If the server portion of the contexts do not share the same address
955bd8deadSopenharmony_ci    space, the error BadMatch is generated.
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    If an error occurs due to GL parameter validation, the error BadMatch will
985bd8deadSopenharmony_ci    be generated.  Additionally, if either the source or destination context is
995bd8deadSopenharmony_ci    bound to the current thread, a GL error is set to indicate the cause. This
1005bd8deadSopenharmony_ci    error code may be retrieved by calling glGetError().
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ciGLX Protocol
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    Two new GLX protocol commands are added.
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    glXCopyBufferSubDataNV
1075bd8deadSopenharmony_ci        1       CARD8           opcode (X assigned)
1085bd8deadSopenharmony_ci        1       16              GLX opcode (glXVendorPrivate)
1095bd8deadSopenharmony_ci        2       20              request length
1105bd8deadSopenharmony_ci        4       1387            vendor specific opcode
1115bd8deadSopenharmony_ci        4       GLX_CONTEXT_TAG context tag
1125bd8deadSopenharmony_ci        8       INT64           read_offset
1135bd8deadSopenharmony_ci        8       INT64           write_offset
1145bd8deadSopenharmony_ci        8       INT64           size
1155bd8deadSopenharmony_ci        4       GLX_CONTEXT     read_context
1165bd8deadSopenharmony_ci        4       GLX_CONTEXT     write_context
1175bd8deadSopenharmony_ci        4       CARD32          read_target
1185bd8deadSopenharmony_ci        4       CARD32          write_target
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    glXNamedCopyBufferSubDataNV
1215bd8deadSopenharmony_ci        1       CARD8           opcode (X assigned)
1225bd8deadSopenharmony_ci        1       16              GLX opcode (glXVendorPrivate)
1235bd8deadSopenharmony_ci        2       20              request length
1245bd8deadSopenharmony_ci        4       1388            vendor specific opcode
1255bd8deadSopenharmony_ci        4       GLX_CONTEXT_TAG context tag
1265bd8deadSopenharmony_ci        8       INT64           read_offset
1275bd8deadSopenharmony_ci        8       INT64           write_offset
1285bd8deadSopenharmony_ci        8       INT64           size
1295bd8deadSopenharmony_ci        4       GLX_CONTEXT     read_context
1305bd8deadSopenharmony_ci        4       GLX_CONTEXT     write_context
1315bd8deadSopenharmony_ci        4       CARD32          read_buffer
1325bd8deadSopenharmony_ci        4       CARD32          write_buffer
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ciDependencies on EXT_direct_state_access:
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    If EXT_direct_state_access is not supported remove any references to
1375bd8deadSopenharmony_ci    NamedCopyBufferSubData.
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ciErrors
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if readOffset, writeOffset, or size are
1425bd8deadSopenharmony_ci    less than zero, or if readOffset+size is greater than the value of
1435bd8deadSopenharmony_ci    BUFFER_SIZE of readTarget/readBuffer, or if writeOffset+size is greater than
1445bd8deadSopenharmony_ci    the value of BUFFER_SIZE of writeTarget/writeBuffer.
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if either readtarget/readBuffer or
1475bd8deadSopenharmony_ci    writeTarget/writeBuffer are mapped.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if readTarget/readBuffer and
1505bd8deadSopenharmony_ci    writeTarget/writeBuffer are the same buffer object, and the ranges
1515bd8deadSopenharmony_ci    [readOffset, readOffset+size) and [writeOffset, writeOffset+size) overlap. 
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ciUsage Examples
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    (1) Copying across contexts using glXCopyBufferSubDataNV()
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci        glXMakeCurrent(dpy, readWindow, readContext);
1585bd8deadSopenharmony_ci        BindBuffer(COPY_READ_BUFFER, readBuffer);
1595bd8deadSopenharmony_ci        BufferData(COPY_READ_BUFFER, updateSize, updateData, DYNAMIC_COPY);
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci        glXMakeCurrent(dpy, writeWindow, writeContext);
1625bd8deadSopenharmony_ci        BindBuffer(COPY_WRITE_BUFFER, writeBuffer);
1635bd8deadSopenharmony_ci        glXCopyBufferSubDataNV(dpy, readContext, writeContext,
1645bd8deadSopenharmony_ci                               COPY_READ_BUFFER, COPY_WRITE_BUFFER,
1655bd8deadSopenharmony_ci                               0, writeOffset, updateSize);
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    (2) Copying across contexts using glXNamedCopyBufferSubDataNV()
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci        glXMakeCurrent(dpy, readWindow, readContext);
1715bd8deadSopenharmony_ci        BindBuffer(ARRAY_BUFFER, readBuffer);
1725bd8deadSopenharmony_ci        BufferData(ARRAY_BUFFER, updateSize, updateData, DYNAMIC_COPY);
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci        glXNamedCopyBufferSubDataNV(dpy, readContext, writeContext,
1755bd8deadSopenharmony_ci                                    readBuffer, writeBuffer,
1765bd8deadSopenharmony_ci                                    0, writeOffset, updateSize);
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ciIssues
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    TBD
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ciRevision History
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    Rev.    Date       Author    Changes
1855bd8deadSopenharmony_ci    ----  --------     --------  -----------------------------------------
1865bd8deadSopenharmony_ci     1    07/01/2014   agoins    Initial revision based on WGL_NV_copy_buffer.
1875bd8deadSopenharmony_ci     2    07/02/2014   agoins    Add synchronization information. Add explicit
1885bd8deadSopenharmony_ci                                 GL type prefixes. Update vendor opcodes.
1895bd8deadSopenharmony_ci     3    07/14/2014   agoins    Update GLX protocol structures, more specific
1905bd8deadSopenharmony_ci                                 GLX specification information
1915bd8deadSopenharmony_ci     4    07/15/2014   agoins    More accurate error conditions
1925bd8deadSopenharmony_ci     5    07/21/2014   agoins    Add tag field and change status to complete
193