Merge pull request #2892 from greg-lunarg/mb
[platform/upstream/glslang.git] / Test / hlsl.hull.ctrlpt-1.tesc
1 // *** 
2 // per-control-point invocation of PCF from entry point return value
3 // ***
4
5 struct hs_in_t
6 {
7     float3 val : TEXCOORD0;
8 };
9
10 struct hs_pcf_t
11 {
12     float tfactor[3] : SV_TessFactor; // must turn into a size 4 array in SPIR-V
13     float flInFactor : SV_InsideTessFactor; // must turn into a size 2 array in SPIR-V
14 }; 
15
16 struct hs_out_t
17 {
18     float3 val : TEXCOORD0; 
19 };
20
21 [ domain ("tri") ]
22 [ partitioning ("fractional_odd") ]
23 [ outputtopology ("triangle_cw") ]
24 [ outputcontrolpoints (3) ]
25 [ patchconstantfunc ( "PCF" ) ]
26 hs_out_t main (InputPatch <hs_in_t, 3> i , uint cpid : SV_OutputControlPointID)
27 {
28     hs_out_t o;
29     o.val = cpid;
30     return o;
31 }
32
33 hs_pcf_t PCF( const OutputPatch <hs_out_t, 3> pcf_out)
34 {
35     hs_pcf_t o;
36
37     o.tfactor[0] = pcf_out[0].val.x;
38     o.tfactor[1] = pcf_out[1].val.x;
39     o.tfactor[2] = pcf_out[2].val.x;
40     o.flInFactor = 4;
41
42     return o;
43 }