LoopDawg | a5d8616 | 2017-09-10 09:46:55 -0600 | [diff] [blame] | 1 | |
LoopDawg | 4a145db | 2017-09-13 08:44:39 -0600 | [diff] [blame] | 2 | // Test mixed InputPatch structure: user and builtin members. Hull shaders involve extra |
| 3 | // logic in this case due to patch constant function call synthesis. |
LoopDawg | a5d8616 | 2017-09-10 09:46:55 -0600 | [diff] [blame] | 4 | |
LoopDawg | 4a145db | 2017-09-13 08:44:39 -0600 | [diff] [blame] | 5 | // This example tests the main EP and the PCF EP both having an input patch. |
| 6 | |
| 7 | struct HS_Main_Output |
LoopDawg | a5d8616 | 2017-09-10 09:46:55 -0600 | [diff] [blame] | 8 | { |
LoopDawg | 4a145db | 2017-09-13 08:44:39 -0600 | [diff] [blame] | 9 | float4 m_Position : SV_POSITION ; |
| 10 | }; |
| 11 | |
| 12 | struct HS_Output |
| 13 | { |
| 14 | float fTessFactor [ 3 ] : SV_TessFactor ; |
| 15 | float fInsideTessFactor : SV_InsideTessFactor ; |
| 16 | }; |
| 17 | |
| 18 | struct HS_Input |
| 19 | { |
| 20 | float4 m_Position : SV_POSITION; |
| 21 | float4 m_Normal : TEXCOORD2; |
| 22 | }; |
| 23 | |
| 24 | HS_Output HS_ConstFunc ( InputPatch < HS_Input , 3 > I ) |
| 25 | { |
| 26 | HS_Output O = (HS_Output)0; |
| 27 | |
| 28 | O.fInsideTessFactor = I [ 0 ].m_Position.w + I [ 0 ].m_Normal.w; |
| 29 | |
| 30 | return O; |
| 31 | } |
| 32 | |
| 33 | [ domain ( "tri" ) ] |
| 34 | [ partitioning ( "fractional_odd" ) ] |
| 35 | [ outputtopology ( "triangle_cw" ) ] |
| 36 | [ patchconstantfunc ( "HS_ConstFunc" ) ] |
| 37 | [ outputcontrolpoints ( 3 ) ] |
| 38 | HS_Main_Output main( InputPatch < HS_Input , 3 > I , uint cpid : SV_OutputControlPointID ) |
| 39 | { |
| 40 | HS_Main_Output output = ( HS_Main_Output ) 0 ; |
| 41 | output.m_Position = 0; |
| 42 | return output ; |
LoopDawg | a5d8616 | 2017-09-10 09:46:55 -0600 | [diff] [blame] | 43 | } |