• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    GLX_NV_copy_buffer
4
5Name Strings
6
7    GLX_NV_copy_buffer
8
9Contact
10
11    Alex Goins, NVIDIA Corporation (agoins 'at' nvidia.com)
12
13Contributors
14
15    Alex Goins
16
17Status
18
19    Complete
20
21Version
22
23    Last Modified Date:         July 15, 2014
24    Revision:                   5
25
26Number
27
28    OpenGL Extension #457
29
30Dependencies
31
32    GL_ARB_copy_buffer is required.
33
34    This extension interacts with EXT_direct_state_access.
35
36Overview
37
38    Extend GL_ARB_copy_buffer to have GLX bindings.
39
40New Procedures and Functions
41
42    void glXCopyBufferSubDataNV(Display *dpy,
43        GLXContext readCtx, GLXContext writeCtx,
44        GLenum readTarget, GLenum writeTarget,
45        GLintptr readOffset, GLintptr writeOffset,
46        GLsizeiptr size);
47
48    void glXNamedCopyBufferSubDataNV(Display *dpy,
49        GLXContext readCtx, GLXContext writeCtx,
50        GLuint readBuffer, GLuint writeBuffer,
51        GLintptr readOffset, GLintptr writeOffset,
52        GLsizeiptr size);
53
54New Tokens
55
56    None
57
58Additions to the GLX Specification
59
60    The functions
61
62        void glXCopyBufferSubDataNV(Display *dpy,
63            GLXContext readCtx, GLXContext writeCtx,
64            GLenum readTarget, GLenum writeTarget,
65            GLintptr readOffset, GLintptr writeOffset,
66            GLsizeiptr size);
67
68        void glXNamedCopyBufferSubDataNV(Display *dpy,
69            GLXContext readCtx, GLXContext writeCtx,
70            GLuint readBuffer, GLuint writeBuffer,
71            GLintptr readOffset, GLintptr writeOffset,
72            GLsizeiptr size);
73
74    behave identically to the core functions glCopyBufferSubData and
75    glNamedCopyBufferSubDataEXT, except that the <readCtx> and
76    <writeCtx> parameters specify the contexts in which to look up the
77    source and destination objects, respectively.  A value of NULL for
78    either context indicates that the value which is returned by
79    glXGetCurrentContext() should be used instead. Both contexts must
80    share the same address space, as described in section 2.3.
81
82    The operations performed by these functions occur in the current context's
83    command stream.
84
85    If neither <readCtx> nor <writeCtx> is current, the error GLXBadContext is
86    generated.
87
88    If <readCtx> and <writeCtx> mix direct and indirect contexts, the error
89    GLXBadContext is generated.
90
91    If either <readCtx> or <writeCtx> is not a valid rendering context,
92    the error GLXBadContext is generated.
93
94    If the server portion of the contexts do not share the same address
95    space, the error BadMatch is generated.
96
97    If an error occurs due to GL parameter validation, the error BadMatch will
98    be generated.  Additionally, if either the source or destination context is
99    bound to the current thread, a GL error is set to indicate the cause. This
100    error code may be retrieved by calling glGetError().
101
102GLX Protocol
103
104    Two new GLX protocol commands are added.
105
106    glXCopyBufferSubDataNV
107        1       CARD8           opcode (X assigned)
108        1       16              GLX opcode (glXVendorPrivate)
109        2       20              request length
110        4       1387            vendor specific opcode
111        4       GLX_CONTEXT_TAG context tag
112        8       INT64           read_offset
113        8       INT64           write_offset
114        8       INT64           size
115        4       GLX_CONTEXT     read_context
116        4       GLX_CONTEXT     write_context
117        4       CARD32          read_target
118        4       CARD32          write_target
119
120    glXNamedCopyBufferSubDataNV
121        1       CARD8           opcode (X assigned)
122        1       16              GLX opcode (glXVendorPrivate)
123        2       20              request length
124        4       1388            vendor specific opcode
125        4       GLX_CONTEXT_TAG context tag
126        8       INT64           read_offset
127        8       INT64           write_offset
128        8       INT64           size
129        4       GLX_CONTEXT     read_context
130        4       GLX_CONTEXT     write_context
131        4       CARD32          read_buffer
132        4       CARD32          write_buffer
133
134Dependencies on EXT_direct_state_access:
135
136    If EXT_direct_state_access is not supported remove any references to
137    NamedCopyBufferSubData.
138
139Errors
140
141    The error INVALID_VALUE is generated if readOffset, writeOffset, or size are
142    less than zero, or if readOffset+size is greater than the value of
143    BUFFER_SIZE of readTarget/readBuffer, or if writeOffset+size is greater than
144    the value of BUFFER_SIZE of writeTarget/writeBuffer.
145
146    The error INVALID_OPERATION is generated if either readtarget/readBuffer or
147    writeTarget/writeBuffer are mapped.
148
149    The error INVALID_VALUE is generated if readTarget/readBuffer and
150    writeTarget/writeBuffer are the same buffer object, and the ranges
151    [readOffset, readOffset+size) and [writeOffset, writeOffset+size) overlap.
152
153Usage Examples
154
155    (1) Copying across contexts using glXCopyBufferSubDataNV()
156
157        glXMakeCurrent(dpy, readWindow, readContext);
158        BindBuffer(COPY_READ_BUFFER, readBuffer);
159        BufferData(COPY_READ_BUFFER, updateSize, updateData, DYNAMIC_COPY);
160
161        glXMakeCurrent(dpy, writeWindow, writeContext);
162        BindBuffer(COPY_WRITE_BUFFER, writeBuffer);
163        glXCopyBufferSubDataNV(dpy, readContext, writeContext,
164                               COPY_READ_BUFFER, COPY_WRITE_BUFFER,
165                               0, writeOffset, updateSize);
166
167
168    (2) Copying across contexts using glXNamedCopyBufferSubDataNV()
169
170        glXMakeCurrent(dpy, readWindow, readContext);
171        BindBuffer(ARRAY_BUFFER, readBuffer);
172        BufferData(ARRAY_BUFFER, updateSize, updateData, DYNAMIC_COPY);
173
174        glXNamedCopyBufferSubDataNV(dpy, readContext, writeContext,
175                                    readBuffer, writeBuffer,
176                                    0, writeOffset, updateSize);
177
178Issues
179
180    TBD
181
182Revision History
183
184    Rev.    Date       Author    Changes
185    ----  --------     --------  -----------------------------------------
186     1    07/01/2014   agoins    Initial revision based on WGL_NV_copy_buffer.
187     2    07/02/2014   agoins    Add synchronization information. Add explicit
188                                 GL type prefixes. Update vendor opcodes.
189     3    07/14/2014   agoins    Update GLX protocol structures, more specific
190                                 GLX specification information
191     4    07/15/2014   agoins    More accurate error conditions
192     5    07/21/2014   agoins    Add tag field and change status to complete
193