1// Copyright (c) 2015-2018 Khronos Group. This work is licensed under a 2// Creative Commons Attribution 4.0 International License; see 3// http://creativecommons.org/licenses/by/4.0/ 4 5[[tessellation]] 6= Tessellation 7 8Tessellation involves three pipeline stages. 9First, a <<shaders-tessellation-control,tessellation control shader>> 10transforms control points of a patch and can: produce per-patch data. 11Second, a fixed-function tessellator generates multiple primitives 12corresponding to a tessellation of the patch in (u,v) or (u,v,w) parameter 13space. 14Third, a <<shaders-tessellation-evaluation,tessellation evaluation shader>> 15transforms the vertices of the tessellated patch, for example to compute 16their positions and attributes as part of the tessellated surface. 17The tessellator is enabled when the pipeline contains both a tessellation 18control shader and a tessellation evaluation shader. 19 20 21== Tessellator 22 23If a pipeline includes both tessellation shaders (control and evaluation), 24the tessellator consumes each input patch (after vertex shading) and 25produces a new set of independent primitives (points, lines, or triangles). 26These primitives are logically produced by subdividing a geometric primitive 27(rectangle or triangle) according to the per-patch outer and inner 28tessellation levels written by the tessellation control shader. 29These levels are specified using the <<interfaces-builtin-variables,built-in 30variables>> code:TessLevelOuter and code:TessLevelInner, respectively. 31This subdivision is performed in an implementation-dependent manner. 32If no tessellation shaders are present in the pipeline, the tessellator is 33disabled and incoming primitives are passed through without modification. 34 35The type of subdivision performed by the tessellator is specified by an 36code:OpExecutionMode instruction in the tessellation evaluation or 37tessellation control shader using one of execution modes code:Triangles, 38code:Quads, and code:IsoLines. 39Other tessellation-related execution modes can: also be specified in either 40the tessellation control or tessellation evaluation shaders, and if they are 41specified in both then the modes must: be the same. 42 43Tessellation execution modes include: 44 45 * code:Triangles, code:Quads, and code:IsoLines. 46 These control the type of subdivision and topology of the output 47 primitives. 48 One mode must: be set in at least one of the tessellation shader stages. 49 * code:VertexOrderCw and code:VertexOrderCcw. 50 These control the orientation of triangles generated by the tessellator. 51 One mode must: be set in at least one of the tessellation shader stages. 52 * code:PointMode. 53 Controls generation of points rather than triangles or lines. 54 This functionality defaults to disabled, and is enabled if either shader 55 stage includes the execution mode. 56 * code:SpacingEqual, code:SpacingFractionalEven, and 57 code:SpacingFractionalOdd. 58 Controls the spacing of segments on the edges of tessellated primitives. 59 One mode must: be set in at least one of the tessellation shader stages. 60 * code:OutputVertices. 61 Controls the size of the output patch of the tessellation control 62 shader. 63 One value must: be set in at least one of the tessellation shader 64 stages. 65 66For triangles, the tessellator subdivides a triangle primitive into smaller 67triangles. 68For quads, the tessellator subdivides a rectangle primitive into smaller 69triangles. 70For isolines, the tessellator subdivides a rectangle primitive into a 71collection of line segments arranged in strips stretching across the 72rectangle in the [eq]#u# dimension (i.e. the coordinates in code:TessCoord 73are of the form (0,x) through (1,x) for all tessellation evaluation shader 74invocations that share a line). 75 76Each vertex produced by the tessellator has an associated (u,v,w) or (u,v) 77position in a normalized parameter space, with parameter values in the range 78[eq]#[0,1]#, as illustrated 79ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 80in figures <<img-tessellation-topology-ul>> and 81<<img-tessellation-topology-ll>>. 82The domain space can: have either an upper-left or lower-left origin, 83selected by the pname:domainOrigin member of 84slink:VkPipelineTessellationDomainOriginStateCreateInfo. 85endif::VK_VERSION_1_1,VK_KHR_maintenance2[] 86ifndef::VK_VERSION_1_1,VK_KHR_maintenance2[] 87in figure <<img-tessellation-topology-ul>>. 88The domain space has an upper-left origin. 89endif::VK_VERSION_1_1,VK_KHR_maintenance2[] 90 91[[img-tessellation-topology-ul]] 92[%inline] 93image::images/tessparamUL.svg[align="center",title="Domain parameterization for tessellation primitive modes (upper-left origin)"] 94 95ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 96[[img-tessellation-topology-ll]] 97[%inline] 98image::images/tessparam.svg[align="center",title="Domain parameterization for tessellation primitive modes (lower-left origin)"] 99endif::VK_VERSION_1_1,VK_KHR_maintenance2[] 100 101.Caption 102**** 103In the domain parameterization diagrams, the coordinates illustrate the 104value of code:TessCoord at the corners of the domain. 105The labels on the edges indicate the inner (IL0 and IL1) and outer (OL0 106through OL3) tessellation level values used to control the number of 107subdivisions along each edge of the domain. 108**** 109 110For triangles, the vertex's position is a barycentric coordinate 111[eq]#(u,v,w)#, where [eq]#u {plus} v {plus} w = 1.0#, and indicates the 112relative influence of the three vertices of the triangle on the position of 113the vertex. 114For quads and isolines, the position is a [eq]#(u,v)# coordinate indicating 115the relative horizontal and vertical position of the vertex relative to the 116subdivided rectangle. 117The subdivision process is explained in more detail in subsequent sections. 118 119 120== Tessellator Patch Discard 121 122A patch is discarded by the tessellator if any relevant outer tessellation 123level is less than or equal to zero. 124 125Patches will also be discarded if any relevant outer tessellation level 126corresponds to a floating-point [eq]#NaN# (not a number) in implementations 127supporting [eq]#NaN#. 128 129No new primitives are generated and the tessellation evaluation shader is 130not executed for patches that are discarded. 131For code:Quads, all four outer levels are relevant. 132For code:Triangles and code:IsoLines, only the first three or two outer 133levels, respectively, are relevant. 134Negative inner levels will not cause a patch to be discarded; they will be 135clamped as described below. 136 137 138[[tessellation-tessellator-spacing]] 139== Tessellator Spacing 140 141Each of the tessellation levels is used to determine the number and spacing 142of segments used to subdivide a corresponding edge. 143The method used to derive the number and spacing of segments is specified by 144an code:OpExecutionMode in the tessellation control or tessellation 145evaluation shader using one of the identifiers code:SpacingEqual, 146code:SpacingFractionalEven, or code:SpacingFractionalOdd. 147 148If code:SpacingEqual is used, the floating-point tessellation level is first 149clamped to [eq]#[1, pname:maxLevel]#, where [eq]#pname:maxLevel# is the 150implementation-dependent maximum tessellation level 151(sname:VkPhysicalDeviceLimits::pname:maxTessellationGenerationLevel). 152The result is rounded up to the nearest integer [eq]#n#, and the 153corresponding edge is divided into [eq]#n# segments of equal length in (u,v) 154space. 155 156If code:SpacingFractionalEven is used, the tessellation level is first 157clamped to [eq]#[2, pname:maxLevel]# and then rounded up to the nearest even 158integer [eq]#n#. 159If code:SpacingFractionalOdd is used, the tessellation level is clamped to 160[eq]#[1, pname:maxLevel - 1]# and then rounded up to the nearest odd integer 161[eq]#n#. 162If [eq]#n# is one, the edge will not be subdivided. 163Otherwise, the corresponding edge will be divided into [eq]#n - 2# segments 164of equal length, and two additional segments of equal length that are 165typically shorter than the other segments. 166The length of the two additional segments relative to the others will 167decrease monotonically with [eq]#n - f#, where [eq]#f# is the clamped 168floating-point tessellation level. 169When [eq]#n - f# is zero, the additional segments will have equal length to 170the other segments. 171As [eq]#n - f# approaches 2.0, the relative length of the additional 172segments approaches zero. 173The two additional segments must: be placed symmetrically on opposite sides 174of the subdivided edge. 175The relative location of these two segments is implementation-dependent, but 176must: be identical for any pair of subdivided edges with identical values of 177[eq]#f#. 178 179When the tessellator produces triangles (in the code:Triangles or code:Quads 180modes), the orientation of all triangles is specified with an 181code:OpExecutionMode of code:VertexOrderCw or code:VertexOrderCcw in the 182tessellation control or tessellation evaluation shaders. 183If the order is code:VertexOrderCw, the vertices of all generated triangles 184will have clockwise ordering in (u,v) or (u,v,w) space. 185If the order is code:VertexOrderCcw, the vertices will have 186counter-clockwise ordering. 187 188If the tessellation domain has an upper-left origin, the vertices of a 189triangle have counter-clockwise ordering if 190 191 :: [eq]#a = u~0~ v~1~ - u~1~ v~0~ {plus} u~1~ v~2~ - u~2~ v~1~ {plus} u~2~ 192 v~0~ - u~0~ v~2~# 193 194is negative, and clockwise ordering if [eq]#a# is positive. 195[eq]#u~i~# and [eq]#v~i~# are the [eq]#u# and [eq]#v# coordinates in 196normalized parameter space of the [eq]##i##th vertex of the triangle. 197ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 198If the tessellation domain has a lower-left origin, the vertices of a 199triangle have counter-clockwise ordering if [eq]#a# is positive, and 200clockwise ordering if [eq]#a# is negative. 201endif::VK_VERSION_1_1,VK_KHR_maintenance2[] 202 203[NOTE] 204.Note 205==== 206The value [eq]#a# is proportional (with a positive factor) to the signed 207area of the triangle. 208 209In code:Triangles mode, even though the vertex coordinates have a [eq]#w# 210value, it does not participate directly in the computation of [eq]#a#, being 211an affine combination of [eq]#u# and [eq]#v#. 212==== 213 214For all primitive modes, the tessellator is capable of generating points 215instead of lines or triangles. 216If the tessellation control or tessellation evaluation shader specifies the 217code:OpExecutionMode code:PointMode, the primitive generator will generate 218one point for each distinct vertex produced by tessellation. 219Otherwise, the tessellator will produce a collection of line segments or 220triangles according to the primitive mode. 221When tessellating triangles or quads in point mode with fractional odd 222spacing, the tessellator may: produce _interior vertices_ that are 223positioned on the edge of the patch if an inner tessellation level is less 224than or equal to one. 225Such vertices are considered distinct from vertices produced by subdividing 226the outer edge of the patch, even if there are pairs of vertices with 227identical coordinates. 228 229 230[[tessellation-primitive-order]] 231== Tessellation Primitive Ordering 232 233Few guarantees are provided for the relative ordering of primitives produced 234by tessellation, as they pertain to <<drawing-primitive-order, primitive 235order>>. 236 237 * The output primitives generated from each input primitive are passed to 238 subsequent pipeline stages in an implementation-dependent order. 239 * All output primitives generated from a given input primitive are passed 240 to subsequent pipeline stages before any output primitives generated 241 from subsequent input primitives. 242 243 244[[tessellation-triangle-tessellation]] 245== Triangle Tessellation 246 247If the tessellation primitive mode is code:Triangles, an equilateral 248triangle is subdivided into a collection of triangles covering the area of 249the original triangle. 250First, the original triangle is subdivided into a collection of concentric 251equilateral triangles. 252The edges of each of these triangles are subdivided, and the area between 253each triangle pair is filled by triangles produced by joining the vertices 254on the subdivided edges. 255The number of concentric triangles and the number of subdivisions along each 256triangle except the outermost is derived from the first inner tessellation 257level. 258The edges of the outermost triangle are subdivided independently, using the 259first, second, and third outer tessellation levels to control the number of 260subdivisions of the [eq]#u = 0# (left), [eq]#v = 0# (bottom), and [eq]#w = 2610# (right) edges, respectively. 262The second inner tessellation level and the fourth outer tessellation level 263have no effect in this mode. 264 265If the first inner tessellation level and all three outer tessellation 266levels are exactly one after clamping and rounding, only a single triangle 267with [eq]#(u,v,w)# coordinates of [eq]#(0,0,1)#, [eq]#(1,0,0)#, and 268[eq]#(0,1,0)# is generated. 269If the inner tessellation level is one and any of the outer tessellation 270levels is greater than one, the inner tessellation level is treated as 271though it were originally specified as [eq]#1 {plus} {epsilon}# and will 272result in a two- or three-segment subdivision depending on the tessellation 273spacing. 274When used with fractional odd spacing, the three-segment subdivision may: 275produce _inner vertices_ positioned on the edge of the triangle. 276 277If any tessellation level is greater than one, tessellation begins by 278producing a set of concentric inner triangles and subdividing their edges. 279First, the three outer edges are temporarily subdivided using the clamped 280and rounded first inner tessellation level and the specified tessellation 281spacing, generating [eq]#n# segments. 282For the outermost inner triangle, the inner triangle is degenerate -- a 283single point at the center of the triangle -- if [eq]#n# is two. 284Otherwise, for each corner of the outer triangle, an inner triangle corner 285is produced at the intersection of two lines extended perpendicular to the 286corner's two adjacent edges running through the vertex of the subdivided 287outer edge nearest that corner. 288If [eq]#n# is three, the edges of the inner triangle are not subdivided and 289is the final triangle in the set of concentric triangles. 290Otherwise, each edge of the inner triangle is divided into [eq]#n - 2# 291segments, with the [eq]#n - 1# vertices of this subdivision produced by 292intersecting the inner edge with lines perpendicular to the edge running 293through the [eq]#n - 1# innermost vertices of the subdivision of the outer 294edge. 295Once the outermost inner triangle is subdivided, the previous subdivision 296process repeats itself, using the generated triangle as an outer triangle. 297This subdivision process is illustrated in <<img-innertri,Inner Triangle 298Tessellation>>. 299 300[[img-innertri]] 301[%inline] 302image::images/innertri.svg[align="center",title="Inner Triangle Tessellation"] 303 304.Caption 305**** 306In the <<img-innertri,Inner Triangle Tessellation>> diagram, inner 307tessellation levels of (a) five and (b) four are shown (not to scale). 308Solid black circles depict vertices along the edges of the concentric 309triangles. 310The edges of inner triangles are subdivided by intersecting the edge with 311segments perpendicular to the edge passing through each inner vertex of the 312subdivided outer edge. 313Dotted lines depict edges connecting corresponding vertices on the inner and 314outer triangle edges. 315**** 316 317Once all the concentric triangles are produced and their edges are 318subdivided, the area between each pair of adjacent inner triangles is filled 319completely with a set of non-overlapping triangles. 320In this subdivision, two of the three vertices of each triangle are taken 321from adjacent vertices on a subdivided edge of one triangle; the third is 322one of the vertices on the corresponding edge of the other triangle. 323If the innermost triangle is degenerate (i.e., a point), the triangle 324containing it is subdivided into six triangles by connecting each of the six 325vertices on that triangle with the center point. 326If the innermost triangle is not degenerate, that triangle is added to the 327set of generated triangles as-is. 328 329After the area corresponding to any inner triangles is filled, the 330tessellator generates triangles to cover the area between the outermost 331triangle and the outermost inner triangle. 332To do this, the temporary subdivision of the outer triangle edge above is 333discarded. 334Instead, the [eq]#u = 0#, [eq]#v = 0#, and [eq]#w = 0# edges are subdivided 335according to the first, second, and third outer tessellation levels, 336respectively, and the tessellation spacing. 337The original subdivision of the first inner triangle is retained. 338The area between the outer and first inner triangles is completely filled by 339non-overlapping triangles as described above. 340If the first (and only) inner triangle is degenerate, a set of triangles is 341produced by connecting each vertex on the outer triangle edges with the 342center point. 343 344After all triangles are generated, each vertex in the subdivided triangle is 345assigned a barycentric (u,v,w) coordinate based on its location relative to 346the three vertices of the outer triangle. 347 348The algorithm used to subdivide the triangular domain in (u,v,w) space into 349individual triangles is implementation-dependent. 350However, the set of triangles produced will completely cover the domain, and 351no portion of the domain will be covered by multiple triangles. 352 353The order in which the vertices for a given output triangle is generated is 354implementation-dependent. 355However, when depicted in a manner similar to <<img-innertri,Inner Triangle 356Tessellation>>, the order of the vertices in each generated triangle will be 357either all clockwise or all counter-clockwise, according to the vertex order 358layout declaration. 359 360 361[[tessellation-quad-tessellation]] 362== Quad Tessellation 363 364If the tessellation primitive mode is code:Quads, a rectangle is subdivided 365into a collection of triangles covering the area of the original rectangle. 366First, the original rectangle is subdivided into a regular mesh of 367rectangles, where the number of rectangles along the [eq]#u = 0# and [eq]#u 368= 1# (vertical) and [eq]#v = 0# and [eq]#v = 1# (horizontal) edges are 369derived from the first and second inner tessellation levels, respectively. 370All rectangles, except those adjacent to one of the outer rectangle edges, 371are decomposed into triangle pairs. 372The outermost rectangle edges are subdivided independently, using the first, 373second, third, and fourth outer tessellation levels to control the number of 374subdivisions of the [eq]#u = 0# (left), [eq]#v = 0# (bottom), [eq]#u = 1# 375(right), and [eq]#v = 1# (top) edges, respectively. 376The area between the inner rectangles of the mesh and the outer rectangle 377edges are filled by triangles produced by joining the vertices on the 378subdivided outer edges to the vertices on the edge of the inner rectangle 379mesh. 380 381If both clamped inner tessellation levels and all four clamped outer 382tessellation levels are exactly one, only a single triangle pair covering 383the outer rectangle is generated. 384Otherwise, if either clamped inner tessellation level is one, that 385tessellation level is treated as though it were originally specified as 386[eq]#1 {plus} {epsilon}# and will result in a two- or three-segment 387subdivision depending on the tessellation spacing. 388When used with fractional odd spacing, the three-segment subdivision may: 389produce _inner vertices_ positioned on the edge of the rectangle. 390 391If any tessellation level is greater than one, tessellation begins by 392subdividing the [eq]#u = 0# and [eq]#u = 1# edges of the outer rectangle 393into [eq]#m# segments using the clamped and rounded first inner tessellation 394level and the tessellation spacing. 395The [eq]#v = 0# and [eq]#v = 1# edges are subdivided into [eq]#n# segments 396using the second inner tessellation level. 397Each vertex on the [eq]#u = 0# and [eq]#v = 0# edges are joined with the 398corresponding vertex on the [eq]#u = 1# and [eq]#v = 1# edges to produce a 399set of vertical and horizontal lines that divide the rectangle into a grid 400of smaller rectangles. 401The primitive generator emits a pair of non-overlapping triangles covering 402each such rectangle not adjacent to an edge of the outer rectangle. 403The boundary of the region covered by these triangles forms an inner 404rectangle, the edges of which are subdivided by the grid vertices that lie 405on the edge. 406If either [eq]#m# or [eq]#n# is two, the inner rectangle is degenerate, and 407one or both of the rectangle's _edges_ consist of a single point. 408This subdivision is illustrated in Figure <<img-innerquad,Inner Quad 409Tessellation>>. 410 411[[img-innerquad]] 412[%inline] 413image::images/innerquad.svg[align="center",title="Inner Quad Tessellation"] 414 415.Caption 416**** 417In the <<img-innerquad,Inner Quad Tessellation>> diagram, inner quad 418tessellation levels of (a) [eq]#(4,2)# and (b) [eq]#(7,4)# are shown. 419The regions highlighted in red in figure (b) depict the 10 inner rectangles, 420each of which will be subdivided into two triangles. 421Solid black circles depict vertices on the boundary of the outer and inner 422rectangles, where the inner rectangle on the top figure is degenerate (a 423single line segment). 424Dotted lines depict the horizontal and vertical edges connecting 425corresponding vertices on the inner and outer rectangle edges. 426**** 427 428After the area corresponding to the inner rectangle is filled, the 429tessellator must: produce triangles to cover the area between the inner and 430outer rectangles. 431To do this, the subdivision of the outer rectangle edge above is discarded. 432Instead, the [eq]#u = 0#, [eq]#v = 0#, [eq]#u = 1#, and [eq]#v = 1# edges 433are subdivided according to the first, second, third, and fourth outer 434tessellation levels, respectively, and the tessellation spacing. 435The original subdivision of the inner rectangle is retained. 436The area between the outer and inner rectangles is completely filled by 437non-overlapping triangles. 438Two of the three vertices of each triangle are adjacent vertices on a 439subdivided edge of one rectangle; the third is one of the vertices on the 440corresponding edge of the other triangle. 441If either edge of the innermost rectangle is degenerate, the area near the 442corresponding outer edges is filled by connecting each vertex on the outer 443edge with the single vertex making up the _inner edge_. 444 445The algorithm used to subdivide the rectangular domain in (u,v) space into 446individual triangles is implementation-dependent. 447However, the set of triangles produced will completely cover the domain, and 448no portion of the domain will be covered by multiple triangles. 449 450The order in which the vertices for a given output triangle is generated is 451implementation-dependent. 452However, when depicted in a manner similar to <<img-innerquad,Inner Quad 453Tessellation>>, the order of the vertices in each generated triangle will be 454either all clockwise or all counter-clockwise, according to the vertex order 455layout declaration. 456 457 458[[tessellation-isoline-tessellation]] 459== Isoline Tessellation 460 461If the tessellation primitive mode is code:IsoLines, a set of independent 462horizontal line segments is drawn. 463The segments are arranged into connected strips called _isolines_, where the 464vertices of each isoline have a constant v coordinate and u coordinates 465covering the full range [eq]#[0,1]#. 466The number of isolines generated is derived from the first outer 467tessellation level; the number of segments in each isoline is derived from 468the second outer tessellation level. 469Both inner tessellation levels and the third and fourth outer tessellation 470levels have no effect in this mode. 471 472As with quad tessellation above, isoline tessellation begins with a 473rectangle. 474The [eq]#u = 0# and [eq]#u = 1# edges of the rectangle are subdivided 475according to the first outer tessellation level. 476For the purposes of this subdivision, the tessellation spacing mode is 477ignored and treated as equal_spacing. 478An isoline is drawn connecting each vertex on the [eq]#u = 0# rectangle edge 479to the corresponding vertex on the [eq]#u = 1# rectangle edge, except that 480no line is drawn between (0,1) and (1,1). 481If the number of isolines on the subdivided [eq]#u = 0# and [eq]#u = 1# 482edges is [eq]#n#, this process will result in [eq]#n# equally spaced lines 483with constant v coordinates of 0, latexmath:[\frac{1}{n}, \frac{2}{n}, 484\ldots, \frac{n-1}{n}]. 485 486Each of the [eq]#n# isolines is then subdivided according to the second 487outer tessellation level and the tessellation spacing, resulting in [eq]#m# 488line segments. 489Each segment of each line is emitted by the tessellator. 490 491The order in which the vertices for a given output line is generated is 492implementation-dependent. 493 494 495== Tessellation Pipeline State 496 497The pname:pTessellationState member of slink:VkGraphicsPipelineCreateInfo 498points to a structure of type sname:VkPipelineTessellationStateCreateInfo. 499 500[open,refpage='VkPipelineTessellationStateCreateInfo',desc='Structure specifying parameters of a newly created pipeline tessellation state',type='structs'] 501-- 502 503The sname:VkPipelineTessellationStateCreateInfo structure is defined as: 504 505include::../api/structs/VkPipelineTessellationStateCreateInfo.txt[] 506 507 * pname:sType is the type of this structure. 508 * pname:pNext is `NULL` or a pointer to an extension-specific structure. 509 * pname:flags is reserved for future use. 510 * pname:patchControlPoints number of control points per patch. 511 512.Valid Usage 513**** 514 * [[VUID-VkPipelineTessellationStateCreateInfo-patchControlPoints-01214]] 515 pname:patchControlPoints must: be greater than zero and less than or 516 equal to sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize 517**** 518 519include::../validity/structs/VkPipelineTessellationStateCreateInfo.txt[] 520-- 521 522[open,refpage='VkPipelineTessellationStateCreateFlags',desc='Reserved for future use',type='enums'] 523-- 524include::../api/flags/VkPipelineTessellationStateCreateFlags.txt[] 525 526sname:VkPipelineTessellationStateCreateFlags is a bitmask type for setting a 527mask, but is currently reserved for future use. 528-- 529 530ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 531 532[open,refpage='VkPipelineTessellationDomainOriginStateCreateInfo',desc='Structure specifying the orientation of the tessellation domain',type='structs'] 533-- 534 535The sname:VkPipelineTessellationDomainOriginStateCreateInfo structure is 536defined as: 537 538include::../api/structs/VkPipelineTessellationDomainOriginStateCreateInfo.txt[] 539 540ifdef::VK_KHR_maintenance2[] 541or the equivalent 542 543include::../api/structs/VkPipelineTessellationDomainOriginStateCreateInfoKHR.txt[] 544endif::VK_KHR_maintenance2[] 545 546 * pname:sType is the type of this structure. 547 * pname:pNext is `NULL` or a pointer to an extension-specific structure. 548 * pname:domainOrigin controls the origin of the tessellation domain space, 549 and is of type elink:VkTessellationDomainOrigin. 550 551If the sname:VkPipelineTessellationDomainOriginStateCreateInfo structure is 552included in the pname:pNext chain of 553slink:VkPipelineTessellationStateCreateInfo, it controls the origin of the 554tessellation domain. 555If this structure is not present, it is as if pname:domainOrigin were 556ename:VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT. 557 558include::../validity/structs/VkPipelineTessellationDomainOriginStateCreateInfo.txt[] 559-- 560 561[open,refpage='VkTessellationDomainOrigin',desc='Enum describing tessellation domain origin',type='enums'] 562-- 563 564The possible tessellation domain origins are specified by the 565elink:VkTessellationDomainOrigin enumeration: 566 567include::../api/enums/VkTessellationDomainOrigin.txt[] 568 569ifdef::VK_KHR_maintenance2[] 570or the equivalent 571 572include::../api/enums/VkTessellationDomainOriginKHR.txt[] 573endif::VK_KHR_maintenance2[] 574 575 * ename:VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT specifies that the origin 576 of the domain space is in the upper left corner, as shown in figure 577 <<img-tessellation-topology-ul>>. 578 * ename:VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT specifies that the origin 579 of the domain space is in the lower left corner, as shown in figure 580 <<img-tessellation-topology-ll>>. 581 582This enum affects how the code:VertexOrderCw and code:VertexOrderCcw 583tessellation execution modes are interpreted, since the winding is defined 584relative to the orientation of the domain. 585 586-- 587 588endif::VK_VERSION_1_1,VK_KHR_maintenance2[] 589