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    GL 3 conditional render
20
21Tests:
22 + dEQP-GL3.functional.conditional_render.*
23
24Includes:
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
47Excludes:
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
53Description:
54
55Conditional rendering is tested with various depth function/primitive
56overlap conditions. Each query test renders a scene with one conditional
57render call and verifies the result against the same scene with the
58previously GL controlled conditional render call controlled by the test.
59
60Draw calls (excluding clears) are tested with the same method, with the
61conditional call indicated by the test name. The occlusion query used in
62these tests is trivially true/false.
63
64Clears are tested by rendering some geometry for an occlusion query and then
65conditionally clearing the framebuffer. The verification used depends on the
66expected result of the occlusion query. If the query is expected to pass, the
67framebuffer is verified to contain only the color it was cleared to.
68Otherwise the contents of the framebuffer are verified to match its contents
69before the conditional clear.
70
71Depth/stencil clear tests unconditionally clear the color buffer after
72rendering the occlusion geometry. After the conditional depth/stencil clear
73a full framebuffer triangle is rendered with depth/stencil tests setup
74to pass if the clear took place. The resulting framebuffer is read out and
75compared to the color of the intermediate clear or the filling triangle as
76appropriate for the expected occlusion query result.
77
78All clear tests use non-default framebuffers, all others use the default.
79
80Framebuffer swap cases use a trivial occlusion query but change the bound
81(read & write) FBO between the occludion query and the conditional rendering.
82The occlusion query is performed with the default framebuffer.
83
84Wait mode test render geometry that is not dependent on the result of the
85occlusion queries. These tests thus only test for false positive occlusion
86query results.
87
88Dependent queries render a number of primitives where each conditionally
89rendered primitive (excluding the first) is also used for an occlusion query
90that controls the rendering of the next primitive, which in turn is used for
91the next occlusion query and so on. In some of these test one primitive in
92this chain is placed in an occluded location, starting a cascade of failing
93occlusion queries.
94