hlsl.hull.4.tesc 1.1 KB

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