1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[tessellation]]
6e5c31af7Sopenharmony_ci= Tessellation
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciTessellation involves three pipeline stages.
9e5c31af7Sopenharmony_ciFirst, a <<shaders-tessellation-control,tessellation control shader>>
10e5c31af7Sopenharmony_citransforms control points of a patch and can: produce per-patch data.
11e5c31af7Sopenharmony_ciSecond, a fixed-function tessellator generates multiple primitives
12e5c31af7Sopenharmony_cicorresponding to a tessellation of the patch in (u,v) or (u,v,w) parameter
13e5c31af7Sopenharmony_cispace.
14e5c31af7Sopenharmony_ciThird, a <<shaders-tessellation-evaluation,tessellation evaluation shader>>
15e5c31af7Sopenharmony_citransforms the vertices of the tessellated patch, for example to compute
16e5c31af7Sopenharmony_citheir positions and attributes as part of the tessellated surface.
17e5c31af7Sopenharmony_ciThe tessellator is enabled when the pipeline contains both a tessellation
18e5c31af7Sopenharmony_cicontrol shader and a tessellation evaluation shader.
19e5c31af7Sopenharmony_ci
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ci== Tessellator
22e5c31af7Sopenharmony_ci
23e5c31af7Sopenharmony_ciIf a pipeline includes both tessellation shaders (control and evaluation),
24e5c31af7Sopenharmony_cithe tessellator consumes each input patch (after vertex shading) and
25e5c31af7Sopenharmony_ciproduces a new set of independent primitives (points, lines, or triangles).
26e5c31af7Sopenharmony_ciThese primitives are logically produced by subdividing a geometric primitive
27e5c31af7Sopenharmony_ci(rectangle or triangle) according to the per-patch outer and inner
28e5c31af7Sopenharmony_citessellation levels written by the tessellation control shader.
29e5c31af7Sopenharmony_ciThese levels are specified using the <<interfaces-builtin-variables,built-in
30e5c31af7Sopenharmony_civariables>> code:TessLevelOuter and code:TessLevelInner, respectively.
31e5c31af7Sopenharmony_ciThis subdivision is performed in an implementation-dependent manner.
32e5c31af7Sopenharmony_ciIf no tessellation shaders are present in the pipeline, the tessellator is
33e5c31af7Sopenharmony_cidisabled and incoming primitives are passed through without modification.
34e5c31af7Sopenharmony_ci
35e5c31af7Sopenharmony_ciThe type of subdivision performed by the tessellator is specified by an
36e5c31af7Sopenharmony_cicode:OpExecutionMode instruction in the tessellation evaluation or
37e5c31af7Sopenharmony_citessellation control shader using one of execution modes code:Triangles,
38e5c31af7Sopenharmony_cicode:Quads, and code:IsoLines.
39e5c31af7Sopenharmony_ciOther tessellation-related execution modes can: also be specified in either
40e5c31af7Sopenharmony_cithe tessellation control or tessellation evaluation shaders, and if they are
41e5c31af7Sopenharmony_cispecified in both then the modes must: be the same.
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ciTessellation execution modes include:
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_ci  * code:Triangles, code:Quads, and code:IsoLines.
46e5c31af7Sopenharmony_ci    These control the type of subdivision and topology of the output
47e5c31af7Sopenharmony_ci    primitives.
48e5c31af7Sopenharmony_ci    One mode must: be set in at least one of the tessellation shader stages.
49e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
50e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
51e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationIsolines
52e5c31af7Sopenharmony_ci    is ename:VK_FALSE, then isoline tessellation is not supported by the
53e5c31af7Sopenharmony_ci    implementation, and code:IsoLines must: not be used in either
54e5c31af7Sopenharmony_ci    tessellation shader stage.
55e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
56e5c31af7Sopenharmony_ci  * code:VertexOrderCw and code:VertexOrderCcw.
57e5c31af7Sopenharmony_ci    These control the orientation of triangles generated by the tessellator.
58e5c31af7Sopenharmony_ci    One mode must: be set in at least one of the tessellation shader stages.
59e5c31af7Sopenharmony_ci  * code:PointMode.
60e5c31af7Sopenharmony_ci    Controls generation of points rather than triangles or lines.
61e5c31af7Sopenharmony_ci    This functionality defaults to disabled, and is enabled if either shader
62e5c31af7Sopenharmony_ci    stage includes the execution mode.
63e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
64e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
65e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationPointMode
66e5c31af7Sopenharmony_ci    is ename:VK_FALSE, then point mode tessellation is not supported by the
67e5c31af7Sopenharmony_ci    implementation, and code:PointMode must: not be used in either
68e5c31af7Sopenharmony_ci    tessellation shader stage.
69e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
70e5c31af7Sopenharmony_ci  * code:SpacingEqual, code:SpacingFractionalEven, and
71e5c31af7Sopenharmony_ci    code:SpacingFractionalOdd.
72e5c31af7Sopenharmony_ci    Controls the spacing of segments on the edges of tessellated primitives.
73e5c31af7Sopenharmony_ci    One mode must: be set in at least one of the tessellation shader stages.
74e5c31af7Sopenharmony_ci  * code:OutputVertices.
75e5c31af7Sopenharmony_ci    Controls the size of the output patch of the tessellation control
76e5c31af7Sopenharmony_ci    shader.
77e5c31af7Sopenharmony_ci    One value must: be set in at least one of the tessellation shader
78e5c31af7Sopenharmony_ci    stages.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ciFor triangles, the tessellator subdivides a triangle primitive into smaller
81e5c31af7Sopenharmony_citriangles.
82e5c31af7Sopenharmony_ciFor quads, the tessellator subdivides a rectangle primitive into smaller
83e5c31af7Sopenharmony_citriangles.
84e5c31af7Sopenharmony_ciFor isolines, the tessellator subdivides a rectangle primitive into a
85e5c31af7Sopenharmony_cicollection of line segments arranged in strips stretching across the
86e5c31af7Sopenharmony_cirectangle in the [eq]#u# dimension (i.e. the coordinates in code:TessCoord
87e5c31af7Sopenharmony_ciare of the form (0,x) through (1,x) for all tessellation evaluation shader
88e5c31af7Sopenharmony_ciinvocations that share a line).
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ciEach vertex produced by the tessellator has an associated (u,v,w) or (u,v)
91e5c31af7Sopenharmony_ciposition in a normalized parameter space, with parameter values in the range
92e5c31af7Sopenharmony_ci[eq]#[0,1]#, as illustrated
93e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
94e5c31af7Sopenharmony_ciin figures <<img-tessellation-topology-ul>> and
95e5c31af7Sopenharmony_ci<<img-tessellation-topology-ll>>.
96e5c31af7Sopenharmony_ciThe domain space can: have either an upper-left or lower-left origin,
97e5c31af7Sopenharmony_ciselected by the pname:domainOrigin member of
98e5c31af7Sopenharmony_cislink:VkPipelineTessellationDomainOriginStateCreateInfo.
99e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
100e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance2[]
101e5c31af7Sopenharmony_ciin figure <<img-tessellation-topology-ul>>.
102e5c31af7Sopenharmony_ciThe domain space has an upper-left origin.
103e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ci[[img-tessellation-topology-ul]]
106e5c31af7Sopenharmony_ciimage::{images}/tessparamUL.svg[align="center",title="Domain parameterization for tessellation primitive modes (upper-left origin)",opts="{imageopts}"]
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
109e5c31af7Sopenharmony_ci[[img-tessellation-topology-ll]]
110e5c31af7Sopenharmony_ciimage::{images}/tessparam.svg[align="center",title="Domain parameterization for tessellation primitive modes (lower-left origin)",opts="{imageopts}"]
111e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
112e5c31af7Sopenharmony_ci
113e5c31af7Sopenharmony_ci.Caption
114e5c31af7Sopenharmony_ci****
115e5c31af7Sopenharmony_ciIn the domain parameterization diagrams, the coordinates illustrate the
116e5c31af7Sopenharmony_civalue of code:TessCoord at the corners of the domain.
117e5c31af7Sopenharmony_ciThe labels on the edges indicate the inner (IL0 and IL1) and outer (OL0
118e5c31af7Sopenharmony_cithrough OL3) tessellation level values used to control the number of
119e5c31af7Sopenharmony_cisubdivisions along each edge of the domain.
120e5c31af7Sopenharmony_ci****
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ciFor triangles, the vertex's position is a barycentric coordinate
123e5c31af7Sopenharmony_ci[eq]#(u,v,w)#, where [eq]#u {plus} v {plus} w = 1.0#, and indicates the
124e5c31af7Sopenharmony_cirelative influence of the three vertices of the triangle on the position of
125e5c31af7Sopenharmony_cithe vertex.
126e5c31af7Sopenharmony_ciFor quads and isolines, the position is a [eq]#(u,v)# coordinate indicating
127e5c31af7Sopenharmony_cithe relative horizontal and vertical position of the vertex relative to the
128e5c31af7Sopenharmony_cisubdivided rectangle.
129e5c31af7Sopenharmony_ciThe subdivision process is explained in more detail in subsequent sections.
130e5c31af7Sopenharmony_ci
131e5c31af7Sopenharmony_ci
132e5c31af7Sopenharmony_ci== Tessellator Patch Discard
133e5c31af7Sopenharmony_ci
134e5c31af7Sopenharmony_ciA patch is discarded by the tessellator if any relevant outer tessellation
135e5c31af7Sopenharmony_cilevel is less than or equal to zero.
136e5c31af7Sopenharmony_ci
137e5c31af7Sopenharmony_ciPatches will also be discarded if any relevant outer tessellation level
138e5c31af7Sopenharmony_cicorresponds to a floating-point [eq]#NaN# (not a number) in implementations
139e5c31af7Sopenharmony_cisupporting [eq]#NaN#.
140e5c31af7Sopenharmony_ci
141e5c31af7Sopenharmony_ciNo new primitives are generated and the tessellation evaluation shader is
142e5c31af7Sopenharmony_cinot executed for patches that are discarded.
143e5c31af7Sopenharmony_ciFor code:Quads, all four outer levels are relevant.
144e5c31af7Sopenharmony_ciFor code:Triangles and code:IsoLines, only the first three or two outer
145e5c31af7Sopenharmony_cilevels, respectively, are relevant.
146e5c31af7Sopenharmony_ciNegative inner levels will not cause a patch to be discarded; they will be
147e5c31af7Sopenharmony_ciclamped as described below.
148e5c31af7Sopenharmony_ci
149e5c31af7Sopenharmony_ci
150e5c31af7Sopenharmony_ci[[tessellation-tessellator-spacing]]
151e5c31af7Sopenharmony_ci== Tessellator Spacing
152e5c31af7Sopenharmony_ci
153e5c31af7Sopenharmony_ciEach of the tessellation levels is used to determine the number and spacing
154e5c31af7Sopenharmony_ciof segments used to subdivide a corresponding edge.
155e5c31af7Sopenharmony_ciThe method used to derive the number and spacing of segments is specified by
156e5c31af7Sopenharmony_cian code:OpExecutionMode in the tessellation control or tessellation
157e5c31af7Sopenharmony_cievaluation shader using one of the identifiers code:SpacingEqual,
158e5c31af7Sopenharmony_cicode:SpacingFractionalEven, or code:SpacingFractionalOdd.
159e5c31af7Sopenharmony_ci
160e5c31af7Sopenharmony_ciIf code:SpacingEqual is used, the floating-point tessellation level is first
161e5c31af7Sopenharmony_ciclamped to [eq]#[1, pname:maxLevel]#, where [eq]#pname:maxLevel# is the
162e5c31af7Sopenharmony_ciimplementation-dependent maximum tessellation level
163e5c31af7Sopenharmony_ci(sname:VkPhysicalDeviceLimits::pname:maxTessellationGenerationLevel).
164e5c31af7Sopenharmony_ciThe result is rounded up to the nearest integer [eq]#n#, and the
165e5c31af7Sopenharmony_cicorresponding edge is divided into [eq]#n# segments of equal length in (u,v)
166e5c31af7Sopenharmony_cispace.
167e5c31af7Sopenharmony_ci
168e5c31af7Sopenharmony_ciIf code:SpacingFractionalEven is used, the tessellation level is first
169e5c31af7Sopenharmony_ciclamped to [eq]#[2, pname:maxLevel]# and then rounded up to the nearest even
170e5c31af7Sopenharmony_ciinteger [eq]#n#.
171e5c31af7Sopenharmony_ciIf code:SpacingFractionalOdd is used, the tessellation level is clamped to
172e5c31af7Sopenharmony_ci[eq]#[1, pname:maxLevel - 1]# and then rounded up to the nearest odd integer
173e5c31af7Sopenharmony_ci[eq]#n#.
174e5c31af7Sopenharmony_ciIf [eq]#n# is one, the edge will not be subdivided.
175e5c31af7Sopenharmony_ciOtherwise, the corresponding edge will be divided into [eq]#n - 2# segments
176e5c31af7Sopenharmony_ciof equal length, and two additional segments of equal length that are
177e5c31af7Sopenharmony_citypically shorter than the other segments.
178e5c31af7Sopenharmony_ciThe length of the two additional segments relative to the others will
179e5c31af7Sopenharmony_cidecrease monotonically with [eq]#n - f#, where [eq]#f# is the clamped
180e5c31af7Sopenharmony_cifloating-point tessellation level.
181e5c31af7Sopenharmony_ciWhen [eq]#n - f# is zero, the additional segments will have equal length to
182e5c31af7Sopenharmony_cithe other segments.
183e5c31af7Sopenharmony_ciAs [eq]#n - f# approaches 2.0, the relative length of the additional
184e5c31af7Sopenharmony_cisegments approaches zero.
185e5c31af7Sopenharmony_ciThe two additional segments must: be placed symmetrically on opposite sides
186e5c31af7Sopenharmony_ciof the subdivided edge.
187e5c31af7Sopenharmony_ciThe relative location of these two segments is implementation-dependent, but
188e5c31af7Sopenharmony_cimust: be identical for any pair of subdivided edges with identical values of
189e5c31af7Sopenharmony_ci[eq]#f#.
190e5c31af7Sopenharmony_ci
191e5c31af7Sopenharmony_ciWhen tessellating triangles or quads using <<tessellation-point-mode, point
192e5c31af7Sopenharmony_cimode>> with fractional odd spacing, the tessellator may: produce _interior
193e5c31af7Sopenharmony_civertices_ that are positioned on the edge of the patch if an inner
194e5c31af7Sopenharmony_citessellation level is less than or equal to one.
195e5c31af7Sopenharmony_ciSuch vertices are considered distinct from vertices produced by subdividing
196e5c31af7Sopenharmony_cithe outer edge of the patch, even if there are pairs of vertices with
197e5c31af7Sopenharmony_ciidentical coordinates.
198e5c31af7Sopenharmony_ci
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ci[[tessellation-primitive-order]]
201e5c31af7Sopenharmony_ci== Tessellation Primitive Ordering
202e5c31af7Sopenharmony_ci
203e5c31af7Sopenharmony_ciFew guarantees are provided for the relative ordering of primitives produced
204e5c31af7Sopenharmony_ciby tessellation, as they pertain to <<drawing-primitive-order, primitive
205e5c31af7Sopenharmony_ciorder>>.
206e5c31af7Sopenharmony_ci
207e5c31af7Sopenharmony_ci  * The output primitives generated from each input primitive are passed to
208e5c31af7Sopenharmony_ci    subsequent pipeline stages in an implementation-dependent order.
209e5c31af7Sopenharmony_ci  * All output primitives generated from a given input primitive are passed
210e5c31af7Sopenharmony_ci    to subsequent pipeline stages before any output primitives generated
211e5c31af7Sopenharmony_ci    from subsequent input primitives.
212e5c31af7Sopenharmony_ci
213e5c31af7Sopenharmony_ci
214e5c31af7Sopenharmony_ci[[tessellation-vertex-winding-order]]
215e5c31af7Sopenharmony_ci== Tessellator Vertex Winding Order
216e5c31af7Sopenharmony_ci
217e5c31af7Sopenharmony_ciWhen the tessellator produces triangles (in the code:Triangles or code:Quads
218e5c31af7Sopenharmony_cimodes), the orientation of all triangles is specified with an
219e5c31af7Sopenharmony_cicode:OpExecutionMode of code:VertexOrderCw or code:VertexOrderCcw in the
220e5c31af7Sopenharmony_citessellation control or tessellation evaluation shaders.
221e5c31af7Sopenharmony_ciIf the order is code:VertexOrderCw, the vertices of all generated triangles
222e5c31af7Sopenharmony_ciwill have clockwise ordering in (u,v) or (u,v,w) space.
223e5c31af7Sopenharmony_ciIf the order is code:VertexOrderCcw, the vertices will have
224e5c31af7Sopenharmony_cicounter-clockwise ordering in that space.
225e5c31af7Sopenharmony_ci
226e5c31af7Sopenharmony_ciIf the tessellation domain has an upper-left origin, the vertices of a
227e5c31af7Sopenharmony_citriangle have counter-clockwise ordering if
228e5c31af7Sopenharmony_ci
229e5c31af7Sopenharmony_ci  {empty}:: [eq]#a = u~0~ v~1~ - u~1~ v~0~ {plus} u~1~ v~2~ - u~2~ v~1~
230e5c31af7Sopenharmony_ci            {plus} u~2~ v~0~ - u~0~ v~2~#
231e5c31af7Sopenharmony_ci
232e5c31af7Sopenharmony_ciis negative, and clockwise ordering if [eq]#a# is positive.
233e5c31af7Sopenharmony_ci[eq]#u~i~# and [eq]#v~i~# are the [eq]#u# and [eq]#v# coordinates in
234e5c31af7Sopenharmony_cinormalized parameter space of the [eq]##i##th vertex of the triangle.
235e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
236e5c31af7Sopenharmony_ciIf the tessellation domain has a lower-left origin, the vertices of a
237e5c31af7Sopenharmony_citriangle have counter-clockwise ordering if [eq]#a# is positive, and
238e5c31af7Sopenharmony_ciclockwise ordering if [eq]#a# is negative.
239e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
240e5c31af7Sopenharmony_ci
241e5c31af7Sopenharmony_ci[NOTE]
242e5c31af7Sopenharmony_ci.Note
243e5c31af7Sopenharmony_ci====
244e5c31af7Sopenharmony_ciThe value [eq]#a# is proportional (with a positive factor) to the signed
245e5c31af7Sopenharmony_ciarea of the triangle.
246e5c31af7Sopenharmony_ci
247e5c31af7Sopenharmony_ciIn code:Triangles mode, even though the vertex coordinates have a [eq]#w#
248e5c31af7Sopenharmony_civalue, it does not participate directly in the computation of [eq]#a#, being
249e5c31af7Sopenharmony_cian affine combination of [eq]#u# and [eq]#v#.
250e5c31af7Sopenharmony_ci====
251e5c31af7Sopenharmony_ci
252e5c31af7Sopenharmony_ci
253e5c31af7Sopenharmony_ci[[tessellation-triangle-tessellation]]
254e5c31af7Sopenharmony_ci== Triangle Tessellation
255e5c31af7Sopenharmony_ci
256e5c31af7Sopenharmony_ciIf the tessellation primitive mode is code:Triangles, an equilateral
257e5c31af7Sopenharmony_citriangle is subdivided into a collection of triangles covering the area of
258e5c31af7Sopenharmony_cithe original triangle.
259e5c31af7Sopenharmony_ciFirst, the original triangle is subdivided into a collection of concentric
260e5c31af7Sopenharmony_ciequilateral triangles.
261e5c31af7Sopenharmony_ciThe edges of each of these triangles are subdivided, and the area between
262e5c31af7Sopenharmony_cieach triangle pair is filled by triangles produced by joining the vertices
263e5c31af7Sopenharmony_cion the subdivided edges.
264e5c31af7Sopenharmony_ciThe number of concentric triangles and the number of subdivisions along each
265e5c31af7Sopenharmony_citriangle except the outermost is derived from the first inner tessellation
266e5c31af7Sopenharmony_cilevel.
267e5c31af7Sopenharmony_ciThe edges of the outermost triangle are subdivided independently, using the
268e5c31af7Sopenharmony_cifirst, second, and third outer tessellation levels to control the number of
269e5c31af7Sopenharmony_cisubdivisions of the [eq]#u = 0# (left), [eq]#v = 0# (bottom), and [eq]#w =
270e5c31af7Sopenharmony_ci0# (right) edges, respectively.
271e5c31af7Sopenharmony_ciThe second inner tessellation level and the fourth outer tessellation level
272e5c31af7Sopenharmony_cihave no effect in this mode.
273e5c31af7Sopenharmony_ci
274e5c31af7Sopenharmony_ciIf the first inner tessellation level and all three outer tessellation
275e5c31af7Sopenharmony_cilevels are exactly one after clamping and rounding, only a single triangle
276e5c31af7Sopenharmony_ciwith [eq]#(u,v,w)# coordinates of [eq]#(0,0,1)#, [eq]#(1,0,0)#, and
277e5c31af7Sopenharmony_ci[eq]#(0,1,0)# is generated.
278e5c31af7Sopenharmony_ciIf the inner tessellation level is one and any of the outer tessellation
279e5c31af7Sopenharmony_cilevels is greater than one, the inner tessellation level is treated as
280e5c31af7Sopenharmony_cithough it were originally specified as [eq]#1 {plus} {epsilon}# and will
281e5c31af7Sopenharmony_ciresult in a two- or three-segment subdivision depending on the tessellation
282e5c31af7Sopenharmony_cispacing.
283e5c31af7Sopenharmony_ciWhen used with fractional odd spacing, the three-segment subdivision may:
284e5c31af7Sopenharmony_ciproduce _inner vertices_ positioned on the edge of the triangle.
285e5c31af7Sopenharmony_ci
286e5c31af7Sopenharmony_ciIf any tessellation level is greater than one, tessellation begins by
287e5c31af7Sopenharmony_ciproducing a set of concentric inner triangles and subdividing their edges.
288e5c31af7Sopenharmony_ciFirst, the three outer edges are temporarily subdivided using the clamped
289e5c31af7Sopenharmony_ciand rounded first inner tessellation level and the specified tessellation
290e5c31af7Sopenharmony_cispacing, generating [eq]#n# segments.
291e5c31af7Sopenharmony_ciFor the outermost inner triangle, the inner triangle is degenerate -- a
292e5c31af7Sopenharmony_cisingle point at the center of the triangle -- if [eq]#n# is two.
293e5c31af7Sopenharmony_ciOtherwise, for each corner of the outer triangle, an inner triangle corner
294e5c31af7Sopenharmony_ciis produced at the intersection of two lines extended perpendicular to the
295e5c31af7Sopenharmony_cicorner's two adjacent edges running through the vertex of the subdivided
296e5c31af7Sopenharmony_ciouter edge nearest that corner.
297e5c31af7Sopenharmony_ciIf [eq]#n# is three, the edges of the inner triangle are not subdivided and
298e5c31af7Sopenharmony_ciit is the final triangle in the set of concentric triangles.
299e5c31af7Sopenharmony_ciOtherwise, each edge of the inner triangle is divided into [eq]#n - 2#
300e5c31af7Sopenharmony_cisegments, with the [eq]#n - 1# vertices of this subdivision produced by
301e5c31af7Sopenharmony_ciintersecting the inner edge with lines perpendicular to the edge running
302e5c31af7Sopenharmony_cithrough the [eq]#n - 1# innermost vertices of the subdivision of the outer
303e5c31af7Sopenharmony_ciedge.
304e5c31af7Sopenharmony_ciOnce the outermost inner triangle is subdivided, the previous subdivision
305e5c31af7Sopenharmony_ciprocess repeats itself, using the generated triangle as an outer triangle.
306e5c31af7Sopenharmony_ciThis subdivision process is illustrated in <<img-innertri,Inner Triangle
307e5c31af7Sopenharmony_ciTessellation>>.
308e5c31af7Sopenharmony_ci
309e5c31af7Sopenharmony_ci[[img-innertri]]
310e5c31af7Sopenharmony_ciimage::{images}/innertri.svg[align="center",title="Inner Triangle Tessellation",opts="{imageopts}"]
311e5c31af7Sopenharmony_ci
312e5c31af7Sopenharmony_ci.Caption
313e5c31af7Sopenharmony_ci****
314e5c31af7Sopenharmony_ciIn the <<img-innertri,Inner Triangle Tessellation>> diagram, inner
315e5c31af7Sopenharmony_citessellation levels of (a) five and (b) four are shown (not to scale).
316e5c31af7Sopenharmony_ciSolid black circles depict vertices along the edges of the concentric
317e5c31af7Sopenharmony_citriangles.
318e5c31af7Sopenharmony_ciThe edges of inner triangles are subdivided by intersecting the edge with
319e5c31af7Sopenharmony_cisegments perpendicular to the edge passing through each inner vertex of the
320e5c31af7Sopenharmony_cisubdivided outer edge.
321e5c31af7Sopenharmony_ciDotted lines depict edges connecting corresponding vertices on the inner and
322e5c31af7Sopenharmony_ciouter triangle edges.
323e5c31af7Sopenharmony_ci****
324e5c31af7Sopenharmony_ci
325e5c31af7Sopenharmony_ciOnce all the concentric triangles are produced and their edges are
326e5c31af7Sopenharmony_cisubdivided, the area between each pair of adjacent inner triangles is filled
327e5c31af7Sopenharmony_cicompletely with a set of non-overlapping triangles.
328e5c31af7Sopenharmony_ciIn this subdivision, two of the three vertices of each triangle are taken
329e5c31af7Sopenharmony_cifrom adjacent vertices on a subdivided edge of one triangle; the third is
330e5c31af7Sopenharmony_cione of the vertices on the corresponding edge of the other triangle.
331e5c31af7Sopenharmony_ciIf the innermost triangle is degenerate (i.e., a point), the triangle
332e5c31af7Sopenharmony_cicontaining it is subdivided into six triangles by connecting each of the six
333e5c31af7Sopenharmony_civertices on that triangle with the center point.
334e5c31af7Sopenharmony_ciIf the innermost triangle is not degenerate, that triangle is added to the
335e5c31af7Sopenharmony_ciset of generated triangles as-is.
336e5c31af7Sopenharmony_ci
337e5c31af7Sopenharmony_ciAfter the area corresponding to any inner triangles is filled, the
338e5c31af7Sopenharmony_citessellator generates triangles to cover the area between the outermost
339e5c31af7Sopenharmony_citriangle and the outermost inner triangle.
340e5c31af7Sopenharmony_ciTo do this, the temporary subdivision of the outer triangle edge above is
341e5c31af7Sopenharmony_cidiscarded.
342e5c31af7Sopenharmony_ciInstead, the [eq]#u = 0#, [eq]#v = 0#, and [eq]#w = 0# edges are subdivided
343e5c31af7Sopenharmony_ciaccording to the first, second, and third outer tessellation levels,
344e5c31af7Sopenharmony_cirespectively, and the tessellation spacing.
345e5c31af7Sopenharmony_ciThe original subdivision of the first inner triangle is retained.
346e5c31af7Sopenharmony_ciThe area between the outer and first inner triangles is completely filled by
347e5c31af7Sopenharmony_cinon-overlapping triangles as described above.
348e5c31af7Sopenharmony_ciIf the first (and only) inner triangle is degenerate, a set of triangles is
349e5c31af7Sopenharmony_ciproduced by connecting each vertex on the outer triangle edges with the
350e5c31af7Sopenharmony_cicenter point.
351e5c31af7Sopenharmony_ci
352e5c31af7Sopenharmony_ciAfter all triangles are generated, each vertex in the subdivided triangle is
353e5c31af7Sopenharmony_ciassigned a barycentric (u,v,w) coordinate based on its location relative to
354e5c31af7Sopenharmony_cithe three vertices of the outer triangle.
355e5c31af7Sopenharmony_ci
356e5c31af7Sopenharmony_ciThe algorithm used to subdivide the triangular domain in (u,v,w) space into
357e5c31af7Sopenharmony_ciindividual triangles is implementation-dependent.
358e5c31af7Sopenharmony_ciHowever, the set of triangles produced will completely cover the domain, and
359e5c31af7Sopenharmony_cino portion of the domain will be covered by multiple triangles.
360e5c31af7Sopenharmony_ci
361e5c31af7Sopenharmony_ciOutput triangles are generated with a topology similar to
362e5c31af7Sopenharmony_ci<<drawing-triangle-lists, triangle lists>>, except that the order in which
363e5c31af7Sopenharmony_cieach triangle is generated, and the order in which the vertices are
364e5c31af7Sopenharmony_cigenerated for each triangle, are implementation-dependent.
365e5c31af7Sopenharmony_ciHowever, the order of vertices in each triangle is consistent across the
366e5c31af7Sopenharmony_cidomain as described in <<tessellation-vertex-winding-order>>.
367e5c31af7Sopenharmony_ci
368e5c31af7Sopenharmony_ci
369e5c31af7Sopenharmony_ci[[tessellation-quad-tessellation]]
370e5c31af7Sopenharmony_ci== Quad Tessellation
371e5c31af7Sopenharmony_ci
372e5c31af7Sopenharmony_ciIf the tessellation primitive mode is code:Quads, a rectangle is subdivided
373e5c31af7Sopenharmony_ciinto a collection of triangles covering the area of the original rectangle.
374e5c31af7Sopenharmony_ciFirst, the original rectangle is subdivided into a regular mesh of
375e5c31af7Sopenharmony_cirectangles, where the number of rectangles along the [eq]#u = 0# and [eq]#u
376e5c31af7Sopenharmony_ci= 1# (vertical) and [eq]#v = 0# and [eq]#v = 1# (horizontal) edges are
377e5c31af7Sopenharmony_ciderived from the first and second inner tessellation levels, respectively.
378e5c31af7Sopenharmony_ciAll rectangles, except those adjacent to one of the outer rectangle edges,
379e5c31af7Sopenharmony_ciare decomposed into triangle pairs.
380e5c31af7Sopenharmony_ciThe outermost rectangle edges are subdivided independently, using the first,
381e5c31af7Sopenharmony_cisecond, third, and fourth outer tessellation levels to control the number of
382e5c31af7Sopenharmony_cisubdivisions of the [eq]#u = 0# (left), [eq]#v = 0# (bottom), [eq]#u = 1#
383e5c31af7Sopenharmony_ci(right), and [eq]#v = 1# (top) edges, respectively.
384e5c31af7Sopenharmony_ciThe area between the inner rectangles of the mesh and the outer rectangle
385e5c31af7Sopenharmony_ciedges are filled by triangles produced by joining the vertices on the
386e5c31af7Sopenharmony_cisubdivided outer edges to the vertices on the edge of the inner rectangle
387e5c31af7Sopenharmony_cimesh.
388e5c31af7Sopenharmony_ci
389e5c31af7Sopenharmony_ciIf both clamped inner tessellation levels and all four clamped outer
390e5c31af7Sopenharmony_citessellation levels are exactly one, only a single triangle pair covering
391e5c31af7Sopenharmony_cithe outer rectangle is generated.
392e5c31af7Sopenharmony_ciOtherwise, if either clamped inner tessellation level is one, that
393e5c31af7Sopenharmony_citessellation level is treated as though it was originally specified as
394e5c31af7Sopenharmony_ci[eq]#1 {plus} {epsilon}# and will result in a two- or three-segment
395e5c31af7Sopenharmony_cisubdivision depending on the tessellation spacing.
396e5c31af7Sopenharmony_ciWhen used with fractional odd spacing, the three-segment subdivision may:
397e5c31af7Sopenharmony_ciproduce _inner vertices_ positioned on the edge of the rectangle.
398e5c31af7Sopenharmony_ci
399e5c31af7Sopenharmony_ciIf any tessellation level is greater than one, tessellation begins by
400e5c31af7Sopenharmony_cisubdividing the [eq]#u = 0# and [eq]#u = 1# edges of the outer rectangle
401e5c31af7Sopenharmony_ciinto [eq]#m# segments using the clamped and rounded first inner tessellation
402e5c31af7Sopenharmony_cilevel and the tessellation spacing.
403e5c31af7Sopenharmony_ciThe [eq]#v = 0# and [eq]#v = 1# edges are subdivided into [eq]#n# segments
404e5c31af7Sopenharmony_ciusing the second inner tessellation level.
405e5c31af7Sopenharmony_ciEach vertex on the [eq]#u = 0# and [eq]#v = 0# edges are joined with the
406e5c31af7Sopenharmony_cicorresponding vertex on the [eq]#u = 1# and [eq]#v = 1# edges to produce a
407e5c31af7Sopenharmony_ciset of vertical and horizontal lines that divide the rectangle into a grid
408e5c31af7Sopenharmony_ciof smaller rectangles.
409e5c31af7Sopenharmony_ciThe primitive generator emits a pair of non-overlapping triangles covering
410e5c31af7Sopenharmony_cieach such rectangle not adjacent to an edge of the outer rectangle.
411e5c31af7Sopenharmony_ciThe boundary of the region covered by these triangles forms an inner
412e5c31af7Sopenharmony_cirectangle, the edges of which are subdivided by the grid vertices that lie
413e5c31af7Sopenharmony_cion the edge.
414e5c31af7Sopenharmony_ciIf either [eq]#m# or [eq]#n# is two, the inner rectangle is degenerate, and
415e5c31af7Sopenharmony_cione or both of the rectangle's _edges_ consist of a single point.
416e5c31af7Sopenharmony_ciThis subdivision is illustrated in Figure <<img-innerquad,Inner Quad
417e5c31af7Sopenharmony_ciTessellation>>.
418e5c31af7Sopenharmony_ci
419e5c31af7Sopenharmony_ci[[img-innerquad]]
420e5c31af7Sopenharmony_ciimage::{images}/innerquad.svg[align="center",title="Inner Quad Tessellation",opts="{imageopts}"]
421e5c31af7Sopenharmony_ci
422e5c31af7Sopenharmony_ci.Caption
423e5c31af7Sopenharmony_ci****
424e5c31af7Sopenharmony_ciIn the <<img-innerquad,Inner Quad Tessellation>> diagram, inner quad
425e5c31af7Sopenharmony_citessellation levels of (a) [eq]#(4,2)# and (b) [eq]#(7,4)# are shown.
426e5c31af7Sopenharmony_ciThe regions highlighted in red in figure (b) depict the 10 inner rectangles,
427e5c31af7Sopenharmony_cieach of which will be subdivided into two triangles.
428e5c31af7Sopenharmony_ciSolid black circles depict vertices on the boundary of the outer and inner
429e5c31af7Sopenharmony_cirectangles, where the inner rectangle of figure (a) is degenerate (a single
430e5c31af7Sopenharmony_ciline segment).
431e5c31af7Sopenharmony_ciDotted lines depict the horizontal and vertical edges connecting
432e5c31af7Sopenharmony_cicorresponding vertices on the inner and outer rectangle edges.
433e5c31af7Sopenharmony_ci****
434e5c31af7Sopenharmony_ci
435e5c31af7Sopenharmony_ciAfter the area corresponding to the inner rectangle is filled, the
436e5c31af7Sopenharmony_citessellator must: produce triangles to cover the area between the inner and
437e5c31af7Sopenharmony_ciouter rectangles.
438e5c31af7Sopenharmony_ciTo do this, the subdivision of the outer rectangle edge above is discarded.
439e5c31af7Sopenharmony_ciInstead, the [eq]#u = 0#, [eq]#v = 0#, [eq]#u = 1#, and [eq]#v = 1# edges
440e5c31af7Sopenharmony_ciare subdivided according to the first, second, third, and fourth outer
441e5c31af7Sopenharmony_citessellation levels, respectively, and the tessellation spacing.
442e5c31af7Sopenharmony_ciThe original subdivision of the inner rectangle is retained.
443e5c31af7Sopenharmony_ciThe area between the outer and inner rectangles is completely filled by
444e5c31af7Sopenharmony_cinon-overlapping triangles.
445e5c31af7Sopenharmony_ciTwo of the three vertices of each triangle are adjacent vertices on a
446e5c31af7Sopenharmony_cisubdivided edge of one rectangle; the third is one of the vertices on the
447e5c31af7Sopenharmony_cicorresponding edge of the other rectangle.
448e5c31af7Sopenharmony_ciIf either edge of the innermost rectangle is degenerate, the area near the
449e5c31af7Sopenharmony_cicorresponding outer edges is filled by connecting each vertex on the outer
450e5c31af7Sopenharmony_ciedge with the single vertex making up the _inner edge_.
451e5c31af7Sopenharmony_ci
452e5c31af7Sopenharmony_ciThe algorithm used to subdivide the rectangular domain in (u,v) space into
453e5c31af7Sopenharmony_ciindividual triangles is implementation-dependent.
454e5c31af7Sopenharmony_ciHowever, the set of triangles produced will completely cover the domain, and
455e5c31af7Sopenharmony_cino portion of the domain will be covered by multiple triangles.
456e5c31af7Sopenharmony_ci
457e5c31af7Sopenharmony_ciOutput triangles are generated with a topology similar to
458e5c31af7Sopenharmony_ci<<drawing-triangle-lists, triangle lists>>, except that the order in which
459e5c31af7Sopenharmony_cieach triangle is generated, and the order in which the vertices are
460e5c31af7Sopenharmony_cigenerated for each triangle, are implementation-dependent.
461e5c31af7Sopenharmony_ciHowever, the order of vertices in each triangle is consistent across the
462e5c31af7Sopenharmony_cidomain as described in <<tessellation-vertex-winding-order>>.
463e5c31af7Sopenharmony_ci
464e5c31af7Sopenharmony_ci
465e5c31af7Sopenharmony_ci[[tessellation-isoline-tessellation]]
466e5c31af7Sopenharmony_ci== Isoline Tessellation
467e5c31af7Sopenharmony_ci
468e5c31af7Sopenharmony_ciIf the tessellation primitive mode is code:IsoLines, a set of independent
469e5c31af7Sopenharmony_cihorizontal line segments is drawn.
470e5c31af7Sopenharmony_ciThe segments are arranged into connected strips called _isolines_, where the
471e5c31af7Sopenharmony_civertices of each isoline have a constant v coordinate and u coordinates
472e5c31af7Sopenharmony_cicovering the full range [eq]#[0,1]#.
473e5c31af7Sopenharmony_ciThe number of isolines generated is derived from the first outer
474e5c31af7Sopenharmony_citessellation level; the number of segments in each isoline is derived from
475e5c31af7Sopenharmony_cithe second outer tessellation level.
476e5c31af7Sopenharmony_ciBoth inner tessellation levels and the third and fourth outer tessellation
477e5c31af7Sopenharmony_cilevels have no effect in this mode.
478e5c31af7Sopenharmony_ci
479e5c31af7Sopenharmony_ciAs with quad tessellation above, isoline tessellation begins with a
480e5c31af7Sopenharmony_cirectangle.
481e5c31af7Sopenharmony_ciThe [eq]#u = 0# and [eq]#u = 1# edges of the rectangle are subdivided
482e5c31af7Sopenharmony_ciaccording to the first outer tessellation level.
483e5c31af7Sopenharmony_ciFor the purposes of this subdivision, the tessellation spacing mode is
484e5c31af7Sopenharmony_ciignored and treated as equal_spacing.
485e5c31af7Sopenharmony_ciAn isoline is drawn connecting each vertex on the [eq]#u = 0# rectangle edge
486e5c31af7Sopenharmony_cito the corresponding vertex on the [eq]#u = 1# rectangle edge, except that
487e5c31af7Sopenharmony_cino line is drawn between (0,1) and (1,1).
488e5c31af7Sopenharmony_ciIf the number of isolines on the subdivided [eq]#u = 0# and [eq]#u = 1#
489e5c31af7Sopenharmony_ciedges is [eq]#n#, this process will result in [eq]#n# equally spaced lines
490e5c31af7Sopenharmony_ciwith constant v coordinates of 0, latexmath:[\frac{1}{n}, \frac{2}{n},
491e5c31af7Sopenharmony_ci\ldots, \frac{n-1}{n}].
492e5c31af7Sopenharmony_ci
493e5c31af7Sopenharmony_ciEach of the [eq]#n# isolines is then subdivided according to the second
494e5c31af7Sopenharmony_ciouter tessellation level and the tessellation spacing, resulting in [eq]#m#
495e5c31af7Sopenharmony_ciline segments.
496e5c31af7Sopenharmony_ciEach segment of each line is emitted by the tessellator.
497e5c31af7Sopenharmony_ciThese line segments are generated with a topology similar to
498e5c31af7Sopenharmony_ci<<drawing-line-lists, line lists>>, except that the order in which each line
499e5c31af7Sopenharmony_ciis generated, and the order in which the vertices are generated for each
500e5c31af7Sopenharmony_ciline segment, are implementation-dependent.
501e5c31af7Sopenharmony_ci
502e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
503e5c31af7Sopenharmony_ci[NOTE]
504e5c31af7Sopenharmony_ci.Note
505e5c31af7Sopenharmony_ci====
506e5c31af7Sopenharmony_ciIf the `apiext:VK_KHR_portability_subset` extension is enabled, and
507e5c31af7Sopenharmony_cislink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationIsolines
508e5c31af7Sopenharmony_ciis ename:VK_FALSE, then isoline tessellation is not supported by the
509e5c31af7Sopenharmony_ciimplementation.
510e5c31af7Sopenharmony_ci====
511e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
512e5c31af7Sopenharmony_ci
513e5c31af7Sopenharmony_ci[[tessellation-point-mode]]
514e5c31af7Sopenharmony_ci== Tessellation Point Mode
515e5c31af7Sopenharmony_ci
516e5c31af7Sopenharmony_ciFor all primitive modes, the tessellator is capable of generating points
517e5c31af7Sopenharmony_ciinstead of lines or triangles.
518e5c31af7Sopenharmony_ciIf the tessellation control or tessellation evaluation shader specifies the
519e5c31af7Sopenharmony_cicode:OpExecutionMode code:PointMode, the primitive generator will generate
520e5c31af7Sopenharmony_cione point for each distinct vertex produced by tessellation, rather than
521e5c31af7Sopenharmony_ciemitting triangles or lines.
522e5c31af7Sopenharmony_ciOtherwise, the tessellator will produce a collection of line segments or
523e5c31af7Sopenharmony_citriangles according to the primitive mode.
524e5c31af7Sopenharmony_ciThese points are generated with a topology similar to <<drawing-point-lists,
525e5c31af7Sopenharmony_cipoint lists>>, except the order in which the points are generated for each
526e5c31af7Sopenharmony_ciinput primitive is undefined:.
527e5c31af7Sopenharmony_ci
528e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
529e5c31af7Sopenharmony_ci[NOTE]
530e5c31af7Sopenharmony_ci.Note
531e5c31af7Sopenharmony_ci====
532e5c31af7Sopenharmony_ciIf the `apiext:VK_KHR_portability_subset` extension is enabled, and
533e5c31af7Sopenharmony_cislink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationPointMode
534e5c31af7Sopenharmony_ciis ename:VK_FALSE, then tessellation point mode is not supported by the
535e5c31af7Sopenharmony_ciimplementation.
536e5c31af7Sopenharmony_ci====
537e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
538e5c31af7Sopenharmony_ci
539e5c31af7Sopenharmony_ci
540e5c31af7Sopenharmony_ci== Tessellation Pipeline State
541e5c31af7Sopenharmony_ci
542e5c31af7Sopenharmony_ciThe pname:pTessellationState member of slink:VkGraphicsPipelineCreateInfo is
543e5c31af7Sopenharmony_cia pointer to a sname:VkPipelineTessellationStateCreateInfo structure.
544e5c31af7Sopenharmony_ci
545e5c31af7Sopenharmony_ci[open,refpage='VkPipelineTessellationStateCreateInfo',desc='Structure specifying parameters of a newly created pipeline tessellation state',type='structs']
546e5c31af7Sopenharmony_ci--
547e5c31af7Sopenharmony_ciThe sname:VkPipelineTessellationStateCreateInfo structure is defined as:
548e5c31af7Sopenharmony_ci
549e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineTessellationStateCreateInfo.txt[]
550e5c31af7Sopenharmony_ci
551e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
552e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
553e5c31af7Sopenharmony_ci    structure.
554e5c31af7Sopenharmony_ci  * pname:flags is reserved for future use.
555e5c31af7Sopenharmony_ci  * pname:patchControlPoints is the number of control points per patch.
556e5c31af7Sopenharmony_ci
557e5c31af7Sopenharmony_ci.Valid Usage
558e5c31af7Sopenharmony_ci****
559e5c31af7Sopenharmony_ci  * [[VUID-VkPipelineTessellationStateCreateInfo-patchControlPoints-01214]]
560e5c31af7Sopenharmony_ci    pname:patchControlPoints must: be greater than zero and less than or
561e5c31af7Sopenharmony_ci    equal to sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize
562e5c31af7Sopenharmony_ci****
563e5c31af7Sopenharmony_ci
564e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineTessellationStateCreateInfo.txt[]
565e5c31af7Sopenharmony_ci--
566e5c31af7Sopenharmony_ci
567e5c31af7Sopenharmony_ci[open,refpage='VkPipelineTessellationStateCreateFlags',desc='Reserved for future use',type='flags']
568e5c31af7Sopenharmony_ci--
569e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineTessellationStateCreateFlags.txt[]
570e5c31af7Sopenharmony_ci
571e5c31af7Sopenharmony_citname:VkPipelineTessellationStateCreateFlags is a bitmask type for setting a
572e5c31af7Sopenharmony_cimask, but is currently reserved for future use.
573e5c31af7Sopenharmony_ci--
574e5c31af7Sopenharmony_ci
575e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
576e5c31af7Sopenharmony_ci[open,refpage='VkPipelineTessellationDomainOriginStateCreateInfo',desc='Structure specifying the orientation of the tessellation domain',type='structs']
577e5c31af7Sopenharmony_ci--
578e5c31af7Sopenharmony_ciThe sname:VkPipelineTessellationDomainOriginStateCreateInfo structure is
579e5c31af7Sopenharmony_cidefined as:
580e5c31af7Sopenharmony_ci
581e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineTessellationDomainOriginStateCreateInfo.txt[]
582e5c31af7Sopenharmony_ci
583e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[]
584e5c31af7Sopenharmony_cior the equivalent
585e5c31af7Sopenharmony_ci
586e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineTessellationDomainOriginStateCreateInfoKHR.txt[]
587e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[]
588e5c31af7Sopenharmony_ci
589e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
590e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
591e5c31af7Sopenharmony_ci    structure.
592e5c31af7Sopenharmony_ci  * pname:domainOrigin is a elink:VkTessellationDomainOrigin value
593e5c31af7Sopenharmony_ci    controlling the origin of the tessellation domain space.
594e5c31af7Sopenharmony_ci
595e5c31af7Sopenharmony_ciIf the sname:VkPipelineTessellationDomainOriginStateCreateInfo structure is
596e5c31af7Sopenharmony_ciincluded in the pname:pNext chain of
597e5c31af7Sopenharmony_cislink:VkPipelineTessellationStateCreateInfo, it controls the origin of the
598e5c31af7Sopenharmony_citessellation domain.
599e5c31af7Sopenharmony_ciIf this structure is not present, it is as if pname:domainOrigin was
600e5c31af7Sopenharmony_ciename:VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT.
601e5c31af7Sopenharmony_ci
602e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineTessellationDomainOriginStateCreateInfo.txt[]
603e5c31af7Sopenharmony_ci--
604e5c31af7Sopenharmony_ci
605e5c31af7Sopenharmony_ci[open,refpage='VkTessellationDomainOrigin',desc='Enum describing tessellation domain origin',type='enums']
606e5c31af7Sopenharmony_ci--
607e5c31af7Sopenharmony_ciThe possible tessellation domain origins are specified by the
608e5c31af7Sopenharmony_cielink:VkTessellationDomainOrigin enumeration:
609e5c31af7Sopenharmony_ci
610e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkTessellationDomainOrigin.txt[]
611e5c31af7Sopenharmony_ci
612e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[]
613e5c31af7Sopenharmony_cior the equivalent
614e5c31af7Sopenharmony_ci
615e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkTessellationDomainOriginKHR.txt[]
616e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[]
617e5c31af7Sopenharmony_ci
618e5c31af7Sopenharmony_ci  * ename:VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT specifies that the origin
619e5c31af7Sopenharmony_ci    of the domain space is in the upper left corner, as shown in figure
620e5c31af7Sopenharmony_ci    <<img-tessellation-topology-ul>>.
621e5c31af7Sopenharmony_ci  * ename:VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT specifies that the origin
622e5c31af7Sopenharmony_ci    of the domain space is in the lower left corner, as shown in figure
623e5c31af7Sopenharmony_ci    <<img-tessellation-topology-ll>>.
624e5c31af7Sopenharmony_ci
625e5c31af7Sopenharmony_ciThis enum affects how the code:VertexOrderCw and code:VertexOrderCcw
626e5c31af7Sopenharmony_citessellation execution modes are interpreted, since the winding is defined
627e5c31af7Sopenharmony_cirelative to the orientation of the domain.
628e5c31af7Sopenharmony_ci--
629e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
630