hlsl.hull.ctrlpt-2.tesc 1004 B

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