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-GLES2.functional.lifetime.*
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ciIncludes:
25e5c31af7Sopenharmony_ci + All OpenGL ES 2.0 object types
26e5c31af7Sopenharmony_ci   - Buffers
27e5c31af7Sopenharmony_ci   - Textures
28e5c31af7Sopenharmony_ci   - Renderbuffers
29e5c31af7Sopenharmony_ci   - Framebuffers
30e5c31af7Sopenharmony_ci   - Shaders
31e5c31af7Sopenharmony_ci   - Programs
32e5c31af7Sopenharmony_ci + Object existence tests based on Is* queries
33e5c31af7Sopenharmony_ci   - After calling Gen* or Create*
34e5c31af7Sopenharmony_ci   - After calling Gen* or Create*, then Delete*
35e5c31af7Sopenharmony_ci   - After calling Gen*, then Bind*
36e5c31af7Sopenharmony_ci   - After calling Gen*, then Bind*, then Delete*
37e5c31af7Sopenharmony_ci   - After calling Bind* without preceding Gen*
38e5c31af7Sopenharmony_ci   - After calling CreateProgram, then UseProgram, then DeleteProgram
39e5c31af7Sopenharmony_ci + Tests for deleting an object that is attached to a container
40e5c31af7Sopenharmony_ci   - Is* queries for the name of the deleted object
41e5c31af7Sopenharmony_ci   - Reading from the container
42e5c31af7Sopenharmony_ci   - Writing to the container
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_ciExcludes:
45e5c31af7Sopenharmony_ci + Deleting an object that is currently bound in another context
46e5c31af7Sopenharmony_ci
47e5c31af7Sopenharmony_ciDescription:
48e5c31af7Sopenharmony_ci
49e5c31af7Sopenharmony_ciThese tests check that creation and deletion of objects adheres to the
50e5c31af7Sopenharmony_ciOpenGL ES 2.0 specification. The tests check the existence of objects as
51e5c31af7Sopenharmony_cireported by the Is* family of GL functions, the state of bindings as
52e5c31af7Sopenharmony_cireported in various state variables, and the behavior of containers with
53e5c31af7Sopenharmony_cideleted objects.
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ciNOTE: Because these tests try to delete objects that are directly or
56e5c31af7Sopenharmony_ciindirectly attached to the current context, a faulty OpenGL ES
57e5c31af7Sopenharmony_ciimplementation may reclaim and later reallocate memory that is still
58e5c31af7Sopenharmony_cibeing referenced. This may result in unpredictable errors at some later
59e5c31af7Sopenharmony_citime. Use of external memory debugging tools may be required to
60e5c31af7Sopenharmony_ciaccurately identify these errors.
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ciThe "gen.*" test cases call the object type's Gen* or Create* function
63e5c31af7Sopenharmony_cito allocate a new name, and then check whether the name is used, i.e.
64e5c31af7Sopenharmony_ciwhether a new object was created for the name (as reported by the result
65e5c31af7Sopenharmony_ciof the corresponding Is* function). In OpenGL ES 2.0, the Gen* functions
66e5c31af7Sopenharmony_cimust never create an object, and the Create* functions must always
67e5c31af7Sopenharmony_cicreate an object.
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ciThe "delete.*" test cases call an object type's Gen* or Create* function
70e5c31af7Sopenharmony_cifollowed by the Delete* function. They then check that the generated
71e5c31af7Sopenharmony_ciname is no longer in use.
72e5c31af7Sopenharmony_ci
73e5c31af7Sopenharmony_ciThe "bind.*" test cases call an object type's Gen* function followed by
74e5c31af7Sopenharmony_ciits Bind* function. They then check that the name is in use.
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ciThe "delete_bound.*" test cases call an object type's Gen* function
77e5c31af7Sopenharmony_cifollowed by its Bind* function and Delete* function. They then check
78e5c31af7Sopenharmony_cithat the name is no longer in use and that the binding has been removed.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ciThe "bind_no_gen.*" test cases call the object type's Bind* function for
81e5c31af7Sopenharmony_cia random name that has not been produced by the Gen* function. They then
82e5c31af7Sopenharmony_cicheck whether the function call succeeded. In OpenGL ES 2.0, all Bind*
83e5c31af7Sopenharmony_cicalls must succeed even for names not produced by the Gen* function.
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ciThe "delete_used.program" test case creates a new program object (along
86e5c31af7Sopenharmony_ciwith associated shader objects) and makes it the current program with
87e5c31af7Sopenharmony_cithe glUseProgram function. The program object is then deleted. The test
88e5c31af7Sopenharmony_cichecks that the name of the program remains in use and is flagged for
89e5c31af7Sopenharmony_cideletion. Then the program is made non-current and the test checks that
90e5c31af7Sopenharmony_cithe name becomes unused.
91e5c31af7Sopenharmony_ci
92e5c31af7Sopenharmony_ciThe "attach.*" family of test cases create a container object (a
93e5c31af7Sopenharmony_ciframebuffer or a program) and attach another object (a texture,
94e5c31af7Sopenharmony_cirenderbuffer or shader) to it. The attached object is then deleted.
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ciIn the "attach.deleted_name.*" test cases, the container is queried for
97e5c31af7Sopenharmony_ciits attachment, and the existence of the deleted attachment object is
98e5c31af7Sopenharmony_cichecked. In OpenGL ES 2.0, shader objects must exist even after deletion
99e5c31af7Sopenharmony_ciif they are attached to a program. The names of other types of
100e5c31af7Sopenharmony_ciattachment objects must become unused, even though their state still
101e5c31af7Sopenharmony_ciremains referenced by the container.
102e5c31af7Sopenharmony_ci
103e5c31af7Sopenharmony_ciIn the "attach.deleted_input.*" test cases, the container is read from
104e5c31af7Sopenharmony_ci(by reading a framebuffer's pixel contents or using a program for
105e5c31af7Sopenharmony_cidrawing) before the attachment is deleted, and then after deleting the
106e5c31af7Sopenharmony_ciattachment and creating a new object of the attachment type. If the
107e5c31af7Sopenharmony_ciresults differ, the new object erroneously affected the container's
108e5c31af7Sopenharmony_cistate.
109e5c31af7Sopenharmony_ci
110e5c31af7Sopenharmony_ciIn the "attach.deleted_output.*" test cases, the container is written to
111e5c31af7Sopenharmony_ci(by drawing to a framebuffer) after deleting the attachment and creating
112e5c31af7Sopenharmony_cia new object of the attachment type. If the writing affected the new
113e5c31af7Sopenharmony_ciobject state, it erroneously shared state with the deleted attachment.
114