1e5c31af7Sopenharmony_ci-------------------------------------------------------------------------
2e5c31af7Sopenharmony_cidrawElements Quality Program Test Specification
3e5c31af7Sopenharmony_ci-----------------------------------------------
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ciCopyright 2014 The Android Open Source Project
6e5c31af7Sopenharmony_ci
7e5c31af7Sopenharmony_ciLicensed under the Apache License, Version 2.0 (the "License");
8e5c31af7Sopenharmony_ciyou may not use this file except in compliance with the License.
9e5c31af7Sopenharmony_ciYou may obtain a copy of the License at
10e5c31af7Sopenharmony_ci
11e5c31af7Sopenharmony_ci     http://www.apache.org/licenses/LICENSE-2.0
12e5c31af7Sopenharmony_ci
13e5c31af7Sopenharmony_ciUnless required by applicable law or agreed to in writing, software
14e5c31af7Sopenharmony_cidistributed under the License is distributed on an "AS IS" BASIS,
15e5c31af7Sopenharmony_ciWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16e5c31af7Sopenharmony_ciSee the License for the specific language governing permissions and
17e5c31af7Sopenharmony_cilimitations under the License.
18e5c31af7Sopenharmony_ci-------------------------------------------------------------------------
19e5c31af7Sopenharmony_ci    Object lifetime tests.
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ciTests:
22e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.lifetime.*
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ciIncludes:
25e5c31af7Sopenharmony_ci + The following OpenGL ES 3.0 object types
26e5c31af7Sopenharmony_ci   - Buffers
27e5c31af7Sopenharmony_ci   - Textures
28e5c31af7Sopenharmony_ci   - Renderbuffers
29e5c31af7Sopenharmony_ci   - Framebuffers
30e5c31af7Sopenharmony_ci   - Shaders
31e5c31af7Sopenharmony_ci   - Programs
32e5c31af7Sopenharmony_ci   - Queries
33e5c31af7Sopenharmony_ci   - Transform feedbacks
34e5c31af7Sopenharmony_ci   - Vertex arrays
35e5c31af7Sopenharmony_ci   - Samplers
36e5c31af7Sopenharmony_ci + Object existence tests based on Is* queries
37e5c31af7Sopenharmony_ci   - After calling Gen* or Create*
38e5c31af7Sopenharmony_ci   - After calling Gen* or Create*, then Delete*
39e5c31af7Sopenharmony_ci   - After calling Gen*, then Bind*
40e5c31af7Sopenharmony_ci   - After calling Gen*, then Bind*, then Delete*
41e5c31af7Sopenharmony_ci   - After calling Bind* without preceding Gen*
42e5c31af7Sopenharmony_ci   - After calling CreateProgram, then UseProgram, then DeleteProgram
43e5c31af7Sopenharmony_ci   - After calling BeginTransformFeedback, then DeleteTransformFeedbacks
44e5c31af7Sopenharmony_ci + Tests for deleting an object that is attached to a container
45e5c31af7Sopenharmony_ci   - Is* queries for the name of the deleted object
46e5c31af7Sopenharmony_ci   - Reading from the container
47e5c31af7Sopenharmony_ci   - Writing to the container
48e5c31af7Sopenharmony_ci
49e5c31af7Sopenharmony_ciExcludes:
50e5c31af7Sopenharmony_ci + Sync objects
51e5c31af7Sopenharmony_ci + Deleting an object that is currently bound in another context
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ciDescription:
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ciThese tests check that creation and deletion of objects adheres to the
56e5c31af7Sopenharmony_ciOpenGL ES 3.0 specification. The tests check the existence of objects as
57e5c31af7Sopenharmony_cireported by the Is* family of GL functions, the state of bindings as
58e5c31af7Sopenharmony_cireported in various state variables, and the behavior of containers with
59e5c31af7Sopenharmony_cideleted objects.
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ciNOTE: Because these tests try to delete objects that are directly or
62e5c31af7Sopenharmony_ciindirectly attached to the current context, a faulty OpenGL ES
63e5c31af7Sopenharmony_ciimplementation may reclaim and later reallocate memory that is still
64e5c31af7Sopenharmony_cibeing referenced. This may result in unpredictable errors at some later
65e5c31af7Sopenharmony_citime. Use of external memory debugging tools may be required to
66e5c31af7Sopenharmony_ciaccurately identify these errors.
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ciThe "gen.*" test cases call the object type's Gen* or Create* function
69e5c31af7Sopenharmony_cito allocate a new name, and then check whether the name is used, i.e.
70e5c31af7Sopenharmony_ciwhether a new object was created for the name (as reported by the result
71e5c31af7Sopenharmony_ciof the corresponding Is* function). In OpenGL ES 3.0, the Create*
72e5c31af7Sopenharmony_cifunctions and the GenSamplers function must always create an object, and
73e5c31af7Sopenharmony_cithe other Gen* functions must never create an object.
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ciThe "delete.*" test cases call an object type's Gen* or Create* function
76e5c31af7Sopenharmony_cifollowed by the Delete* function. They then check that the generated
77e5c31af7Sopenharmony_ciname is no longer in use.
78e5c31af7Sopenharmony_ci
79e5c31af7Sopenharmony_ciThe "bind.*" test cases call an object type's Gen* function followed by
80e5c31af7Sopenharmony_ciits Bind* function. They then check that the name is in use.
81e5c31af7Sopenharmony_ci
82e5c31af7Sopenharmony_ciThe "delete_bound.*" test cases call an object type's Gen* function
83e5c31af7Sopenharmony_cifollowed by its Bind* function and Delete* function. They then check
84e5c31af7Sopenharmony_cithat the name is no longer in use and that the binding has been removed.
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ciThe "bind_no_gen.*" test cases call the object type's Bind* function for
87e5c31af7Sopenharmony_cia random name that has not been produced by the Gen* function. They then
88e5c31af7Sopenharmony_cicheck whether the function call succeeded. In OpenGL ES 3.0, the
89e5c31af7Sopenharmony_ciBindBuffer, BindFramebuffer, BindRenderbuffer and BindTexture functions
90e5c31af7Sopenharmony_cimust succeed for arbitrary object names, and the other Bind* functions
91e5c31af7Sopenharmony_cimust fail.
92e5c31af7Sopenharmony_ci
93e5c31af7Sopenharmony_ciThe "delete_used.program" test case creates a new program object (along
94e5c31af7Sopenharmony_ciwith associated shader objects) and makes it the current program with
95e5c31af7Sopenharmony_cithe glUseProgram function. The program object is then deleted. The test
96e5c31af7Sopenharmony_cichecks that the name of the program remains in use and is flagged for
97e5c31af7Sopenharmony_cideletion. Then the program is made non-current and the test checks that
98e5c31af7Sopenharmony_cithe name becomes unused.
99e5c31af7Sopenharmony_ci
100e5c31af7Sopenharmony_ciThe "delete_active.transform_feedback" test case creates a new transform
101e5c31af7Sopenharmony_cifeedback object, makes it active with the BeginTransformFeedback
102e5c31af7Sopenharmony_cifunction, and then attempts to delete it. The test checks that the
103e5c31af7Sopenharmony_cideletion fails.
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ciThe "attach.*" family of test cases create a container object (a
106e5c31af7Sopenharmony_ciframebuffer, vertex array, transform feedback, or program) and attach
107e5c31af7Sopenharmony_cianother object (a texture, renderbuffer, buffer or shader) to it. The
108e5c31af7Sopenharmony_ciattached object is then deleted.
109e5c31af7Sopenharmony_ci
110e5c31af7Sopenharmony_ciIn the "attach.deleted_name.*" test cases, the container is queried for
111e5c31af7Sopenharmony_ciits attachment, and the existence of the deleted attachment object is
112e5c31af7Sopenharmony_cichecked. In OpenGL ES 3.0, shader objects must exist even after deletion
113e5c31af7Sopenharmony_ciif they are attached to a program.
114e5c31af7Sopenharmony_ci
115e5c31af7Sopenharmony_ciIn the "attach.deleted_input.*" test cases, the container is read from
116e5c31af7Sopenharmony_ci(by reading a framebuffer's pixel contents or using a program or vertex
117e5c31af7Sopenharmony_ciarray for drawing) first before the attachment is deleted, and then
118e5c31af7Sopenharmony_ciagain after deleting the attachment and creating a new object of the
119e5c31af7Sopenharmony_ciattachment type. If the results differ, the new object erroneously
120e5c31af7Sopenharmony_ciaffected the container's state.
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ciIn the "attach.deleted_output.*" test cases, the container is written to
123e5c31af7Sopenharmony_ci(by drawing to a framebuffer or by using a transform feedback) first
124e5c31af7Sopenharmony_ciafter deleting the attachment and then again after creating a new object
125e5c31af7Sopenharmony_ciof the attachment type. If the writing affected the new object state, it
126e5c31af7Sopenharmony_cierroneously shared state with the deleted attachment.
127