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 Sample shading tests 20*35238bceSAndroid Build Coastguard Worker 21*35238bceSAndroid Build Coastguard WorkerTests: 22*35238bceSAndroid Build Coastguard Worker + dEQP-GLES31.functional.sample_shading 23*35238bceSAndroid Build Coastguard Worker 24*35238bceSAndroid Build Coastguard WorkerIncludes: 25*35238bceSAndroid Build Coastguard Worker + Visual verification of OES_sample_shading 26*35238bceSAndroid Build Coastguard Worker - per sample color 27*35238bceSAndroid Build Coastguard Worker - per sample discard 28*35238bceSAndroid Build Coastguard Worker + State queries 29*35238bceSAndroid Build Coastguard Worker 30*35238bceSAndroid Build Coastguard WorkerExcludes: 31*35238bceSAndroid Build Coastguard Worker + Rendering to every supported render buffer sample count / format 32*35238bceSAndroid Build Coastguard Worker + Rendering to every supported multisample texture sample count / format 33*35238bceSAndroid Build Coastguard Worker 34*35238bceSAndroid Build Coastguard WorkerDescription: 35*35238bceSAndroid Build Coastguard Worker 36*35238bceSAndroid Build Coastguard Workerstate_query.* tests verify that the state returned by different query functions 37*35238bceSAndroid Build Coastguard Workeris valid. state_query.min_sample_shading_value_clamping test verifies 38*35238bceSAndroid Build Coastguard WorkerMIN_SAMPLE_SHADING state is clamped when it is specified with glMinSampleShading 39*35238bceSAndroid Build Coastguard Workerfunction. 40*35238bceSAndroid Build Coastguard Worker 41*35238bceSAndroid Build Coastguard Workermin_sample_shading.* tests render a high frequency pattern with different 42*35238bceSAndroid Build Coastguard WorkerMIN_SAMPLE_SHADING values. *_color cases render pattern by rendering black or 43*35238bceSAndroid Build Coastguard Workerwhite in the fragment shader depending on the pattern function sign. *_discard 44*35238bceSAndroid Build Coastguard Workercases render pattern by the clearing image to black, outputting white in the 45*35238bceSAndroid Build Coastguard Workerfragment shader, and discarding the fragment if function sign is negative. Each 46*35238bceSAndroid Build Coastguard Workertest iteration sets MIN_SAMPLE_SHADING_VALUE to guarantee a certain number of 47*35238bceSAndroid Build Coastguard Workerindividual samples and draws the pattern. 48*35238bceSAndroid Build Coastguard Worker 49*35238bceSAndroid Build Coastguard WorkerAveraging N uniformly random binary values (pattern output function) and 50*35238bceSAndroid Build Coastguard Workeraveraging them will result in a discrete normal-like distribution. The number of 51*35238bceSAndroid Build Coastguard Workersamples N can now be calculated from the distribution with: the number of 52*35238bceSAndroid Build Coastguard Workerdistinct points with non-zero probability - 1. A sufficiently high frequency 53*35238bceSAndroid Build Coastguard Workerfunction is assumed to have similar effect to the uniform random. Hence, if the 54*35238bceSAndroid Build Coastguard Workernumber of different shades in the result image is less or equal to the 55*35238bceSAndroid Build Coastguard Workerguaranteed sample count, the pixels did not contain the guaranteed amount of 56*35238bceSAndroid Build Coastguard Workerindependent samples, i.e. result image is invalid. 57*35238bceSAndroid Build Coastguard Worker 58*35238bceSAndroid Build Coastguard WorkerSince the tests analyze the resolved multisample image when rendering to the 59*35238bceSAndroid Build Coastguard Workerdefault framebuffer or to a renderbuffer, implementations that do not resolve 60*35238bceSAndroid Build Coastguard Workermultisample buffers with a box filter (simple average) may result in false 61*35238bceSAndroid Build Coastguard Workerpositives. False positive may occur if distinct pixels with identical filter 62*35238bceSAndroid Build Coastguard Workersample coverage ratios can be mapped to distinct values. Tests rendering to a 63*35238bceSAndroid Build Coastguard Workermultisample texture do not use an implementation defined multisample resolution 64*35238bceSAndroid Build Coastguard Workerand thus do not produce false positives. 65