constant.matrix.hlsl 1.1 KB

12345678910111213141516171819202122232425262728
  1. // Run: %dxc -T vs_6_0 -E main
  2. // TODO: actually emit constant SPIR-V instructions for the following tests.
  3. void main() {
  4. // CHECK: OpStore %a %float_1
  5. float1x1 a = float1x1(1.);
  6. // CHECK-NEXT: [[b:%\d+]] = OpCompositeConstruct %v2float %float_2 %float_3
  7. // CHECK-NEXT: OpStore %b [[b]]
  8. float1x2 b = float1x2(2., 3.);
  9. // CHECK-NEXT: [[c:%\d+]] = OpCompositeConstruct %v2float %float_4 %float_5
  10. // CHECK-NEXT: OpStore %c [[c]]
  11. float2x1 c = float2x1(4., 5.);
  12. // CHECK-NEXT: [[d0:%\d+]] = OpCompositeConstruct %v3float %float_6 %float_7 %float_8
  13. // CHECK-NEXT: [[d1:%\d+]] = OpCompositeConstruct %v3float %float_9 %float_10 %float_11
  14. // CHECK-NEXT: [[d:%\d+]] = OpCompositeConstruct %mat2v3float [[d0]] [[d1]]
  15. // CHECK-NEXT: OpStore %d [[d]]
  16. float2x3 d = float2x3(6., 7., 8., 9., 10., 11.);
  17. // CHECK-NEXT: [[e0:%\d+]] = OpCompositeConstruct %v3int %int_6 %int_7 %int_8
  18. // CHECK-NEXT: [[e1:%\d+]] = OpCompositeConstruct %v3int %int_9 %int_10 %int_11
  19. // CHECK-NEXT: [[e:%\d+]] = OpCompositeConstruct %_arr_v3int_uint_2 [[e0]] [[e1]]
  20. // CHECK-NEXT: OpStore %e [[e]]
  21. int2x3 e = int2x3(6, 7, 8, 9, 10, 11);
  22. }