OLD | NEW |
1 Name | 1 Name |
2 | 2 |
3 CHROMIUM_copy_texture | 3 CHROMIUM_copy_texture |
4 | 4 |
5 Name Strings | 5 Name Strings |
6 | 6 |
7 GL_CHROMIUM_copy_texture | 7 GL_CHROMIUM_copy_texture |
8 | 8 |
9 Version | 9 Version |
10 | 10 |
11 Last Modifed Date: March 24, 2017 | 11 Last Modifed Date: July 16, 2014 |
12 | 12 |
13 Dependencies | 13 Dependencies |
14 | 14 |
15 OpenGL ES 2.0 or OpenGL ES 3.0 is required. | 15 OpenGL ES 2.0 or OpenGL ES 3.0 is required. |
16 | 16 |
17 EXT_texture_format_BGRA8888 affects the definition of this extension. | 17 EXT_texture_format_BGRA8888 affects the definition of this extension. |
18 ARB_texture_rg affects the definition of this extension. | 18 ARB_texture_rg affects the definition of this extension. |
19 CHROMIUM_ycbcr_422_image affects the definition of this extension. | 19 CHROMIUM_ycbcr_422_image affects the definition of this extension. |
20 | 20 |
21 Overview | 21 Overview |
22 | 22 |
23 This extension expands on the functionality provided by the | 23 This extension expands on the functionality provided by the |
24 glCopyTexImage2D command. A new function is exported, | 24 glCopyTexImage2D command. A new function is exported, |
25 glCopyTextureCHROMIUM, that performs the same copy operation as | 25 glCopyTextureCHROMIUM, that performs the same copy operation as |
26 glCopyTexImage2D. | 26 glCopyTexImage2D. |
27 | 27 |
28 The extension also supports copying BGRA textures and copying | 28 The extension also supports copying BGRA textures and copying |
29 EXTERNAL_OES texture to BGRA texture, which is not explicitly | 29 EXTERNAL_OES texture to BGRA texture, which is not explicitly |
30 granted by EXT_texture_format_BGRA8888. | 30 granted by EXT_texture_format_BGRA8888. |
31 | 31 |
32 New Procedures and Functions | 32 New Procedures and Functions |
33 | 33 |
34 void CopyTextureCHROMIUM(uint sourceId, | |
35 int sourceLevel, | |
36 enum destTarget, | |
37 uint destId, | |
38 int destLevel, | |
39 int internalFormat, | |
40 enum destType, | |
41 boolean unpackFlipY, | |
42 boolean unpackPremultiplyAlpha, | |
43 boolean unpackUnmultiplyAlpha) | |
44 | |
45 | |
46 void CopySubTextureCHROMIUM(uint sourceId, | |
47 int sourceLevel, | |
48 enum destTarget, | |
49 uint destId, | |
50 int destLevel, | |
51 int xoffset, | |
52 int yoffset, | |
53 int x, | |
54 int y, | |
55 sizei width, | |
56 sizei height, | |
57 boolean unpackFlipY, | |
58 boolean unpackPremultiplyAlpha, | |
59 boolean unpackUnmultiplyAlpha) | |
60 | |
61 Additions to the OpenGL ES 2.0 Specification | |
62 | |
63 The command | 34 The command |
64 | 35 |
65 CopyTextureCHROMIUM | 36 void glCopyTextureCHROMIUM (GLenum source_id, |
| 37 GLint source_level, |
| 38 GLenum dest_target, |
| 39 GLenum dest_id, |
| 40 GLint dest_level, |
| 41 GLint internal_format, GLenum dest_type, |
| 42 GLboolean unpack_flip_y, |
| 43 GLboolean unpack_premultiply_alpha, |
| 44 GLboolean unpack_unmultiply_alpha) |
66 | 45 |
67 Copies the contents of <sourceLevel> level of <sourceId> texture to | 46 Copies the contents of <source_id> texture to <dest_id> texture. |
68 <destLevel> level and <destTarget> target of <destId> texture. | |
69 | 47 |
70 <destTarget> must be TEXTURE_2D, | 48 <source_level> specifies the level of the source texture which is copied |
71 TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, | 49 from. |
72 TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, | 50 <dest_level> specifies the level of the destination texture which is copied |
73 TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z, | 51 to. |
74 TEXTURE_RECTANGLE_ARB. | 52 |
| 53 <dest_target> specifies the target of destination texture. Must be |
| 54 GL_TEXTURE_2D, |
| 55 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, |
| 56 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, |
| 57 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, |
| 58 GL_TEXTURE_RECTANGLE_ARB. |
75 | 59 |
76 The internal format of the destination texture is converted to that | 60 The internal format of the destination texture is converted to that |
77 specified by <internalFormat>. | 61 specified by <internal_format>. Must be one of the following symbolic |
| 62 constants: GL_RGB, GL_RGBA, GL_RGB8, GL_RGBA8, GL_BGRA_EXT, GL_BGRA8_EXT, |
| 63 GL_SRGB_EXT, GL_SRGB_ALPHA_EXT, GL_R8, GL_R8UI, GL_RG8, GL_RG8UI, GL_SRGB8, |
| 64 GL_RGB565, GL_RGB8UI, GL_SRGB8_ALPHA8, GL_RGB5_A1, GL_RGBA4, GL_RGBA4, |
| 65 GL_RGBA8UI, GL_RGB9_E5, GL_R16F, GL_R32F, GL_RG16F, GL_RG32F, GL_RGB16F, |
| 66 GL_RGB32F, GL_RGBA16F, GL_RGBA32F, GL_R11F_G11F_B10F. |
| 67 The internal format of source texture must be one of the following |
| 68 symbolic constants: GL_RED, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, |
| 69 GL_RGB, GL_RGBA, GL_RGB8, GL_RGBA8, GL_BGRA_EXT, GL_BGRA8_EXT, |
| 70 GL_RGB_YCBCR_420V_CHROMIUM, GL_RGB_YCBCR_422_CHROMIUM. |
| 71 When source texture doens't contain a superset of the component |
| 72 required by <internal_format>, fill the components by following rules. |
78 | 73 |
79 When source texture doens't contain a superset of the component | 74 source format color components |
80 required by <internalFormat>, fill the components by following rules. | 75 ===================================================== |
81 | 76 GL_ALPHA (0, 0, 0, A) |
82 source format color components | 77 GL_RED (R, 0, 0, 1) |
83 ---------------------------------------- | 78 GL_LUMINANCE (L, L, L, 1) |
84 ALPHA (0, 0, 0, A) | 79 GL_LUMINANCE_ALPHA (L, L, L, A) |
85 RED (R, 0, 0, 1) | 80 GL_RGB (R, G, B, 1) |
86 LUMINANCE (L, L, L, 1) | 81 GL_RGB8 (R, G, B, 1) |
87 LUMINANCE_ALPHA (L, L, L, A) | 82 GL_RGBA (R, G, B, A) |
88 RGB (R, G, B, 1) | 83 GL_RGBA8 (R, G, B, A) |
89 RGB8 (R, G, B, 1) | 84 GL_BGRA_EXT (R, G, B, A) |
90 RGBA (R, G, B, A) | 85 GL_BGRA8_EXT (R, G, B, A) |
91 RGBA8 (R, G, B, A) | 86 GL_RGB_YCBCR_420V_CHROMIUM (R, G, B, 1) |
92 BGRA_EXT (R, G, B, A) | 87 GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1) |
93 BGRA8_EXT (R, G, B, A) | |
94 RGB_YCBCR_420V_CHROMIUM (R, G, B, 1) | |
95 RGB_YCBCR_422_CHROMIUM (R, G, B, 1) | |
96 | 88 |
97 The format type of the destination texture is converted to that specified | 89 The format type of the destination texture is converted to that specified |
98 by <destType>. | 90 by <dest_type>. |
99 | 91 |
100 If <flipY> is true, vertically flip texture image data. | 92 If <flip_y> is true, vertically flip texture image data. |
101 | 93 |
102 If <unpackPremultiplyAlpha> and <unpackUnmultiplyAlpha> are true, | 94 If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true, |
103 no alpha processing occurs. This is the equivalent of having neither flag | 95 no alpha processing occurs. This is the equivalent of having neither flag |
104 set. | 96 set. |
105 | 97 |
106 When <sourceId> refers to a stream texture, the texture matrix will be | 98 When <source_id> refers to a stream texture, the texture matrix will be |
107 applied as part of the copy operation. | 99 applied as part of the copy operation. |
108 | 100 |
109 INVALID_OPERATION is generated if <internalFormat> is not one of the | 101 INVALID_OPERATION is generated if <internal_format> is not one of the valid |
110 formats in Table 1.0. | 102 formats described above. |
111 | 103 |
112 INVALID_OPERATION is generated if the internal format of <sourceId> is not | 104 INVALID_OPERATION is generated if the internal format of <source_id> is not |
113 one of formats in Table 1.1. | 105 one of formats from the table above. |
114 | 106 |
115 INVALID_VALUE is generated if <sourceId> or <destId> are not valid texture | 107 INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture |
116 objects. | 108 objects. |
117 | 109 |
118 INVALID_ENUM is generated if <destTarget> is not one of the valid targets | 110 INVALID_ENUM is generated if <dest_target> is not one of the valid targets |
119 described above. | 111 described above. |
120 | 112 |
121 INVALID_OPERATION is generated if the bound target of destination texture | 113 INVALID_OPERATION is generated if the bound target of destination texture |
122 does not match <target>. | 114 does not match <target>. |
123 | 115 |
124 INVALID_VALUE is generated if textures corresponding to <destId> have not | 116 INVALID_VALUE is generated if textures corresponding to <dest_id> have not |
125 been bound as TEXTURE_2D, TEXTURE_CUBE_MAP, or | 117 been bound as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, or |
126 TEXTURE_RECTANGLE_ARB objects. | 118 GL_TEXTURE_RECTANGLE_ARB objects. |
127 | 119 |
128 INVALID_VALUE is generated if textures corresponding to <sourceId> have not | 120 INVALID_VALUE is generated if textures corresponding to <source_id> have not |
129 been bound as TEXTURE_2D, TEXTURE_RECTANGLE_ARB or | 121 been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or |
130 TEXTURE_EXTERNAL_OES objects. | 122 GL_TEXTURE_EXTERNAL_OES objects. |
131 | 123 |
132 INVALID_VALUE is generated if <sourceLevel> is not 0 for ES 2.0, or if | 124 INVALID_VALUE is generated if <source_level> is not 0 for ES 2.0, or if |
133 <sourceLevel> or <destLevel> is less than 0 for ES 3.0. | 125 <source_level> or <dest_level> is less than 0 for ES 3.0. |
134 | 126 |
135 INVALID_VALUE is generated if <sourceLevel> of the source texture is not | 127 INVALID_VALUE is generated if <source_level> of the source texture is not |
136 defined. | 128 defined. |
137 | 129 |
138 The command | 130 The command |
139 | 131 |
140 CopySubTextureCHROMIUM | 132 void glCopySubTextureCHROMIUM (GLenum source_id, |
| 133 GLint source_level, |
| 134 GLenum dest_target, |
| 135 GLenum dest_id, |
| 136 GLint dest_level, |
| 137 GLint xoffset, GLint yoffset, |
| 138 GLint x, GLint y, |
| 139 GLsizei width, GLsizei height, |
| 140 GLboolean unpack_flip_y, |
| 141 GLboolean unpack_premultiply_alpha, |
| 142 GLboolean unpack_unmultiply_alpha) |
141 | 143 |
142 Copies the sub contents of texture referred to by <sourceId> to <destId> | 144 Copies the sub contents of texture referred to by <source_id> to <dest_id> |
143 texture without redefining <destId> texture. | 145 texture without redefining <dest_id> texture. |
144 | 146 |
145 See CopyTextureCHROMIUM for the interpretation of the <destTarget>, | 147 See CopyTextureCHROMIUM for the interpretation of the <dest_target>, |
146 <sourceLevel>, <destLevel>, <flipY>, <premultiplyAlpha>, and | 148 <source_level>, <dest_level>, <flip_y>, <premultiply_alpha>, and |
147 <unmultiplyAlpha> arguments. | 149 <unmultiply_alpha> arguments. |
148 | 150 |
149 <xoffset> and <yoffset> specify a texel offset in the x and y direction | 151 <xoffset> and <yoffset> specify a texel offset in the x and y direction |
150 respectively within the destination texture. | 152 respectively within the destination texture. |
151 | 153 |
152 <x> and <y> specify specify a texel offset in the x and y direction | 154 <x> and <y> specify specify a texel offset in the x and y direction |
153 respectively within the source texture. | 155 respectively within the source texture. |
154 | 156 |
155 <width> specifies the width of the texture subimage. | 157 <width> specifies the width of the texture subimage. |
156 | 158 |
157 <height> specifies the width of the texture subimage. | 159 <height> specifies the width of the texture subimage. |
158 | 160 |
159 INVALID_VALUE is generated if either <sourceId> texture or <destId> | 161 INVALID_VALUE is generated if either <source_id> texture or <dest_id> |
160 texture is not defined. | 162 texture is not defined. |
161 | 163 |
162 INVALID_OPERATION is generated if the internal format of <sourceId> or | 164 INVALID_OPERATION is generated if source internal_format and destination |
163 <destId> is not one of formats in Table 1.1. | 165 internal_format are not one of the valid formats described above. |
164 | 166 |
165 INVALID_OPERATION is generated if the destination texture array has not | 167 INVALID_OPERATION is generated if the destination texture array has not |
166 been defined. | 168 been defined. |
167 | 169 |
168 INVALID_VALUE is generated if <destId> texture is not bound as | 170 INVALID_VALUE is generated if <dest_id> texture is not bound as |
169 TEXTURE_2D or TEXTURE_RECTANGLE_ARB. | 171 GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. |
170 | 172 |
171 INVALID_VALUE is generated if level 0 of the source texture or | 173 INVALID_VALUE is generated if level 0 of the source texture or |
172 the destination texture is not defined. | 174 the destination texture is not defined. |
173 | 175 |
174 INVALID_VALUE is generated if (<xoffset> + <width>) > destWidth, | 176 INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0. |
175 or (<yoffset> + <height>) > destHeight. | |
176 | 177 |
177 Table 1.0 Valid internal formats for CopyTextureCHROMIUM: | 178 INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width, |
178 | 179 or (<yoffset> + <height>) > dest_height. |
179 <internalFormat> | |
180 --------------- | |
181 RGB | |
182 RGBA | |
183 RGB8 | |
184 RGBA8 | |
185 BGRA_EXT | |
186 BGRA8_EXT, | |
187 SRGB_EXT | |
188 SRGB_ALPHA_EXT | |
189 R8 | |
190 R8UI | |
191 RG8 | |
192 RG8UI | |
193 SRGB8 | |
194 RGB565 | |
195 RGB8UI | |
196 SRGB8_ALPHA8 | |
197 RGB5_A1 | |
198 RGBA4 | |
199 RGBA4 | |
200 RGBA8UI | |
201 RGB9_E5 | |
202 R16F | |
203 R32F | |
204 RG16F | |
205 RG32F | |
206 RGB16F | |
207 RGB32F | |
208 RGBA16F | |
209 RGBA32F | |
210 R11F_G11F_B10F | |
211 | |
212 Table 1.1 Valid source texture internal formats for CopyTextureCHROMIUM and | |
213 source and destination formats for CopySubTextureCHROMIUM: | |
214 | |
215 internal format | |
216 --------------- | |
217 RED | |
218 ALPHA | |
219 LUMINANCE | |
220 LUMINANCE_ALPHA | |
221 RGB | |
222 RGBA | |
223 RGB8 | |
224 RGBA8 | |
225 BGRA_EXT | |
226 BGRA8_EXT | |
227 RGB_YCBCR_420V_CHROMIUM | |
228 RGB_YCBCR_422_CHROMIUM. | |
229 | 180 |
230 Dependencies on ARB_texture_rg | 181 Dependencies on ARB_texture_rg |
231 | 182 |
232 If ARB_texture_rg is not supported: | 183 If ARB_texture_rg is not supported: |
233 * delete any reference to the R8 format. | 184 * delete any reference to the R8 format. |
234 | 185 |
235 Dependencies on CHROMIUM_ycbcr_422_image | 186 Dependencies on CHROMIUM_ycbcr_422_image |
236 | 187 |
237 If CHROMIUM_ycbcr_422_image is not supported: | 188 If CHROMIUM_ycbcr_422_image is not supported: |
238 * delete any reference to the RGB_YCBCR_422_CHROMIUM format. | 189 * delete any reference to the RGB_YCBCR_422_CHROMIUM format. |
239 | 190 |
240 Errors | 191 Errors |
241 | 192 |
242 None. | 193 None. |
243 | 194 |
244 New Tokens | 195 New Tokens |
245 | 196 |
246 None. | 197 None. |
247 | 198 |
248 New State | 199 New State |
249 | 200 |
250 None. | 201 None. |
251 | 202 |
252 Revision History | 203 Revision History |
253 | 204 |
254 8/1/2011 Documented the extension | 205 8/1/2011 Documented the extension |
255 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM() | 206 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM() |
256 16/7/2014 Add TEXTURE_RECTANGLE_ARB as valid source_id target | 207 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target |
257 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and | 208 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and |
258 unpack_unmultiply_alpha to both commands. | 209 unpack_unmultiply_alpha to both commands. |
259 4/1/2016 Removed the argument target. | 210 4/1/2016 Removed the argument target. |
260 4/1/2016 Added TEXTURE_RECTANGLE_ARB as valid dest_id target. | 211 4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target. |
261 19/12/2016 Supported more ES 3.0 formats. | 212 19/12/2016 Supported more ES 3.0 formats. |
262 18/1/2017 Supported source_level and dest_level. | 213 18/1/2017 Supported source_level and dest_level. |
263 19/1/2017 Added TEXTURE_CUBE_MAP as valid dest_id target. | 214 19/1/2017 Added GL_TEXTURE_CUBE_MAP as valid dest_id target. |
264 24/3/2017 Clean up naming and move formats into tables. | |
OLD | NEW |