constant.array.hlsl 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. // Run: %dxc -T vs_6_0 -E main
  2. struct S {
  3. float2 f[2];
  4. };
  5. void main() {
  6. // CHECK: [[v0102:%\d+]] = OpCompositeConstruct %v2float %float_1 %float_2
  7. // CHECK-NEXT: [[v0304:%\d+]] = OpCompositeConstruct %v2float %float_3 %float_4
  8. // CHECK-NEXT: [[vf0:%\d+]] = OpCompositeConstruct %_arr_v2float_uint_2 [[v0102]] [[v0304]]
  9. // CHECK-NEXT: [[vs0:%\d+]] = OpCompositeConstruct %S [[vf0]]
  10. // CHECK-NEXT: [[v0506:%\d+]] = OpCompositeConstruct %v2float %float_5 %float_6
  11. // CHECK-NEXT: [[v0708:%\d+]] = OpCompositeConstruct %v2float %float_7 %float_8
  12. // CHECK-NEXT: [[vf1:%\d+]] = OpCompositeConstruct %_arr_v2float_uint_2 [[v0506]] [[v0708]]
  13. // CHECK-NEXT: [[vs1:%\d+]] = OpCompositeConstruct %S [[vf1]]
  14. // CHECK-NEXT: [[v0910:%\d+]] = OpCompositeConstruct %v2float %float_9 %float_10
  15. // CHECK-NEXT: [[v1112:%\d+]] = OpCompositeConstruct %v2float %float_11 %float_12
  16. // CHECK-NEXT: [[vf2:%\d+]] = OpCompositeConstruct %_arr_v2float_uint_2 [[v0910]] [[v1112]]
  17. // CHECK-NEXT: [[vs2:%\d+]] = OpCompositeConstruct %S [[vf2]]
  18. // CHECK-NEXT: [[v1314:%\d+]] = OpCompositeConstruct %v2float %float_13 %float_14
  19. // CHECK-NEXT: [[v1516:%\d+]] = OpCompositeConstruct %v2float %float_15 %float_16
  20. // CHECK-NEXT: [[vf3:%\d+]] = OpCompositeConstruct %_arr_v2float_uint_2 [[v1314]] [[v1516]]
  21. // CHECK-NEXT: [[vs3:%\d+]] = OpCompositeConstruct %S [[vf3]]
  22. // CHECK-NEXT: [[va4:%\d+]] = OpCompositeConstruct %_arr_S_uint_4 [[vs0]] [[vs1]] [[vs2]] [[vs3]]
  23. // CHECK-NEXT: {{%\d+}} = OpCompositeConstruct %_arr__arr_S_uint_4_uint_1 [[va4]]
  24. S var[1][4] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,
  25. 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0};
  26. }