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