1 ------------------------------------------------------------------------- 2 drawElements Quality Program Test Specification 3 ----------------------------------------------- 4 5 Copyright 2014 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 ------------------------------------------------------------------------- 19 GL 3 conditional render 20 21 Tests: 22 + dEQP-GL3.functional.conditional_render.* 23 24 Includes: 25 + All valid rendering commands included/excluded by query 26 - DrawArrays 27 - DrawArraysInstanced 28 - MultiDrawArrays 29 30 - DrawElements 31 - DrawElementsInstanced 32 - DrawElementsInstancedBaseVertex 33 - DrawElementsBaseVertex 34 - DrawRangeElements 35 - DrawRangeElementsBaseVertex 36 - MultiDrawElements 37 - MultiDrawElementsBaseVertex 38 - Clear 39 - ClearBuffer* 40 + All depth comparison modes 41 + Framebuffer swap between query & render 42 - Excluding BY_REGION query modes 43 + All modes 44 - QUERY_(BY_REGION_)(NO_)WAIT 45 + Dependent queries 46 47 Excludes: 48 + Immediate mode rendering 49 + Primitives other than triangles 50 + Negative tests 51 + Tests for NO_WAIT and BY_REGION modes are very limited 52 53 Description: 54 55 Conditional rendering is tested with various depth function/primitive 56 overlap conditions. Each query test renders a scene with one conditional 57 render call and verifies the result against the same scene with the 58 previously GL controlled conditional render call controlled by the test. 59 60 Draw calls (excluding clears) are tested with the same method, with the 61 conditional call indicated by the test name. The occlusion query used in 62 these tests is trivially true/false. 63 64 Clears are tested by rendering some geometry for an occlusion query and then 65 conditionally clearing the framebuffer. The verification used depends on the 66 expected result of the occlusion query. If the query is expected to pass, the 67 framebuffer is verified to contain only the color it was cleared to. 68 Otherwise the contents of the framebuffer are verified to match its contents 69 before the conditional clear. 70 71 Depth/stencil clear tests unconditionally clear the color buffer after 72 rendering the occlusion geometry. After the conditional depth/stencil clear 73 a full framebuffer triangle is rendered with depth/stencil tests setup 74 to pass if the clear took place. The resulting framebuffer is read out and 75 compared to the color of the intermediate clear or the filling triangle as 76 appropriate for the expected occlusion query result. 77 78 All clear tests use non-default framebuffers, all others use the default. 79 80 Framebuffer swap cases use a trivial occlusion query but change the bound 81 (read & write) FBO between the occludion query and the conditional rendering. 82 The occlusion query is performed with the default framebuffer. 83 84 Wait mode test render geometry that is not dependent on the result of the 85 occlusion queries. These tests thus only test for false positive occlusion 86 query results. 87 88 Dependent queries render a number of primitives where each conditionally 89 rendered primitive (excluding the first) is also used for an occlusion query 90 that controls the rendering of the next primitive, which in turn is used for 91 the next occlusion query and so on. In some of these test one primitive in 92 this chain is placed in an occluded location, starting a cascade of failing 93 occlusion queries. 94