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