hs.pcf.void.hlsl 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Run: %dxc -T hs_6_0 -E main
  2. #include "bezier_common_hull.hlsl"
  3. // CHECK: [[fType:%\d+]] = OpTypeFunction %HS_CONSTANT_DATA_OUTPUT
  4. // CHECK: %main = OpFunction %void None {{%\d+}}
  5. // CHECK: {{%\d+}} = OpFunctionCall %HS_CONSTANT_DATA_OUTPUT %PCF
  6. // CHECK: %PCF = OpFunction %HS_CONSTANT_DATA_OUTPUT None [[fType]]
  7. // PCF does not take any args
  8. HS_CONSTANT_DATA_OUTPUT PCF() {
  9. HS_CONSTANT_DATA_OUTPUT Output;
  10. // Must initialize Edges and Inside; otherwise HLSL validation will fail.
  11. Output.Edges[0] = 1.0;
  12. Output.Edges[1] = 2.0;
  13. Output.Edges[2] = 3.0;
  14. Output.Edges[3] = 4.0;
  15. Output.Inside[0] = 5.0;
  16. Output.Inside[1] = 6.0;
  17. return Output;
  18. }
  19. [domain("quad")]
  20. [partitioning("fractional_odd")]
  21. [outputtopology("triangle_cw")]
  22. [outputcontrolpoints(16)]
  23. [patchconstantfunc("PCF")]
  24. BEZIER_CONTROL_POINT main(InputPatch<VS_CONTROL_POINT_OUTPUT, MAX_POINTS> ip, uint i : SV_OutputControlPointID, uint PatchID : SV_PrimitiveID) {
  25. VS_CONTROL_POINT_OUTPUT vsOutput;
  26. BEZIER_CONTROL_POINT result;
  27. result.vPosition = vsOutput.vPosition;
  28. return result;
  29. }