|
| 1 | +// RUN: %dxc -E main -T ps_6_2 -enable-16bit-types %s | FileCheck %s |
| 2 | + |
| 3 | +// CHECK: [9 x half] [half 0xH3C00, half 0xH4400, half 0xH4700, half 0xH4000, half 0xH4500, half 0xH4800, half 0xH4200, half 0xH4600, half 0xH4880] |
| 4 | +// CHECK: fptoui float |
| 5 | +// CHECK: getelementptr [9 x half] |
| 6 | +// CHECK: load half |
| 7 | +// CHECK: call half @dx.op.tertiary.f16(i32 46, half 0xH4000, |
| 8 | +// CHECK: lshr i32 411, |
| 9 | +// CHECK: icmp ne |
| 10 | +// CHECK: %[[all:[^ ]*]] = uitofp i1 %{{.*}} to float |
| 11 | +// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, |
| 12 | +// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, |
| 13 | +// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, |
| 14 | +// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %[[all]]) |
| 15 | + |
| 16 | +struct Foo { |
| 17 | + half3x3 hmat; |
| 18 | + bool3x3 bmat; |
| 19 | +}; |
| 20 | + |
| 21 | +Foo fn() { |
| 22 | + Foo foo; |
| 23 | + foo.hmat = float3x3(1, 2, 3, 4, 5, 6, 7, 8, 9); |
| 24 | + foo.bmat = int3x3(1, 2, 0, -5, 14, 3, 0, 0, 21); |
| 25 | + return foo; |
| 26 | +} |
| 27 | + |
| 28 | +float4 main(float a : A) : SV_Target { |
| 29 | + Foo foo = fn(); |
| 30 | + float3 v = float3(a, a * a, a + a); |
| 31 | + return float4(mul(foo.hmat, foo.hmat[a]), all(foo.bmat[a])); |
| 32 | +} |
0 commit comments