• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1struct HullInputType
2{
3    float4 position : SV_Position;
4};
5
6struct ConstantOutputType
7{
8    float edges[3] : SV_TessFactor;
9    float inside : SV_InsideTessFactor;
10};
11struct EmptyStruct {};
12
13struct HullOutputType {};
14
15void blob(InputPatch<HullInputType, 3> patch)
16{
17}
18
19ConstantOutputType ColorPatchConstantFunction(InputPatch<HullInputType, 3> inputPatch, uint patchId : SV_PrimitiveID)
20{
21    ConstantOutputType output;
22
23	// Set the tessellation factors for the three edges of the triangle.
24    output.edges[0] = 2;
25    output.edges[1] = 2;
26    output.edges[2] = 2;
27
28	// Set the tessellation factor for tessallating inside the triangle.
29    output.inside = 2;
30
31    return output;
32}
33
34
35// Hull Shader
36[domain("tri")]
37[partitioning("integer")]
38[outputtopology("triangle_cw")]
39[outputcontrolpoints(3)]
40[patchconstantfunc("ColorPatchConstantFunction")]
41HullOutputType main(EmptyStruct stage_input, InputPatch<HullInputType, 3> patch, uint pointId : SV_OutputControlPointID, uint patchId : SV_PrimitiveID)
42{
43    HullOutputType output;
44    blob(patch);
45
46    return output;
47}
48
49