1 ------------------------------------------------------------------------- 2 drawElements Quality Program Test Specification 3 ----------------------------------------------- 4 5 Copyright 2014 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 ------------------------------------------------------------------------- 19 Basic tessellation tests 20 21 Tests: 22 + dEQP-GLES31.functional.tessellation.* 23 24 Includes: 25 + Tessellation UVW coordinate verification 26 - Coordinates read with transform feedback (with point_mode) 27 - Triangles, quads, isolines 28 - equal_spacing 29 - fractional_odd_spacing and fractional_even_spacing with tessellation 30 levels chosen so that results are not implementation-dependent 31 + Separate verification of fractional spacing modes 32 + Winding modes (cw, ccw) 33 + Built-in inputs and outputs and basic data transfer between TCS and TES 34 - Read gl_PrimitiveID, gl_PatchVerticesIn in both TCS and TES 35 - Read gl_TessLevelInner[] and gl_TessLevelOuter[] in TES 36 - Differing input and output patch sizes 37 - Pass data in (gl_in/gl_out []) .gl_Position between VS, TCS and TES 38 - Basic barrier usage 39 + Rendering result sanity verification 40 - Check for no obvious gaps or overlaps in tessellation triangulation for 41 quads and triangles modes 42 - Isolines rendering 43 + Test for absence of cracks at shared edges of primitives 44 - Use either the 'precise' qualifier or carefully chosen primitive 45 orientations 46 + Test that patches are discarded when appropriate 47 + Invariance rule testing 48 + Passing per-patch and per-vertex simple and aggregate user-defined data 49 from TCS to TES 50 - Arrays, structs and interface blocks 51 - Omit vertex IO array size expression, or use gl_MaxPatchVertices or 52 an integer literal (queried from GL_MAX_PATCH_VERTICES) 53 54 Excludes: 55 + Complete checking of validity of the filling triangles in the triangles and 56 quads modes 57 + Negative testing 58 59 Description: 60 61 The tessellation test group contains various cases testing basic tessellation 62 shader functionality. 63 64 The tessellation coordinate (gl_TessCoord) verification cases draw the vertices 65 of a tessellated "triangles", "quads" or "isolines" shape using the 66 "point_mode" input layout qualifier in the tessellation evaluation shader (TES). 67 The vertices are read with transform feedback, and the results are compared to a 68 point set generated by a reference tessellation vertex generator, verifying that 69 for each point in the reference set, there is an approximately equal point in 70 the GL-generated set, and vice versa. There is a small difference allowed in all 71 comparisons, and thus not all rules are exactly verified (such as 72 x + (1.0-x) == 1.0 for a given uvw coordinate x). The cases draw multiple times 73 with different tessellation levels. 74 75 The tests for the fractional spacing modes (fractional_odd_spacing, 76 fractional_even_spacing) draw multiple simple isolines (with point_mode), each 77 resulting in a row of vertices. These vertices are read with transform feedback 78 and their x coordinates are inspected to see whether the edge is split into 79 valid segments. The conditions for the amount, length and location of the two 80 "additional segments", as laid out in the specification, are checked. The 81 segment sets produced by different isolines are also compared to each other to 82 determine whether the implementation fulfills the requirement of monotonic 83 segment length growth, and the requirement that two edges with identical clamped 84 tessellation levels have identically-located segments. 85 86 The winding mode cases draw triangles or quads with a specific winding mode 87 ("cw" or "ccw") input layout qualifier in the TES. Back face culling is enabled. 88 Each case draws two times, with glFrontFace(GL_CCW) and glFrontFace(GL_CW), and 89 verifies that the primitive is drawn iff the glFrontFace value matches the 90 winding mode specified in the TES. The patterns drawn are simple and verified by 91 counting background-colored and non-background-colored pixels. 92 93 The cases testing gl_PrimitiveID and gl_PatchVerticesIn read the variable in 94 either TCS or TES; the TCS cases pass the value as a "patch out" output to the 95 TES. For the gl_PrimitiveID cases, multiple primitives are drawn and one of 96 them, with gl_PrimitiveID matching a specific value, is drawn with a differing 97 color; for the gl_PatchVerticesIn cases, just one primitive is drawn and the 98 value of gl_PatchVerticesIn is verified. The "quads" mode is used. 99 100 The gl_TessLevelInner[] and gl_TessLevelOuter[] cases simply verify that reading 101 the value of a tessellation level in the TES gives the value set in the TCS. The 102 arrays are indexed with literals. The "quads" mode is used. 103 104 The cases testing differing input and output patch sizes draw a simple shape 105 using an output patch size either less or greater than the input patch size. The 106 "quads" mode is used. 107 108 The barrier case uses both per-patch and per-vertex TCS output variables, 109 doing simple assignments and reads with them in different barrier()-separated 110 stages. The "quads" mode is used. 111 112 For the above-mentioned cases, the gl_PrimitiveID cases, the barrier case, and 113 the cases with differing input and output patch sizes are verified with 114 comparisons to pre-computed reference images; the gl_PatchVerticesIn and 115 gl_TessLevel*[] cases draw simple all-white patterns and are verified as such. 116 117 The basic rendering cases for the "triangles" and "quads" modes contain two 118 types of cases: cases testing that there are no obvious gaps in the 119 triangle-filled area, and cases testing that there are no overlaps between 120 triangles of differing inner layers of the tessellated primitive. The gap cases 121 draw a single primitive deformed so as to reveal possible errors in the 122 triangulation. The overlap cases draw a single primitive with different colors 123 for different concentric triangles (for the "triangles" mode) or concentric 124 rectangles (for the "quads" mode); the coloring is done so as to make it visible 125 if a fill-triangle spans between inappropriate inner triangles or rectangles. 126 Basic cases verifying the rendering results of isolines also exist; the cases 127 draw curly isolines with different colors for different vertices. 128 The above cases are repeated for different spacing modes. The results of the 129 rendering cases are compared to pre-computed reference images. 130 131 The shared-edge cases draw multiple primitives (with the "triangles" or "quads" 132 mode) that have shared edges, and check that no cracks appear at the edges. For 133 each pair of primitives sharing an edge, that edge has the same tessellation 134 level for both primitives. The primitives are deformed in the TES so that 135 potential cracks are likely to become visible. The resulting image is verified 136 by checking that no pixel (inside a fixed rectangle) remains uncovered by a 137 primitive. Two variants exist, with different methods for avoiding cracks: 138 either the 'precise' qualifier is used in the tessellation shaders, or input 139 patches are generated in a way that causes each shared vertex to have the same 140 index in all the primitives it belongs to. 141 142 The patch-discarding tests draw multiple patches in one draw call, with 143 different combinations for tessellation levels; some of these patches contain 144 relevant outer tessellation levels with a negative or zero value; they should 145 be discarded. Verification is done firstly by a sanity check that the number of 146 vertices returned by transform feedback is correct, and secondly by checking 147 that white primitives exist in the area where non-discarded primitives are 148 drawn, and only there. 149 150 The invariance tests target the 8 invariance rules laid out in the 151 specification. They render one or more primitives with various tessellation 152 levels and/or programs with different configurations, read the primitives with 153 transform feedback, and do appropriate comparisons or other validation. 154 155 The tessellation coordinate generation is somewhat implementation-dependent when 156 using a fractional spacing mode and a tessellation level that isn't already 157 properly rounded. In many of the cases using a spacing mode other than 158 equal_spacing, the tessellation levels are chosen in a way that makes the 159 results non-implementation-dependent. 160 161 The exact manner in which a "triangles" or "quads" primitive is divided into 162 triangles is also implementation-dependent and is not thoroughly tested. 163 164 More complete checking of final triangle generation are possible candidates for 165 future tests. 166