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