1*35238bceSAndroid Build Coastguard Worker------------------------------------------------------------------------- 2*35238bceSAndroid Build Coastguard WorkerdrawElements Quality Program Test Specification 3*35238bceSAndroid Build Coastguard Worker----------------------------------------------- 4*35238bceSAndroid Build Coastguard Worker 5*35238bceSAndroid Build Coastguard WorkerCopyright 2014 The Android Open Source Project 6*35238bceSAndroid Build Coastguard Worker 7*35238bceSAndroid Build Coastguard WorkerLicensed under the Apache License, Version 2.0 (the "License"); 8*35238bceSAndroid Build Coastguard Workeryou may not use this file except in compliance with the License. 9*35238bceSAndroid Build Coastguard WorkerYou may obtain a copy of the License at 10*35238bceSAndroid Build Coastguard Worker 11*35238bceSAndroid Build Coastguard Worker http://www.apache.org/licenses/LICENSE-2.0 12*35238bceSAndroid Build Coastguard Worker 13*35238bceSAndroid Build Coastguard WorkerUnless required by applicable law or agreed to in writing, software 14*35238bceSAndroid Build Coastguard Workerdistributed under the License is distributed on an "AS IS" BASIS, 15*35238bceSAndroid Build Coastguard WorkerWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16*35238bceSAndroid Build Coastguard WorkerSee the License for the specific language governing permissions and 17*35238bceSAndroid Build Coastguard Workerlimitations under the License. 18*35238bceSAndroid Build Coastguard Worker------------------------------------------------------------------------- 19*35238bceSAndroid Build Coastguard Worker Performance tests 20*35238bceSAndroid Build Coastguard Worker 21*35238bceSAndroid Build Coastguard WorkerThis test specification describes general techniques and methodologies used 22*35238bceSAndroid Build Coastguard Workerin performance test cases. 23*35238bceSAndroid Build Coastguard Worker 24*35238bceSAndroid Build Coastguard Worker 25*35238bceSAndroid Build Coastguard WorkerMeasuring performance: 26*35238bceSAndroid Build Coastguard Worker 27*35238bceSAndroid Build Coastguard WorkerPerformance test cases must satisfy following conditions: 28*35238bceSAndroid Build Coastguard Worker 29*35238bceSAndroid Build Coastguard Worker + Result should represent the performance of the tested feature or use case. 30*35238bceSAndroid Build Coastguard Worker - Use of any other features should be kept at minimum. 31*35238bceSAndroid Build Coastguard Worker - Architecture-specific optimizations should not affect result unless they 32*35238bceSAndroid Build Coastguard Worker target the feature being tested. 33*35238bceSAndroid Build Coastguard Worker - Measurement overhead should be minimized. 34*35238bceSAndroid Build Coastguard Worker 35*35238bceSAndroid Build Coastguard Worker + Hardware must be utilized to the maximum. 36*35238bceSAndroid Build Coastguard Worker - In most cases total throughput is more important than latency. 37*35238bceSAndroid Build Coastguard Worker - Latency is measured where it matters. 38*35238bceSAndroid Build Coastguard Worker - Test cases should behave like other graphics-intensive applications on 39*35238bceSAndroid Build Coastguard Worker that platform. This usually means that test cases should render multiple 40*35238bceSAndroid Build Coastguard Worker frames and utilize platform-defined standard mechanisms to display each 41*35238bceSAndroid Build Coastguard Worker frame on screen. 42*35238bceSAndroid Build Coastguard Worker 43*35238bceSAndroid Build Coastguard Worker + Test result should be stable across test runs. 44*35238bceSAndroid Build Coastguard Worker - Final result should be a function of results from multiple iterations if 45*35238bceSAndroid Build Coastguard Worker performance is expected to vary between iterations (due to undeterministic 46*35238bceSAndroid Build Coastguard Worker scheduling for example). 47*35238bceSAndroid Build Coastguard Worker - Simple average may not always be the right function, often stability of 48*35238bceSAndroid Build Coastguard Worker the performance is more important from user experience perspective. 49*35238bceSAndroid Build Coastguard Worker 50*35238bceSAndroid Build Coastguard Worker + Test result values should be meaningful. 51*35238bceSAndroid Build Coastguard Worker - Result should be meaningful without knowing the exact implementation 52*35238bceSAndroid Build Coastguard Worker details of the test case. 53*35238bceSAndroid Build Coastguard Worker - Good example: Millions of pixels or vertices with shader X per second 54*35238bceSAndroid Build Coastguard Worker - Bad example: Frames per second 55*35238bceSAndroid Build Coastguard Worker 56*35238bceSAndroid Build Coastguard Worker + Results can be compared across different implementations and configurations. 57*35238bceSAndroid Build Coastguard Worker - If possible, configuration changes (viewport size for example) should not 58*35238bceSAndroid Build Coastguard Worker affect the test result. 59*35238bceSAndroid Build Coastguard Worker - Where configuration may affect the result, test log should include the 60*35238bceSAndroid Build Coastguard Worker configuration details. 61*35238bceSAndroid Build Coastguard Worker 62*35238bceSAndroid Build Coastguard Worker 63*35238bceSAndroid Build Coastguard WorkerTest output: 64*35238bceSAndroid Build Coastguard Worker 65*35238bceSAndroid Build Coastguard WorkerTest cases will log at least following variables, if available: 66*35238bceSAndroid Build Coastguard Worker 67*35238bceSAndroid Build Coastguard Worker * Viewport size 68*35238bceSAndroid Build Coastguard Worker * Color, depth, stencil and multisample bits 69*35238bceSAndroid Build Coastguard Worker * Number of draw calls 70*35238bceSAndroid Build Coastguard Worker * Shader program source 71*35238bceSAndroid Build Coastguard Worker * Automatic calibration values 72*35238bceSAndroid Build Coastguard Worker * Individual iteration times (if iteration count is reasonable) 73*35238bceSAndroid Build Coastguard Worker * Minimum and maximum iteration times 74*35238bceSAndroid Build Coastguard Worker * Average iteration time 75*35238bceSAndroid Build Coastguard Worker * Minimum and maximum computed performance 76*35238bceSAndroid Build Coastguard Worker * Average computed performance 77*35238bceSAndroid Build Coastguard Worker 78*35238bceSAndroid Build Coastguard Worker 79*35238bceSAndroid Build Coastguard WorkerShader execution tests: 80*35238bceSAndroid Build Coastguard Worker 81*35238bceSAndroid Build Coastguard WorkerShader execution tests measure the performance of single pair of vertex and 82*35238bceSAndroid Build Coastguard Workerfragment shaders, optionally combined with fixed-function per-fragment 83*35238bceSAndroid Build Coastguard Workeroperations such as blending. 84*35238bceSAndroid Build Coastguard Worker 85*35238bceSAndroid Build Coastguard WorkerEach iteration (frame) renders N grids of quads. Each grid, drawn with single 86*35238bceSAndroid Build Coastguard Workerdraw call, fills the screen entirely without any overlap between quads. 87*35238bceSAndroid Build Coastguard WorkerThe number of quads depends on targeted vertex load. Test cases targeting 88*35238bceSAndroid Build Coastguard Workerfragment shaders only use a single quad. N (number of times screen is filled) 89*35238bceSAndroid Build Coastguard Workeris chosen either automatically to target certain iteration time or specified 90*35238bceSAndroid Build Coastguard Workerby the test case explicitly. 91*35238bceSAndroid Build Coastguard Worker 92*35238bceSAndroid Build Coastguard WorkerTest cases that measure fragment-side performance must make sure fragments 93*35238bceSAndroid Build Coastguard Workerare not discarded early due to Z-culling or any other optimization. The 94*35238bceSAndroid Build Coastguard Workerpreferred way to do this is to enable simple additive blending. The extra 95*35238bceSAndroid Build Coastguard Workercost of that is one read from the framebuffer and per-channel saturating 96*35238bceSAndroid Build Coastguard Workeradditions. 97*35238bceSAndroid Build Coastguard Worker 98*35238bceSAndroid Build Coastguard WorkerThe result is MPix/s, MVert/s or weighted sum of both depending on test 99*35238bceSAndroid Build Coastguard Workercase type. 100