xref: /aosp_15_r20/external/angle/extensions/ANGLE_robust_resource_initialization.txt (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1Name
2
3    ANGLE_robust_resource_initialization
4
5Name Strings
6
7    GL_ANGLE_robust_resource_initialization
8
9Contributors
10
11    Geoff Lang, Google
12    Ken Russell, Google
13
14Contacts
15
16    Shannon Woods, Google (shannonwoods 'at' google.com)
17
18Status
19
20    Draft
21
22Version
23
24    Version 5, September 30, 2021
25
26Number
27
28    OpenGL ES Extension TBD
29
30Dependencies
31
32    OpenGL ES 2.0 is required.
33
34    This extension is written against the wording of the OpenGL ES
35    3.1 specification.
36
37    EGL_ANGLE_robust_initialization is required to request a
38    context that supports this extension, and resource initialization.
39
40Overview
41
42    This extension specifies the behavior for initialization of
43    resources such as textures and buffers to default values. This
44    initialization ensures that access will not be provided by the
45    GL to previously allocated data not owned by the application.
46
47New Types
48
49    None
50
51New Procedures and Functions
52
53    None
54
55New Tokens
56
57    Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
58    GetFloatv, GetDoublev, GetInteger64v, and IsEnabled:
59
60        ROBUST_RESOURCE_INITIALIZATION_ANGLE    0x93A7
61
62    Accepted by the <pname> parameter of GetTexParameteriv,
63    GetTexParameterfv, GetTexLevelParameteriv, GetTexLevelParameterfv,
64    GetRenderbufferParameteriv, GetBufferParameteriv and
65    GetBufferParameteri64v:
66
67        RESOURCE_INITIALIZED_ANGLE           0x969F
68
69
70Additions to Chapter 6 of the OpenGL ES 3.1 Specification (Buffer
71Objects)
72
73    Replace the last sentence of the first paragraph of section 6.2
74    "BufferData":
75
76    If <data> is NULL, and robust resource initialization is enabled,
77    the contents of the buffer object's data store are set to zero.
78    Otherwise, the contents of the buffer object's data store are
79    undefined.
80
81    Add to Table 6.2: Buffer object parameters and their values:
82
83    Name                        Type     Initial Value  Legal Values
84    ----                        ----     -------------  ------------
85    RESOURCE_INITIALIZED_ANGLE  boolean  TRUE           TRUE, FALSE
86
87Additions to Chapter 8 of the OpenGL ES 3.1 Specification (Textures and
88Samplers)
89
90    Replace the first two sentences of the final paragraph in section
91    8.5.3 "Texture Image Structure":
92
93    If the <data> argument of TexImage2D or TexImage3D is NULL, and the
94    pixel unpack buffer object is zero, a two- or three-dimensional
95    texel array is created with the specified <target>, <level>,
96    <internalformat>, <border>, <width>, <height>, and <depth>. If
97    robust resource initialization is enabled, the contents of the image
98    are initialized as though a clear value were provided for each
99    component of each pixel, and processed and transferred to the GL
100    as described above. The components comprising this clear-value-filled data
101    are determined by <internalformat>. If robust resource
102    initialization is not enabled, the image contents are undefined, and
103    no pixel processing is performed. In either case, no pixel values
104    are accessed in client memory. For depth components the clear value is the
105    value that is interpreted as 1.0. For all other components the clear value
106    is zero.
107
108    Replace the first sentence of the fifth paragraph in section 8.8
109    "Multisample Textures":
110
111    Upon success, TexStorage2DMultisample deletes any existing image
112    for target. If robust resource initialization is enabled, the
113    contents of each texel are initialized as though a zero value were
114    written to each channel of each sample; otherwise the contents of
115    texels are undefined.
116
117    Add to the final paragraph of section 8.17 "Immutable-Format Texture
118    Images":
119
120    If robust resource initialization is enabled, the contents of each
121    texel is initialized as though a zero value were provided for each
122    component of each pixel, and processed and transferred to the GL
123    as for a call to the appropriate TexSubImage* call for <target>.
124    Otherwise, the contents of texels are undefined.
125
126    Add to Table 8.20: Texture parameters and their values:
127
128    Name                        Type     Legal Values
129    ----                        ----     ------------
130    RESOURCE_INITIALIZED_ANGLE  boolean  TRUE, FALSE
131
132    Add to the end of section 8.10.3 "Texture Level Parameter Queries":
133
134    Queries of pname RESOURCE_INITIALIZED_ANGLE return the initialization
135    state of the image.
136
137Additions to Chapter 9 of the OpenGL ES 3.1 Specification (Framebuffers
138and Framebuffer Objects)
139
140    Replace the sentence in section 9.2.4 "Renderbuffer Objects"
141    beginning "Upon success, RenderbufferStorageMultisample":
142
143    Upon success, RenderbufferStorageMultisample deletes any existing
144    data store for the renderbuffer image. If robust resource
145    initialization is enabled, the contents of each pixel in the data
146    store are initialized as though a clear value was written to each
147    channel of each sample; otherwise, the contents of the data store
148    are undefined. For depth components the clear value is the
149    value that is interpreted 1.0. For all other components the clear
150    value is zero.
151
152    Add to the end of section 9.2.6 "Renderbuffer Object Queries":
153
154    If pname is RESOURCE_INITIALIZED_ANGLE then params will contain the
155    initialization state of the renderbuffer currently bound to target.
156
157Interactions with EGL_ANGLE_create_context_robust_resource_initialization
158
159    If the EGL window-system binding API is used to create a context,
160    the EGL_ANGLE_create_context_robust_initialization extension is
161    supported, and the attribute
162    EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE is set to
163    EGL_TRUE when eglCreateContext is called, the resulting context
164    will perform robust resource initialization as described above in
165    section <section>, and the
166    CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE
167    query will return GL_TRUE as described above in section 2.6.1.1.
168    Otherwise queries will return GL_FALSE.
169
170New State
171
172    (add to Table 20.4: Buffer Object State)
173
174                                                                          Initial
175    Get Value                            Type   Get Command                Value   Description                  Sec.
176    ----------------------               ----   -------------------        ------  ---------------------------  ------
177    RESOURCE_INITIALIZED_ANGLE            B     GetBufferParameteriv       TRUE    Buffer data has been         6.6
178                                                                                   initialized
179
180    (add to Table 20.9: Textures (state per texture object))
181
182                                                                          Initial
183    Get Value                            Type   Get Command                Value   Description                  Sec.
184    ----------------------               ----   -------------------        ------  ---------------------------  ------
185    RESOURCE_INITIALIZED_ANGLE            B     GetTexParameteriv          TRUE    All specified images have    8.10.2
186                                                                                   been initialized
187
188    (add to Table 20.10 Textures (state per texture image))
189
190                                                                          Initial
191    Get Value                            Type   Get Command                Value   Description                  Sec.
192    ----------------------               ----   -------------------        ------  ---------------------------  ------
193    RESOURCE_INITIALIZED_ANGLE            B     GetTexLevelParameteriv     TRUE    Image data has been          8.10.3
194                                                                                   initialized
195
196    (add to Table 20.16: Renderbuffer (state per renderbuffer object))
197
198                                                                          Initial
199    Get Value                            Type   Get Command                Value   Description                  Sec.
200    ----------------------               ----   -------------------        ------  ---------------------------  ------
201    RESOURCE_INITIALIZED_ANGLE            B     GetRenderbufferParameteriv TRUE    Renderbuffer data has been   9.2.6
202                                                                                   initialized
203
204Issues
205
206    None
207
208Revision History
209
210    Version 1, 2015/01/07 - first draft.
211    Version 2, 2017/03/07 - fixed EGL naming and added IsEnabled.
212    Version 3, 2017/09/19 - name cleanup.
213    Version 4, 2020/10/12 - Add RESOURCE_INITIALIZED_ANGLE queries.
214    Version 5, 2021/09/30 - Specify that depth components are cleared to 1.0.
215