Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?>\r |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r | |
4 | <refentry id="glCopyImageSubData">\r | |
5 | <refmeta>\r | |
6 | <refmetainfo>\r | |
7 | <copyright>\r | |
8 | <year>2012</year>\r | |
9 | <holder>Khronos Group</holder>\r | |
10 | </copyright>\r | |
11 | </refmetainfo>\r | |
12 | <refentrytitle>glCopyImageSubData</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>glCopyImageSubData</refname>\r | |
17 | <refpurpose>perform a raw data copy between two images</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>C Specification</title>\r | |
20 | <funcsynopsis>\r | |
21 | <funcprototype>\r | |
22 | <funcdef>void <function>glCopyImageSubData</function></funcdef>\r | |
23 | <paramdef>GLuint <parameter>srcName</parameter></paramdef>\r | |
24 | <paramdef>GLenum <parameter>srcTarget</parameter></paramdef>\r | |
25 | <paramdef>GLint <parameter>srcLevel</parameter></paramdef>\r | |
26 | <paramdef>GLint <parameter>srcX</parameter></paramdef>\r | |
27 | <paramdef>GLint <parameter>srcY</parameter></paramdef>\r | |
28 | <paramdef>GLint <parameter>srcZ</parameter></paramdef>\r | |
29 | <paramdef>GLuint <parameter>dstName</parameter></paramdef>\r | |
30 | <paramdef>GLenum <parameter>dstTarget</parameter></paramdef>\r | |
31 | <paramdef>GLint <parameter>dstLevel</parameter></paramdef>\r | |
32 | <paramdef>GLint <parameter>dstX</parameter></paramdef>\r | |
33 | <paramdef>GLint <parameter>dstY</parameter></paramdef>\r | |
34 | <paramdef>GLint <parameter>dstZ</parameter></paramdef>\r | |
35 | <paramdef>GLsizei <parameter>srcWidth</parameter></paramdef>\r | |
36 | <paramdef>GLsizei <parameter>srcHeight</parameter></paramdef>\r | |
37 | <paramdef>GLsizei <parameter>srcDepth</parameter></paramdef>\r | |
38 | </funcprototype>\r | |
39 | </funcsynopsis>\r | |
40 | </refsynopsisdiv>\r | |
41 | <refsect1 id="parameters"><title>Parameters</title>\r | |
42 | <variablelist>\r | |
43 | <varlistentry>\r | |
44 | <term><parameter>srcName</parameter></term>\r | |
45 | <listitem>\r | |
46 | <para>\r | |
47 | The name of a texture or renderbuffer object from which to copy.\r | |
48 | </para>\r | |
49 | </listitem>\r | |
50 | </varlistentry>\r | |
51 | <varlistentry>\r | |
52 | <term><parameter>srcTarget</parameter></term>\r | |
53 | <listitem>\r | |
54 | <para>\r | |
55 | The target representing the namespace of the source name <parameter>srcName</parameter>.\r | |
56 | </para>\r | |
57 | </listitem>\r | |
58 | </varlistentry>\r | |
59 | <varlistentry>\r | |
60 | <term><parameter>srcLevel</parameter></term>\r | |
61 | <listitem>\r | |
62 | <para>\r | |
63 | The mipmap level to read from the source.\r | |
64 | </para>\r | |
65 | </listitem>\r | |
66 | </varlistentry>\r | |
67 | <varlistentry>\r | |
68 | <term><parameter>srcX</parameter></term>\r | |
69 | <listitem>\r | |
70 | <para>\r | |
71 | The X coordinate of the left edge of the souce region to copy.\r | |
72 | </para>\r | |
73 | </listitem>\r | |
74 | </varlistentry>\r | |
75 | <varlistentry>\r | |
76 | <term><parameter>srcY</parameter></term>\r | |
77 | <listitem>\r | |
78 | <para>\r | |
79 | The Y coordinate of the top edge of the souce region to copy.\r | |
80 | </para>\r | |
81 | </listitem>\r | |
82 | </varlistentry>\r | |
83 | <varlistentry>\r | |
84 | <term><parameter>srcZ</parameter></term>\r | |
85 | <listitem>\r | |
86 | <para>\r | |
87 | The Z coordinate of the near edge of the souce region to copy.\r | |
88 | </para>\r | |
89 | </listitem>\r | |
90 | </varlistentry>\r | |
91 | <varlistentry>\r | |
92 | <term><parameter>dstName</parameter></term>\r | |
93 | <listitem>\r | |
94 | <para>\r | |
95 | The name of a texture or renderbuffer object to which to copy.\r | |
96 | </para>\r | |
97 | </listitem>\r | |
98 | </varlistentry>\r | |
99 | <varlistentry>\r | |
100 | <term><parameter>dstTarget</parameter></term>\r | |
101 | <listitem>\r | |
102 | <para>\r | |
103 | The target representing the namespace of the destination name <parameter>dstName</parameter>.\r | |
104 | </para>\r | |
105 | </listitem>\r | |
106 | </varlistentry>\r | |
107 | <varlistentry>\r | |
108 | <term><parameter>dstX</parameter></term>\r | |
109 | <listitem>\r | |
110 | <para>\r | |
111 | The X coordinate of the left edge of the destination region.\r | |
112 | </para>\r | |
113 | </listitem>\r | |
114 | </varlistentry>\r | |
115 | <varlistentry>\r | |
116 | <term><parameter>dstY</parameter></term>\r | |
117 | <listitem>\r | |
118 | <para>\r | |
119 | The Y coordinate of the top edge of the destination region.\r | |
120 | </para>\r | |
121 | </listitem>\r | |
122 | </varlistentry>\r | |
123 | <varlistentry>\r | |
124 | <term><parameter>dstZ</parameter></term>\r | |
125 | <listitem>\r | |
126 | <para>\r | |
127 | The Z coordinate of the near edge of the destination region.\r | |
128 | </para>\r | |
129 | </listitem>\r | |
130 | </varlistentry>\r | |
131 | <varlistentry>\r | |
132 | <term><parameter>srcWidth</parameter></term>\r | |
133 | <listitem>\r | |
134 | <para>\r | |
135 | The width of the region to be copied.\r | |
136 | </para>\r | |
137 | </listitem>\r | |
138 | </varlistentry>\r | |
139 | <varlistentry>\r | |
140 | <term><parameter>srcHeight</parameter></term>\r | |
141 | <listitem>\r | |
142 | <para>\r | |
143 | The height of the region to be copied.\r | |
144 | </para>\r | |
145 | </listitem>\r | |
146 | </varlistentry>\r | |
147 | <varlistentry>\r | |
148 | <term><parameter>srcDepth</parameter></term>\r | |
149 | <listitem>\r | |
150 | <para>\r | |
151 | The depth of the region to be copied.\r | |
152 | </para>\r | |
153 | </listitem>\r | |
154 | </varlistentry>\r | |
155 | </variablelist>\r | |
156 | </refsect1>\r | |
157 | <refsect1 id="description"><title>Description</title>\r | |
158 | <para>\r | |
159 | <function>glCopyImageSubData</function> may be used to copy data from\r | |
160 | one image (i.e. texture or renderbuffer) to another. <function>glCopyImageSubData</function>\r | |
161 | does not perform general-purpose conversions\r | |
162 | such as scaling, resizing, blending, color-space, or format\r | |
163 | conversions. It should be considered to operate in a manner\r | |
164 | similar to a CPU memcpy. CopyImageSubData can copy between\r | |
165 | images with different internal formats, provided\r | |
166 | the formats are compatible.\r | |
167 | </para>\r | |
168 | <para>\r | |
169 | <function>glCopyImageSubData</function> also allows copying between certain \r | |
170 | types of compressed and uncompressed internal formats. This copy does not perform on-the-fly compression\r | |
171 | or decompression. When copying from an uncompressed internal format\r | |
172 | to a compressed internal format, each texel of uncompressed data\r | |
173 | becomes a single block of compressed data. When copying from a\r | |
174 | compressed internal format to an uncompressed internal format,\r | |
175 | a block of compressed data becomes a single texel of uncompressed\r | |
176 | data. The texel size of the uncompressed format must be the same\r | |
177 | size the block size of the compressed formats. Thus it is permitted\r | |
178 | to copy between a 128-bit uncompressed format and a compressed\r | |
179 | format which uses 8-bit 4x4 blocks, or between a 64-bit uncompressed\r | |
180 | format and a compressed format which uses 4-bit 4x4 blocks.\r | |
181 | </para>\r | |
182 | <para>\r | |
183 | The source object is identified by <parameter>srcName</parameter> and\r | |
184 | <parameter>srcTarget</parameter> and the destination object is identified\r | |
185 | by <parameter>dstName</parameter> and <parameter>dstTarget</parameter>.\r | |
186 | The interpretation of the name depends on the value\r | |
187 | of the corresponding <parameter>target</parameter> parameter.\r | |
188 | If <parameter>target</parameter> is\r | |
189 | <constant>GL_RENDERBUFFER</constant>, the name is interpreted as the name of a\r | |
190 | renderbuffer object. If the target parameter is a texture target,\r | |
191 | the name is interpreted as a texture object. All non-proxy\r | |
192 | texture targets are accepted, with the exception of <constant>GL_TEXTURE_BUFFER</constant>\r | |
193 | and the cubemap face selectors.\r | |
194 | </para>\r | |
195 | <para>\r | |
196 | <parameter>srcLevel</parameter> and <parameter>dstLevel</parameter> identify the source and destination\r | |
197 | level of detail. For textures, this must be a valid level of\r | |
198 | detail in the texture object. For renderbuffers, this value must\r | |
199 | be zero.\r | |
200 | </para>\r | |
201 | <para>\r | |
202 | <parameter>srcX</parameter>, <parameter>srcY</parameter>, and <parameter>srcZ</parameter> specify the lower left texel\r | |
203 | coordinates of a <parameter>srcWidth</parameter>-wide by <parameter>srcHeight</parameter>-high by \r | |
204 | <parameter>srcDepth</parameter>-deep rectangular subregion of the source texel array. \r | |
205 | Similarly, <parameter>dstX</parameter>, <parameter>dstY</parameter> and <parameter>dstZ</parameter> specify the coordinates of a subregion of the\r | |
206 | destination texel array. The source and destination subregions\r | |
207 | must be contained entirely within the specified level of the\r | |
208 | corresponding image objects.\r | |
209 | </para>\r | |
210 | <para>\r | |
211 | The dimensions are always specified in texels, even for compressed\r | |
212 | texture formats. However, it should be noted that if only one of the\r | |
213 | source and destination textures is compressed then the number of\r | |
214 | texels touched in the compressed image will be a factor of the\r | |
215 | block size larger than in the uncompressed image.\r | |
216 | </para>\r | |
217 | <para>\r | |
218 | Slices of a <constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_TEXTURE_2D_ARRAY</constant>, <constant>GL_TEXTURE_CUBE_MAP_ARRAY</constant>\r | |
219 | <constant>GL_TEXTURE_3D</constant> and faces of <constant>GL_TEXTURE_CUBE_MAP</constant> are all compatible provided \r | |
220 | they share a compatible internal format, and multiple slices or faces\r | |
221 | may be copied between these objects with a single call by specifying the\r | |
222 | starting slice with <parameter>srcZ</parameter> and <parameter>dstZ</parameter>, and the number of slices to\r | |
223 | be copied with <parameter>srcDepth</parameter>. Cubemap textures always have six faces\r | |
224 | which are selected by a zero-based face index.\r | |
225 | </para>\r | |
226 | <para>\r | |
227 | For the purposes of CopyImageSubData, two internal formats\r | |
228 | are considered compatible if any of the following conditions are\r | |
229 | met:\r | |
230 | * the formats are the same,\r | |
231 | * the formats are considered compatible according to the \r | |
232 | compatibility rules used for texture views as defined in \r | |
233 | section 3.9.X. In particular, if both internal formats are listed\r | |
234 | in the same entry of Table 3.X.2, they are considered compatible, or\r | |
235 | * one format is compressed and the other is uncompressed and\r | |
236 | Table 4.X.1 lists the two formats in the same row.\r | |
237 | If the formats are not compatible INVALID_OPERATION is generated.\r | |
238 | </para>\r | |
239 | <table frame="topbot"><title>Sized Internal Formats</title>\r | |
240 | <tgroup cols="3" align="left">\r | |
241 | <colspec align="left"/>\r | |
242 | <colspec align="left"/>\r | |
243 | <colspec align="left"/>\r | |
244 | <thead>\r | |
245 | <row>\r | |
246 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
247 | Texel / Block Size\r | |
248 | </emphasis></entry>\r | |
249 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
250 | Uncompressed Internal Format\r | |
251 | </emphasis></entry>\r | |
252 | <entry rowsep="1" align="left"><emphasis role="bold">\r | |
253 | Compressed Internal Format(s)\r | |
254 | </emphasis></entry>\r | |
255 | </row>\r | |
256 | </thead>\r | |
257 | <tbody>\r | |
258 | <row>\r | |
259 | <entry>64-bit</entry>\r | |
260 | <entry><constant>GL_RGBA32UI</constant>, <constant>GL_RGBA32I</constant>, <constant>GL_RGBA32F</constant></entry>\r | |
261 | <entry><constant>GL_COMPRESSED_RGBA_S3TC_DXT3_EXT</constant>,\r | |
262 | <constant>GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT</constant>,\r | |
263 | <constant>GL_COMPRESSED_RGBA_S3TC_DXT5_EXT</constant>,\r | |
264 | <constant>GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT</constant>,\r | |
265 | <constant>GL_COMPRESSED_RG_RGTC2</constant>,\r | |
266 | <constant>GL_COMPRESSED_SIGNED_RG_RGTC2</constant>,\r | |
267 | <constant>GL_COMPRESSED_RGBA_BPTC_UNORM</constant>,\r | |
268 | <constant>GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM</constant>,\r | |
269 | <constant>GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT</constant>,\r | |
270 | <constant>GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT</constant></entry>\r | |
271 | </row>\r | |
272 | <row>\r | |
273 | <entry>128-bit</entry>\r | |
274 | <entry><constant>GL_RGBA16UI</constant>,\r | |
275 | <constant>GL_RGBA16I</constant>,\r | |
276 | <constant>GL_RGBA16F</constant>,\r | |
277 | <constant>GL_RG32F</constant>,\r | |
278 | <constant>GL_RG32UI</constant>,\r | |
279 | <constant>GL_RG32I</constant>,\r | |
280 | <constant>GL_RGBA16</constant>,\r | |
281 | <constant>GL_RGBA16_SNORM</constant></entry>\r | |
282 | <entry><constant>GL_COMPRESSED_RGB_S3TC_DXT1_EXT</constant>,\r | |
283 | <constant>COMPRESSED_SRGB_S3TC_DXT1_EXT</constant>,\r | |
284 | <constant>COMPRESSED_RGBA_S3TC_DXT1_EXT</constant>,\r | |
285 | <constant>COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT</constant>,\r | |
286 | <constant>COMPRESSED_RED_RGTC1</constant>,\r | |
287 | <constant>COMPRESSED_SIGNED_RED_RGTC1</constant></entry>\r | |
288 | </row>\r | |
289 | </tbody>\r | |
290 | </tgroup>\r | |
291 | </table>\r | |
292 | </refsect1>\r | |
293 | <refsect1 id="errors"><title>Errors</title>\r | |
294 | <para>\r | |
295 | <constant>GL_INVALID_OPERATION</constant> is generated if the texel size of\r | |
296 | the uncompressed image is not equal to the block size of the\r | |
297 | compressed image.\r | |
298 | </para>\r | |
299 | <para>\r | |
300 | <constant>GL_INVALID_ENUM</constant> is generated if either target parameter is not <constant>GL_RENDERBUFFER</constant>,\r | |
301 | a valid non-proxy texture target other than <constant>GL_TEXTURE_BUFFER</constant>, or is one\r | |
302 | of the cubemap face selectors.\r | |
303 | </para>\r | |
304 | <para>\r | |
305 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> does not match the type of the object.\r | |
306 | </para>\r | |
307 | <para>\r | |
308 | <constant>GL_INVALID_OPERATION</constant> is generated if either object is a texture and the texture is\r | |
309 | not complete.\r | |
310 | </para>\r | |
311 | <para>\r | |
312 | <constant>GL_INVALID_OPERATION</constant> is generated if the source and \r | |
313 | destination internal formats are not compatible, or if the number of samples do not match.\r | |
314 | </para>\r | |
315 | <para>\r | |
316 | <constant>GL_INVALID_VALUE</constant> is generated if either name does not correspond to a\r | |
317 | valid renderbuffer or texture object according to the corresponding\r | |
318 | target parameter.\r | |
319 | </para>\r | |
320 | <para>\r | |
321 | <constant>GL_INVALID_VALUE</constant> is generated if the specified level of either the source or destination is not\r | |
322 | a valid level for the corresponding image.\r | |
323 | </para>\r | |
324 | <para>\r | |
325 | <constant>GL_INVALID_VALUE</constant> is generated if the\r | |
326 | dimensions of the either subregion exceeds the boundaries of the\r | |
327 | corresponding image object, or if the image format is compressed\r | |
328 | and the dimensions of the subregion fail to meet the alignment\r | |
329 | constraints of the format.\r | |
330 | </para>\r | |
331 | </refsect1>\r | |
332 | <refsect1 id="associatedgets"><title>Associated Gets</title>\r | |
333 | <para>\r | |
334 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MAX_COMPUTE_WORK_GROUP_COUNT</constant>\r | |
335 | </para>\r | |
336 | </refsect1>\r | |
337 | <refsect1 id="seealso"><title>See Also</title>\r | |
338 | <para>\r | |
339 | <citerefentry><refentrytitle>glDispatchComputeIndirect</refentrytitle></citerefentry>.\r | |
340 | </para>\r | |
341 | </refsect1>\r | |
342 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
343 | <para>\r | |
344 | Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. \r | |
345 | This material may be distributed subject to the terms and conditions set forth in \r | |
346 | the Open Publication License, v 1.0, 8 June 1999.\r | |
347 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
348 | </para>\r | |
349 | </refsect1>\r | |
350 | </refentry>\r |