forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glCopyBufferSubData.xhtml
60 lines (60 loc) · 8.13 KB
/
glCopyBufferSubData.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<div class="refentry"><a id="glCopyBufferSubData"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glCopyBufferSubData — copy part of the data store of a buffer object to the data store of another buffer object</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glCopyBufferSubData</strong>(</code></td><td>GLenum <var class="pdparam">readtarget</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">writetarget</var>, </td></tr><tr><td> </td><td>GLintptr <var class="pdparam">readoffset</var>, </td></tr><tr><td> </td><td>GLintptr <var class="pdparam">writeoffset</var>, </td></tr><tr><td> </td><td>GLsizeiptr <var class="pdparam">size</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>readtarget</code></em></span></dt><dd><p>
Specifies the target from whose data store data should be read.
</p></dd><dt><span class="term"><em class="parameter"><code>writetarget</code></em></span></dt><dd><p>
Specifies the target to whose data store data should be written.
</p></dd><dt><span class="term"><em class="parameter"><code>readoffset</code></em></span></dt><dd><p>
Specifies the offset, in basic machine units, within the data store of <em class="parameter"><code>readtarget</code></em> from which data should be read.
</p></dd><dt><span class="term"><em class="parameter"><code>writeoffset</code></em></span></dt><dd><p>
Specifies the offset, in basic machine units, within the data store of <em class="parameter"><code>writetarget</code></em> to which data should be written.
</p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
Specifies the size, in basic machine units, of the data to be copied from <em class="parameter"><code>readtarget</code></em> to <em class="parameter"><code>writetarget</code></em>.
</p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
<code class="function">glCopyBufferSubData</code> copies part of the data store attached to <em class="parameter"><code>readtarget</code></em> to the
data store attached to <em class="parameter"><code>writetarget</code></em>. The number of basic machine units indicated by <em class="parameter"><code>size</code></em>
is copied from the source, at offset <em class="parameter"><code>readoffset</code></em> to the destination at <em class="parameter"><code>writeoffset</code></em>,
also in basic machine units.
</p><p>
<em class="parameter"><code>readtarget</code></em> and <em class="parameter"><code>writetarget</code></em> must be <code class="constant">GL_ARRAY_BUFFER</code>,
<code class="constant">GL_COPY_READ_BUFFER</code>, <code class="constant">GL_COPY_WRITE_BUFFER</code>, <code class="constant">GL_ELEMENT_ARRAY_BUFFER</code>,
<code class="constant">GL_PIXEL_PACK_BUFFER</code>, <code class="constant">GL_PIXEL_UNPACK_BUFFER</code>, <code class="constant">GL_TEXTURE_BUFFER</code>,
<code class="constant">GL_TRANSFORM_FEEDBACK_BUFFER</code> or <code class="constant">GL_UNIFORM_BUFFER</code>. Any of these targets may be used,
although the targets <code class="constant">GL_COPY_READ_BUFFER</code> and <code class="constant">GL_COPY_WRITE_BUFFER</code> are provided
specifically to allow copies between buffers without disturbing other GL state.
</p><p>
<em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em> and <em class="parameter"><code>size</code></em> must all be greater than or equal to
zero. Furthermore, <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> must not exceeed the size of the buffer
object bound to <em class="parameter"><code>readtarget</code></em>, and <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> must not exceeed the
size of the buffer bound to <em class="parameter"><code>writetarget</code></em>. If the same buffer object is bound to both <em class="parameter"><code>readtarget</code></em>
and <em class="parameter"><code>writetarget</code></em>, then the ranges specified by <em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em>
and <em class="parameter"><code>size</code></em> must not overlap.
</p></div><div class="refsect1"><a id="notes"></a><h2>Notes</h2><p>
<code class="function">glCopyBufferSubData</code> is available only if the GL version is 3.1 or greater.
</p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p>
<code class="constant">GL_INVALID_VALUE</code> is generated if any of <em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em>
or <em class="parameter"><code>size</code></em> is negative, if <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> exceeds the
size of the buffer object bound to <em class="parameter"><code>readtarget</code></em> or if <em class="parameter"><code>writeoffset</code></em> + <em class="parameter"><code>size</code></em>
exceeds the size of the buffer object bound to <em class="parameter"><code>writetarget</code></em>.
</p><p>
<code class="constant">GL_INVALID_VALUE</code> is generated if the same buffer object is bound to both <em class="parameter"><code>readtarget</code></em>
and <em class="parameter"><code>writetarget</code></em> and the ranges [<em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>readoffset</code></em> +
<em class="parameter"><code>size</code></em>) and [<em class="parameter"><code>writeoffset</code></em>, <em class="parameter"><code>writeoffset</code></em> + <em class="parameter"><code>size</code></em>)
overlap.
</p><p>
<code class="constant">GL_INVALID_OPERATION</code> is generated if zero is bound to <em class="parameter"><code>readtarget</code></em> or <em class="parameter"><code>writetarget</code></em>.
</p><p>
<code class="constant">GL_INVALID_OPERATION</code> is generated if the buffer object bound to either <em class="parameter"><code>readtarget</code></em> or <em class="parameter"><code>writetarget</code></em>
is mapped.
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glGenBuffers"><span class="citerefentry"><span class="refentrytitle">glGenBuffers</span></span></a>,
<a class="citerefentry" href="glBindBuffer"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>,
<a class="citerefentry" href="glBufferData"><span class="citerefentry"><span class="refentrytitle">glBufferData</span></span></a>,
<a class="citerefentry" href="glBufferSubData"><span class="citerefentry"><span class="refentrytitle">glBufferSubData</span></span></a>,
<a class="citerefentry" href="glGetBufferSubData"><span class="citerefentry"><span class="refentrytitle">glGetBufferSubData</span></span></a>
</p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
Copyright © 2010 Khronos Group.
This material may be distributed subject to the terms and conditions set forth in
the Open Publication License, v 1.0, 8 June 1999.
<a class="ulink" href="https://opencontent.org/openpub/" target="_top">https://opencontent.org/openpub/</a>.
</p></div></div></div>