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