semantic.inside-tess-factor.ds.array1.hlsl 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Run: %dxc -T ds_6_0 -E main
  2. // CHECK: %gl_TessLevelInner = OpVariable %_ptr_Input__arr_float_uint_2 Input
  3. struct HS_CONSTANT_DATA_OUTPUT
  4. {
  5. float Edges[3] : SV_TessFactor;
  6. // According to HLSL doc, this should actually be a scalar float.
  7. // But developers sometimes use float[1].
  8. float Inside[1] : SV_InsideTessFactor;
  9. };
  10. // Output control point (output of hull shader)
  11. struct BEZIER_CONTROL_POINT
  12. {
  13. float3 vPosition : BEZIERPOS;
  14. };
  15. // The domain shader outputs
  16. struct DS_OUTPUT
  17. {
  18. float4 vPosition : SV_POSITION;
  19. };
  20. [domain("tri")]
  21. DS_OUTPUT main( HS_CONSTANT_DATA_OUTPUT input,
  22. float2 UV : SV_DomainLocation,
  23. const OutputPatch<BEZIER_CONTROL_POINT, 16> bezpatch )
  24. {
  25. // CHECK: [[tli:%\d+]] = OpLoad %_arr_float_uint_2 %gl_TessLevelInner
  26. // CHECK-NEXT: [[e0:%\d+]] = OpCompositeExtract %float [[tli]] 0
  27. // CHECK-NEXT: [[arr1:%\d+]] = OpCompositeConstruct %_arr_float_uint_1 [[e0]]
  28. // CHECK-NEXT: {{%\d+}} = OpCompositeConstruct %HS_CONSTANT_DATA_OUTPUT {{%\d+}} [[arr1]]
  29. DS_OUTPUT Output;
  30. return Output;
  31. }