File: hlsl.emptystructreturn.tesc

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (48 lines) | stat: -rw-r--r-- 1,071 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
struct HullInputType
{
    float4 position : SV_Position;
};

struct ConstantOutputType
{
    float edges[3] : SV_TessFactor;
    float inside : SV_InsideTessFactor;
};
struct EmptyStruct {};

struct HullOutputType {};

void blob(InputPatch<HullInputType, 3> patch)
{
}

ConstantOutputType ColorPatchConstantFunction(InputPatch<HullInputType, 3> inputPatch, uint patchId : SV_PrimitiveID)
{
    ConstantOutputType output;

	// Set the tessellation factors for the three edges of the triangle.
    output.edges[0] = 2;
    output.edges[1] = 2;
    output.edges[2] = 2;

	// Set the tessellation factor for tessallating inside the triangle.
    output.inside = 2;

    return output;
}


// Hull Shader
[domain("tri")]
[partitioning("integer")]
[outputtopology("triangle_cw")]
[outputcontrolpoints(3)]
[patchconstantfunc("ColorPatchConstantFunction")]
HullOutputType main(EmptyStruct stage_input, InputPatch<HullInputType, 3> patch, uint pointId : SV_OutputControlPointID, uint patchId : SV_PrimitiveID)
{
    HullOutputType output;
    blob(patch);

    return output;
}