xref: /aosp_15_r20/external/deqp/doc/testspecs/GLES31/functional.tessellation.txt (revision 35238bce31c2a825756842865a792f8cf7f89930)
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    Basic tessellation tests
20*35238bceSAndroid Build Coastguard Worker
21*35238bceSAndroid Build Coastguard WorkerTests:
22*35238bceSAndroid Build Coastguard Worker + dEQP-GLES31.functional.tessellation.*
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard WorkerIncludes:
25*35238bceSAndroid Build Coastguard Worker + Tessellation UVW coordinate verification
26*35238bceSAndroid Build Coastguard Worker   - Coordinates read with transform feedback (with point_mode)
27*35238bceSAndroid Build Coastguard Worker   - Triangles, quads, isolines
28*35238bceSAndroid Build Coastguard Worker   - equal_spacing
29*35238bceSAndroid Build Coastguard Worker   - fractional_odd_spacing and fractional_even_spacing with tessellation
30*35238bceSAndroid Build Coastguard Worker     levels chosen so that results are not implementation-dependent
31*35238bceSAndroid Build Coastguard Worker + Separate verification of fractional spacing modes
32*35238bceSAndroid Build Coastguard Worker + Winding modes (cw, ccw)
33*35238bceSAndroid Build Coastguard Worker + Built-in inputs and outputs and basic data transfer between TCS and TES
34*35238bceSAndroid Build Coastguard Worker   - Read gl_PrimitiveID, gl_PatchVerticesIn in both TCS and TES
35*35238bceSAndroid Build Coastguard Worker   - Read gl_TessLevelInner[] and gl_TessLevelOuter[] in TES
36*35238bceSAndroid Build Coastguard Worker   - Differing input and output patch sizes
37*35238bceSAndroid Build Coastguard Worker   - Pass data in (gl_in/gl_out []) .gl_Position between VS, TCS and TES
38*35238bceSAndroid Build Coastguard Worker   - Basic barrier usage
39*35238bceSAndroid Build Coastguard Worker + Rendering result sanity verification
40*35238bceSAndroid Build Coastguard Worker   - Check for no obvious gaps or overlaps in tessellation triangulation for
41*35238bceSAndroid Build Coastguard Worker     quads and triangles modes
42*35238bceSAndroid Build Coastguard Worker   - Isolines rendering
43*35238bceSAndroid Build Coastguard Worker + Test for absence of cracks at shared edges of primitives
44*35238bceSAndroid Build Coastguard Worker   - Use either the 'precise' qualifier or carefully chosen primitive
45*35238bceSAndroid Build Coastguard Worker     orientations
46*35238bceSAndroid Build Coastguard Worker + Test that patches are discarded when appropriate
47*35238bceSAndroid Build Coastguard Worker + Invariance rule testing
48*35238bceSAndroid Build Coastguard Worker + Passing per-patch and per-vertex simple and aggregate user-defined data
49*35238bceSAndroid Build Coastguard Worker   from TCS to TES
50*35238bceSAndroid Build Coastguard Worker   - Arrays, structs and interface blocks
51*35238bceSAndroid Build Coastguard Worker   - Omit vertex IO array size expression, or use gl_MaxPatchVertices or
52*35238bceSAndroid Build Coastguard Worker     an integer literal (queried from GL_MAX_PATCH_VERTICES)
53*35238bceSAndroid Build Coastguard Worker
54*35238bceSAndroid Build Coastguard WorkerExcludes:
55*35238bceSAndroid Build Coastguard Worker + Complete checking of validity of the filling triangles in the triangles and
56*35238bceSAndroid Build Coastguard Worker   quads modes
57*35238bceSAndroid Build Coastguard Worker + Negative testing
58*35238bceSAndroid Build Coastguard Worker
59*35238bceSAndroid Build Coastguard WorkerDescription:
60*35238bceSAndroid Build Coastguard Worker
61*35238bceSAndroid Build Coastguard WorkerThe tessellation test group contains various cases testing basic tessellation
62*35238bceSAndroid Build Coastguard Workershader functionality.
63*35238bceSAndroid Build Coastguard Worker
64*35238bceSAndroid Build Coastguard WorkerThe tessellation coordinate (gl_TessCoord) verification cases draw the vertices
65*35238bceSAndroid Build Coastguard Workerof a tessellated "triangles", "quads" or "isolines" shape using the
66*35238bceSAndroid Build Coastguard Worker"point_mode" input layout qualifier in the tessellation evaluation shader (TES).
67*35238bceSAndroid Build Coastguard WorkerThe vertices are read with transform feedback, and the results are compared to a
68*35238bceSAndroid Build Coastguard Workerpoint set generated by a reference tessellation vertex generator, verifying that
69*35238bceSAndroid Build Coastguard Workerfor each point in the reference set, there is an approximately equal point in
70*35238bceSAndroid Build Coastguard Workerthe GL-generated set, and vice versa. There is a small difference allowed in all
71*35238bceSAndroid Build Coastguard Workercomparisons, and thus not all rules are exactly verified (such as
72*35238bceSAndroid Build Coastguard Workerx + (1.0-x) == 1.0 for a given uvw coordinate x). The cases draw multiple times
73*35238bceSAndroid Build Coastguard Workerwith different tessellation levels.
74*35238bceSAndroid Build Coastguard Worker
75*35238bceSAndroid Build Coastguard WorkerThe tests for the fractional spacing modes (fractional_odd_spacing,
76*35238bceSAndroid Build Coastguard Workerfractional_even_spacing) draw multiple simple isolines (with point_mode), each
77*35238bceSAndroid Build Coastguard Workerresulting in a row of vertices. These vertices are read with transform feedback
78*35238bceSAndroid Build Coastguard Workerand their x coordinates are inspected to see whether the edge is split into
79*35238bceSAndroid Build Coastguard Workervalid segments. The conditions for the amount, length and location of the two
80*35238bceSAndroid Build Coastguard Worker"additional segments", as laid out in the specification, are checked. The
81*35238bceSAndroid Build Coastguard Workersegment sets produced by different isolines are also compared to each other to
82*35238bceSAndroid Build Coastguard Workerdetermine whether the implementation fulfills the requirement of monotonic
83*35238bceSAndroid Build Coastguard Workersegment length growth, and the requirement that two edges with identical clamped
84*35238bceSAndroid Build Coastguard Workertessellation levels have identically-located segments.
85*35238bceSAndroid Build Coastguard Worker
86*35238bceSAndroid Build Coastguard WorkerThe winding mode cases draw triangles or quads with a specific winding mode
87*35238bceSAndroid Build Coastguard Worker("cw" or "ccw") input layout qualifier in the TES. Back face culling is enabled.
88*35238bceSAndroid Build Coastguard WorkerEach case draws two times, with glFrontFace(GL_CCW) and glFrontFace(GL_CW), and
89*35238bceSAndroid Build Coastguard Workerverifies that the primitive is drawn iff the glFrontFace value matches the
90*35238bceSAndroid Build Coastguard Workerwinding mode specified in the TES. The patterns drawn are simple and verified by
91*35238bceSAndroid Build Coastguard Workercounting background-colored and non-background-colored pixels.
92*35238bceSAndroid Build Coastguard Worker
93*35238bceSAndroid Build Coastguard WorkerThe cases testing gl_PrimitiveID and gl_PatchVerticesIn read the variable in
94*35238bceSAndroid Build Coastguard Workereither TCS or TES; the TCS cases pass the value as a "patch out" output to the
95*35238bceSAndroid Build Coastguard WorkerTES. For the gl_PrimitiveID cases, multiple primitives are drawn and one of
96*35238bceSAndroid Build Coastguard Workerthem, with gl_PrimitiveID matching a specific value, is drawn with a differing
97*35238bceSAndroid Build Coastguard Workercolor; for the gl_PatchVerticesIn cases, just one primitive is drawn and the
98*35238bceSAndroid Build Coastguard Workervalue of gl_PatchVerticesIn is verified. The "quads" mode is used.
99*35238bceSAndroid Build Coastguard Worker
100*35238bceSAndroid Build Coastguard WorkerThe gl_TessLevelInner[] and gl_TessLevelOuter[] cases simply verify that reading
101*35238bceSAndroid Build Coastguard Workerthe value of a tessellation level in the TES gives the value set in the TCS. The
102*35238bceSAndroid Build Coastguard Workerarrays are indexed with literals. The "quads" mode is used.
103*35238bceSAndroid Build Coastguard Worker
104*35238bceSAndroid Build Coastguard WorkerThe cases testing differing input and output patch sizes draw a simple shape
105*35238bceSAndroid Build Coastguard Workerusing an output patch size either less or greater than the input patch size. The
106*35238bceSAndroid Build Coastguard Worker"quads" mode is used.
107*35238bceSAndroid Build Coastguard Worker
108*35238bceSAndroid Build Coastguard WorkerThe barrier case uses both per-patch and per-vertex TCS output variables,
109*35238bceSAndroid Build Coastguard Workerdoing simple assignments and reads with them in different barrier()-separated
110*35238bceSAndroid Build Coastguard Workerstages. The "quads" mode is used.
111*35238bceSAndroid Build Coastguard Worker
112*35238bceSAndroid Build Coastguard WorkerFor the above-mentioned cases, the gl_PrimitiveID cases, the barrier case, and
113*35238bceSAndroid Build Coastguard Workerthe cases with differing input and output patch sizes are verified with
114*35238bceSAndroid Build Coastguard Workercomparisons to pre-computed reference images; the gl_PatchVerticesIn and
115*35238bceSAndroid Build Coastguard Workergl_TessLevel*[] cases draw simple all-white patterns and are verified as such.
116*35238bceSAndroid Build Coastguard Worker
117*35238bceSAndroid Build Coastguard WorkerThe basic rendering cases for the "triangles" and "quads" modes contain two
118*35238bceSAndroid Build Coastguard Workertypes of cases: cases testing that there are no obvious gaps in the
119*35238bceSAndroid Build Coastguard Workertriangle-filled area, and cases testing that there are no overlaps between
120*35238bceSAndroid Build Coastguard Workertriangles of differing inner layers of the tessellated primitive. The gap cases
121*35238bceSAndroid Build Coastguard Workerdraw a single primitive deformed so as to reveal possible errors in the
122*35238bceSAndroid Build Coastguard Workertriangulation. The overlap cases draw a single primitive with different colors
123*35238bceSAndroid Build Coastguard Workerfor different concentric triangles (for the "triangles" mode) or concentric
124*35238bceSAndroid Build Coastguard Workerrectangles (for the "quads" mode); the coloring is done so as to make it visible
125*35238bceSAndroid Build Coastguard Workerif a fill-triangle spans between inappropriate inner triangles or rectangles.
126*35238bceSAndroid Build Coastguard WorkerBasic cases verifying the rendering results of isolines also exist; the cases
127*35238bceSAndroid Build Coastguard Workerdraw curly isolines with different colors for different vertices.
128*35238bceSAndroid Build Coastguard WorkerThe above cases are repeated for different spacing modes. The results of the
129*35238bceSAndroid Build Coastguard Workerrendering cases are compared to pre-computed reference images.
130*35238bceSAndroid Build Coastguard Worker
131*35238bceSAndroid Build Coastguard WorkerThe shared-edge cases draw multiple primitives (with the "triangles" or "quads"
132*35238bceSAndroid Build Coastguard Workermode) that have shared edges, and check that no cracks appear at the edges. For
133*35238bceSAndroid Build Coastguard Workereach pair of primitives sharing an edge, that edge has the same tessellation
134*35238bceSAndroid Build Coastguard Workerlevel for both primitives. The primitives are deformed in the TES so that
135*35238bceSAndroid Build Coastguard Workerpotential cracks are likely to become visible. The resulting image is verified
136*35238bceSAndroid Build Coastguard Workerby checking that no pixel (inside a fixed rectangle) remains uncovered by a
137*35238bceSAndroid Build Coastguard Workerprimitive. Two variants exist, with different methods for avoiding cracks:
138*35238bceSAndroid Build Coastguard Workereither the 'precise' qualifier is used in the tessellation shaders, or input
139*35238bceSAndroid Build Coastguard Workerpatches are generated in a way that causes each shared vertex to have the same
140*35238bceSAndroid Build Coastguard Workerindex in all the primitives it belongs to.
141*35238bceSAndroid Build Coastguard Worker
142*35238bceSAndroid Build Coastguard WorkerThe patch-discarding tests draw multiple patches in one draw call, with
143*35238bceSAndroid Build Coastguard Workerdifferent combinations for tessellation levels; some of these patches contain
144*35238bceSAndroid Build Coastguard Workerrelevant outer tessellation levels with a negative or zero value; they should
145*35238bceSAndroid Build Coastguard Workerbe discarded. Verification is done firstly by a quick check that the number of
146*35238bceSAndroid Build Coastguard Workervertices returned by transform feedback is correct, and secondly by checking
147*35238bceSAndroid Build Coastguard Workerthat white primitives exist in the area where non-discarded primitives are
148*35238bceSAndroid Build Coastguard Workerdrawn, and only there.
149*35238bceSAndroid Build Coastguard Worker
150*35238bceSAndroid Build Coastguard WorkerThe invariance tests target the 8 invariance rules laid out in the
151*35238bceSAndroid Build Coastguard Workerspecification. They render one or more primitives with various tessellation
152*35238bceSAndroid Build Coastguard Workerlevels and/or programs with different configurations, read the primitives with
153*35238bceSAndroid Build Coastguard Workertransform feedback, and do appropriate comparisons or other validation.
154*35238bceSAndroid Build Coastguard Worker
155*35238bceSAndroid Build Coastguard WorkerThe tessellation coordinate generation is somewhat implementation-dependent when
156*35238bceSAndroid Build Coastguard Workerusing a fractional spacing mode and a tessellation level that isn't already
157*35238bceSAndroid Build Coastguard Workerproperly rounded. In many of the cases using a spacing mode other than
158*35238bceSAndroid Build Coastguard Workerequal_spacing, the tessellation levels are chosen in a way that makes the
159*35238bceSAndroid Build Coastguard Workerresults non-implementation-dependent.
160*35238bceSAndroid Build Coastguard Worker
161*35238bceSAndroid Build Coastguard WorkerThe exact manner in which a "triangles" or "quads" primitive is divided into
162*35238bceSAndroid Build Coastguard Workertriangles is also implementation-dependent and is not thoroughly tested.
163*35238bceSAndroid Build Coastguard Worker
164*35238bceSAndroid Build Coastguard WorkerMore complete checking of final triangle generation are possible candidates for
165*35238bceSAndroid Build Coastguard Workerfuture tests.
166