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 Shader compiler performance tests 20*35238bceSAndroid Build Coastguard Worker 21*35238bceSAndroid Build Coastguard WorkerTests: 22*35238bceSAndroid Build Coastguard Worker + dEQP-GLES2.performance.compiler.* 23*35238bceSAndroid Build Coastguard Worker 24*35238bceSAndroid Build Coastguard WorkerIncludes: 25*35238bceSAndroid Build Coastguard Worker + Shader compile, link and specialization (draw call -time) time measurements 26*35238bceSAndroid Build Coastguard Worker + Tests for impact of cache hits on compilation time (note: in release 2012.4) 27*35238bceSAndroid Build Coastguard Worker + Front-end time estimation with invalid shaders 28*35238bceSAndroid Build Coastguard Worker + Typical use cases 29*35238bceSAndroid Build Coastguard Worker - Vertex and fragment lighting 30*35238bceSAndroid Build Coastguard Worker - Mandelbrot viewer 31*35238bceSAndroid Build Coastguard Worker - Normal mapping, parallax and relief mapping (note: in release 2012.4) 32*35238bceSAndroid Build Coastguard Worker + Synthetic cases 33*35238bceSAndroid Build Coastguard Worker - A number of texture lookups blended together in fragment shader 34*35238bceSAndroid Build Coastguard Worker - Single or nested loops 35*35238bceSAndroid Build Coastguard Worker - Single expression consisting of a variable number of vec4 multiplications 36*35238bceSAndroid Build Coastguard Worker + Shaders designed to stress compiler (note: in release 2012.4) 37*35238bceSAndroid Build Coastguard Worker - High register pressure 38*35238bceSAndroid Build Coastguard Worker - Lots of control flow 39*35238bceSAndroid Build Coastguard Worker 40*35238bceSAndroid Build Coastguard WorkerExcludes: 41*35238bceSAndroid Build Coastguard Worker + Shader functional testing 42*35238bceSAndroid Build Coastguard Worker 43*35238bceSAndroid Build Coastguard WorkerDescription: 44*35238bceSAndroid Build Coastguard Worker 45*35238bceSAndroid Build Coastguard WorkerShader compiler performance tests measure the time to compile GLSL shader programs. 46*35238bceSAndroid Build Coastguard WorkerThe tests will take into account implementations that postpone final compilation 47*35238bceSAndroid Build Coastguard Workeruntil execution of a draw call. 48*35238bceSAndroid Build Coastguard Worker 49*35238bceSAndroid Build Coastguard WorkerSeparate cases are made for testing compilation time when avoiding cache hits and 50*35238bceSAndroid Build Coastguard Workerwhen allowing them (note that tests that allow cache will be in release 2012.4). 51*35238bceSAndroid Build Coastguard WorkerCache-avoiding cases use a different shader for different iterations of the same 52*35238bceSAndroid Build Coastguard Workertest case, whereas cache-allowing cases use the same shader for all iterations. 53*35238bceSAndroid Build Coastguard WorkerCache hits are however only ever allowed between the iterations of a case and not 54*35238bceSAndroid Build Coastguard Workeracross separate cases. 55*35238bceSAndroid Build Coastguard Worker 56*35238bceSAndroid Build Coastguard WorkerThe method for defeating the shader cache is to append a postfix to all uniform, 57*35238bceSAndroid Build Coastguard Workerattribute and varying names. The postfix depends on the current time as well as 58*35238bceSAndroid Build Coastguard Workerthe case that is in question. In case of cache-avoiding cases, the postfix also 59*35238bceSAndroid Build Coastguard Workerdepends on the current iteration. This method forces at least re-linking. 60*35238bceSAndroid Build Coastguard Worker 61*35238bceSAndroid Build Coastguard WorkerFront-end time is estimated by compiling invalid shaders with either an invalid 62*35238bceSAndroid Build Coastguard Workercharacter at the end of the shader or an invalid statement at the end of the main() 63*35238bceSAndroid Build Coastguard Workerblock. 64*35238bceSAndroid Build Coastguard Worker 65*35238bceSAndroid Build Coastguard WorkerThe result value is the average number of milliseconds used per test case 66*35238bceSAndroid Build Coastguard Workeriteration. In cases that allow cache hits the average excludes the first 67*35238bceSAndroid Build Coastguard Workercompilation. 68*35238bceSAndroid Build Coastguard Worker 69*35238bceSAndroid Build Coastguard WorkerBefore any measurements are done, each test case first draws with a simple dummy 70*35238bceSAndroid Build Coastguard Workershader for warm-up. 71*35238bceSAndroid Build Coastguard Worker 72*35238bceSAndroid Build Coastguard WorkerOverview for valid shader cases: 73*35238bceSAndroid Build Coastguard Worker - 1. Create program and shaders; compile and link 74*35238bceSAndroid Build Coastguard Worker - 2. Set inputs and draw a small quad 75*35238bceSAndroid Build Coastguard Worker - 3. Flush 76*35238bceSAndroid Build Coastguard Worker - 4. Repeat without step 1 77*35238bceSAndroid Build Coastguard Worker - 5. Compute difference of times measured for 1-3 and 4 and record it as 78*35238bceSAndroid Build Coastguard Worker compilation time 79*35238bceSAndroid Build Coastguard Worker - Repeat the above steps several times and compute average 80*35238bceSAndroid Build Coastguard Worker 81*35238bceSAndroid Build Coastguard WorkerOverview for invalid shader cases (front-end time estimation): 82*35238bceSAndroid Build Coastguard Worker - 1. Create program and invalid shaders; compile (expect failure) 83*35238bceSAndroid Build Coastguard Worker - 2. Record time measured for step 1 84*35238bceSAndroid Build Coastguard Worker - Repeat the above steps several times and compute average 85