xref: /aosp_15_r20/external/angle/extensions/CHROMIUM_copy_texture.txt (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1Name
2
3    CHROMIUM_copy_texture
4
5Name Strings
6
7    GL_CHROMIUM_copy_texture
8
9Version
10
11    Last Modifed Date: March 24, 2017
12
13Dependencies
14
15    OpenGL ES 2.0 or OpenGL ES 3.0 is required.
16
17    EXT_texture_format_BGRA8888 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.
20
21Overview
22
23    This extension expands on the functionality provided by the
24    glCopyTexImage2D command.  A new function is exported,
25    glCopyTextureCHROMIUM, that performs the same copy operation as
26    glCopyTexImage2D.
27
28    The extension also supports copying BGRA textures and copying
29    EXTERNAL_OES texture to BGRA texture, which is not explicitly
30    granted by EXT_texture_format_BGRA8888.
31
32New Procedures and Functions
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
61Additions to the OpenGL ES 2.0 Specification
62
63    The command
64
65        CopyTextureCHROMIUM
66
67    Copies the contents of <sourceLevel> level of <sourceId> texture to
68    <destLevel> level and <destTarget> target of <destId> texture.
69
70    <destTarget> must be TEXTURE_2D,
71    TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
72    TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
73    TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z,
74    TEXTURE_RECTANGLE_ARB.
75
76    The internal format of the destination texture is converted to that
77    specified by <internalFormat>.
78
79    When source texture doens't contain a superset of the component
80    required by <internalFormat>, fill the components by following rules.
81
82       source format           color components
83       ----------------------------------------
84       ALPHA                   (0, 0, 0, A)
85       RED                     (R, 0, 0, 1)
86       LUMINANCE               (L, L, L, 1)
87       LUMINANCE_ALPHA         (L, L, L, A)
88       RGB                     (R, G, B, 1)
89       RGB8                    (R, G, B, 1)
90       RGBA                    (R, G, B, A)
91       RGBA8                   (R, G, B, A)
92       BGRA_EXT                (R, G, B, A)
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
97    The format type of the destination texture is converted to that specified
98    by <destType>.
99
100    If <flipY> is true, vertically flip texture image data.
101
102    If <unpackPremultiplyAlpha> and <unpackUnmultiplyAlpha> are true,
103    no alpha processing occurs.  This is the equivalent of having neither flag
104    set.
105
106    When <sourceId> refers to a stream texture, the texture matrix will be
107    applied as part of the copy operation.
108
109    INVALID_OPERATION is generated if <internalFormat> is not one of the
110    formats in Table 1.0.
111
112    INVALID_OPERATION is generated if the internal format of <sourceId> is not
113    one of formats in Table 1.1.
114
115    INVALID_VALUE is generated if <sourceId> or <destId> are not valid texture
116    objects.
117
118    INVALID_ENUM is generated if <destTarget> is not one of the valid targets
119    described above.
120
121    INVALID_OPERATION is generated if the bound target of destination texture
122    does not match <target>.
123
124    INVALID_VALUE is generated if textures corresponding to <destId> have not
125    been bound as TEXTURE_2D, TEXTURE_CUBE_MAP, or
126    TEXTURE_RECTANGLE_ARB objects.
127
128    INVALID_VALUE is generated if textures corresponding to <sourceId> have not
129    been bound as TEXTURE_2D, TEXTURE_RECTANGLE_ARB or
130    TEXTURE_EXTERNAL_OES objects.
131
132    INVALID_VALUE is generated if <sourceLevel> is not 0 for ES 2.0, or if
133    <sourceLevel> or <destLevel> is less than 0 for ES 3.0.
134
135    INVALID_VALUE is generated if <sourceLevel> of the source texture is not
136    defined.
137
138    The command
139
140        CopySubTextureCHROMIUM
141
142    Copies the sub contents of texture referred to by <sourceId> to <destId>
143    texture without redefining <destId> texture.
144
145    See CopyTextureCHROMIUM for the interpretation of the <destTarget>,
146    <sourceLevel>, <destLevel>, <flipY>, <premultiplyAlpha>, and
147    <unmultiplyAlpha> arguments.
148
149    <xoffset> and <yoffset> specify a texel offset in the x and y direction
150    respectively within the destination texture.
151
152    <x> and <y> specify specify a texel offset in the x and y direction
153    respectively within the source texture.
154
155    <width> specifies the width of the texture subimage.
156
157    <height> specifies the width of the texture subimage.
158
159    INVALID_VALUE is generated if either <sourceId> texture or <destId>
160    texture is not defined.
161
162    INVALID_OPERATION is generated if the internal format of <sourceId> or
163    <destId> is not one of formats in Table 1.1.
164
165    INVALID_OPERATION is generated if the destination texture array has not
166    been defined.
167
168    INVALID_VALUE is generated if <destId> texture is not bound as
169    TEXTURE_2D or TEXTURE_RECTANGLE_ARB.
170
171    INVALID_VALUE is generated if level 0 of the source texture or
172    the destination texture is not defined.
173
174    INVALID_VALUE is generated if (<xoffset> + <width>) > destWidth,
175    or (<yoffset> + <height>) > destHeight.
176
177    Table 1.0 Valid internal formats for CopyTextureCHROMIUM:
178
179        <internalFormat>
180        ---------------
181        ALPHA
182        BGRA8_EXT
183        BGRA_EXT
184        LUMINANCE
185        LUMINANCE_ALPHA
186        R11F_G11F_B10F
187        R16F
188        R32F
189        R8
190        R8UI
191        RG16F
192        RG32F
193        RG8
194        RG8UI
195        RGB
196        RGB10_A2
197        RGB16F
198        RGB32F
199        RGB565
200        RGB5_A1
201        RGB8
202        RGB8UI
203        RGB9_E5
204        RGBA
205        RGBA16F
206        RGBA32F
207        RGBA4
208        RGBA8
209        RGBA8UI
210        RGBX8_ANGLE
211        SRGB8
212        SRGB8_ALPHA8
213        SRGB_ALPHA_EXT
214        SRGB_EXT
215
216    Table 1.1 Valid source texture internal formats for CopyTextureCHROMIUM and
217    source and destination formats for CopySubTextureCHROMIUM:
218
219        internal format
220        ---------------
221        RED
222        ALPHA
223        LUMINANCE
224        LUMINANCE_ALPHA
225        RGB
226        RGBA
227        RGB8
228        RGBA8
229        BGRA_EXT
230        BGRA8_EXT
231        RGB_YCBCR_420V_CHROMIUM
232        RGB_YCBCR_422_CHROMIUM
233
234Dependencies on ARB_texture_rg
235
236    If ARB_texture_rg is not supported:
237     * delete any reference to the R8 format.
238
239Dependencies on CHROMIUM_ycbcr_422_image
240
241    If CHROMIUM_ycbcr_422_image is not supported:
242     * delete any reference to the RGB_YCBCR_422_CHROMIUM format.
243
244Errors
245
246    None.
247
248New Tokens
249
250    None.
251
252New State
253
254    None.
255
256Revision History
257
258    8/1/2011    Documented the extension
259    7/4/2013    Add a new parameter dest_type to glCopyTextureCHROMIUM()
260    16/7/2014   Add TEXTURE_RECTANGLE_ARB as valid source_id target
261    19/6/2015   Add arguments unpack_flip_y, unpack_premultiply_alpha, and
262                unpack_unmultiply_alpha to both commands.
263    4/1/2016    Removed the argument target.
264    4/1/2016    Added TEXTURE_RECTANGLE_ARB as valid dest_id target.
265    19/12/2016  Supported more ES 3.0 formats.
266    18/1/2017   Supported source_level and dest_level.
267    19/1/2017   Added TEXTURE_CUBE_MAP as valid dest_id target.
268    24/3/2017   Clean up naming and move formats into tables.
269