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    Performance tests
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ciThis test specification describes general techniques and methodologies used
22e5c31af7Sopenharmony_ciin performance test cases.
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci
25e5c31af7Sopenharmony_ciMeasuring performance:
26e5c31af7Sopenharmony_ci
27e5c31af7Sopenharmony_ciPerformance test cases must satisfy following conditions:
28e5c31af7Sopenharmony_ci
29e5c31af7Sopenharmony_ci + Result should represent the performance of the tested feature or use case.
30e5c31af7Sopenharmony_ci   - Use of any other features should be kept at minimum.
31e5c31af7Sopenharmony_ci   - Architecture-specific optimizations should not affect result unless they
32e5c31af7Sopenharmony_ci     target the feature being tested.
33e5c31af7Sopenharmony_ci   - Measurement overhead should be minimized.
34e5c31af7Sopenharmony_ci
35e5c31af7Sopenharmony_ci + Hardware must be utilized to the maximum.
36e5c31af7Sopenharmony_ci   - In most cases total throughput is more important than latency.
37e5c31af7Sopenharmony_ci   - Latency is measured where it matters.
38e5c31af7Sopenharmony_ci   - Test cases should behave like other graphics-intensive applications on
39e5c31af7Sopenharmony_ci     that platform. This usually means that test cases should render multiple
40e5c31af7Sopenharmony_ci	 frames and utilize platform-defined standard mechanisms to display each
41e5c31af7Sopenharmony_ci	 frame on screen.
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ci + Test result should be stable across test runs.
44e5c31af7Sopenharmony_ci   - Final result should be a function of results from multiple iterations if
45e5c31af7Sopenharmony_ci     performance is expected to vary between iterations (due to undeterministic
46e5c31af7Sopenharmony_ci     scheduling for example).
47e5c31af7Sopenharmony_ci   - Simple average may not always be the right function, often stability of
48e5c31af7Sopenharmony_ci     the performance is more important from user experience perspective.
49e5c31af7Sopenharmony_ci
50e5c31af7Sopenharmony_ci + Test result values should be meaningful.
51e5c31af7Sopenharmony_ci   - Result should be meaningful without knowing the exact implementation
52e5c31af7Sopenharmony_ci     details of the test case.
53e5c31af7Sopenharmony_ci   - Good example: Millions of pixels or vertices with shader X per second
54e5c31af7Sopenharmony_ci   - Bad example: Frames per second
55e5c31af7Sopenharmony_ci
56e5c31af7Sopenharmony_ci + Results can be compared across different implementations and configurations.
57e5c31af7Sopenharmony_ci   - If possible, configuration changes (viewport size for example) should not
58e5c31af7Sopenharmony_ci	 affect the test result.
59e5c31af7Sopenharmony_ci   - Where configuration may affect the result, test log should include the
60e5c31af7Sopenharmony_ci	 configuration details.
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ci
63e5c31af7Sopenharmony_ciTest output:
64e5c31af7Sopenharmony_ci
65e5c31af7Sopenharmony_ciTest cases will log at least following variables, if available:
66e5c31af7Sopenharmony_ci
67e5c31af7Sopenharmony_ci * Viewport size
68e5c31af7Sopenharmony_ci * Color, depth, stencil and multisample bits
69e5c31af7Sopenharmony_ci * Number of draw calls
70e5c31af7Sopenharmony_ci * Shader program source
71e5c31af7Sopenharmony_ci * Automatic calibration values
72e5c31af7Sopenharmony_ci * Individual iteration times (if iteration count is reasonable)
73e5c31af7Sopenharmony_ci * Minimum and maximum iteration times
74e5c31af7Sopenharmony_ci * Average iteration time
75e5c31af7Sopenharmony_ci * Minimum and maximum computed performance
76e5c31af7Sopenharmony_ci * Average computed performance
77e5c31af7Sopenharmony_ci
78e5c31af7Sopenharmony_ci
79e5c31af7Sopenharmony_ciShader execution tests:
80e5c31af7Sopenharmony_ci
81e5c31af7Sopenharmony_ciShader execution tests measure the performance of single pair of vertex and
82e5c31af7Sopenharmony_cifragment shaders, optionally combined with fixed-function per-fragment
83e5c31af7Sopenharmony_cioperations such as blending.
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ciEach iteration (frame) renders N grids of quads. Each grid, drawn with single
86e5c31af7Sopenharmony_cidraw call, fills the screen entirely without any overlap between quads.
87e5c31af7Sopenharmony_ciThe number of quads depends on targeted vertex load. Test cases targeting
88e5c31af7Sopenharmony_cifragment shaders only use a single quad. N (number of times screen is filled)
89e5c31af7Sopenharmony_ciis chosen either automatically to target certain iteration time or specified
90e5c31af7Sopenharmony_ciby the test case explicitly.
91e5c31af7Sopenharmony_ci
92e5c31af7Sopenharmony_ciTest cases that measure fragment-side performance must make sure fragments
93e5c31af7Sopenharmony_ciare not discarded early due to Z-culling or any other optimization. The
94e5c31af7Sopenharmony_cipreferred way to do this is to enable simple additive blending. The extra
95e5c31af7Sopenharmony_cicost of that is one read from the framebuffer and per-channel saturating
96e5c31af7Sopenharmony_ciadditions.
97e5c31af7Sopenharmony_ci
98e5c31af7Sopenharmony_ciThe result is MPix/s, MVert/s or weighted sum of both depending on test
99e5c31af7Sopenharmony_cicase type.
100