1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s
\r
3 // CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", i16, 0, 0) }
\r
4 // CHECK: %"class.hlsl::StructuredBuffer.0" = type { target("dx.RawBuffer", i16, 0, 0) }
\r
5 // CHECK: %"class.hlsl::StructuredBuffer.1" = type { target("dx.RawBuffer", i32, 0, 0) }
\r
6 // CHECK: %"class.hlsl::StructuredBuffer.2" = type { target("dx.RawBuffer", i32, 0, 0) }
\r
7 // CHECK: %"class.hlsl::StructuredBuffer.3" = type { target("dx.RawBuffer", i64, 0, 0) }
\r
8 // CHECK: %"class.hlsl::StructuredBuffer.4" = type { target("dx.RawBuffer", i64, 0, 0) }
\r
9 // CHECK: %"class.hlsl::StructuredBuffer.5" = type { target("dx.RawBuffer", half, 0, 0) }
\r
10 // CHECK: %"class.hlsl::StructuredBuffer.6" = type { target("dx.RawBuffer", float, 0, 0) }
\r
11 // CHECK: %"class.hlsl::StructuredBuffer.7" = type { target("dx.RawBuffer", double, 0, 0) }
\r
12 // CHECK: %"class.hlsl::StructuredBuffer.8" = type { target("dx.RawBuffer", <4 x i16>, 0, 0) }
\r
13 // CHECK: %"class.hlsl::StructuredBuffer.9" = type { target("dx.RawBuffer", <3 x i32>, 0, 0) }
\r
14 // CHECK: %"class.hlsl::StructuredBuffer.10" = type { target("dx.RawBuffer", <2 x half>, 0, 0) }
\r
15 // CHECK: %"class.hlsl::StructuredBuffer.11" = type { target("dx.RawBuffer", <3 x float>, 0, 0) }
\r
17 StructuredBuffer<int16_t> BufI16;
\r
18 StructuredBuffer<uint16_t> BufU16;
\r
19 StructuredBuffer<int> BufI32;
\r
20 StructuredBuffer<uint> BufU32;
\r
21 StructuredBuffer<int64_t> BufI64;
\r
22 StructuredBuffer<uint64_t> BufU64;
\r
23 StructuredBuffer<half> BufF16;
\r
24 StructuredBuffer<float> BufF32;
\r
25 StructuredBuffer<double> BufF64;
\r
26 StructuredBuffer< vector<int16_t, 4> > BufI16x4;
\r
27 StructuredBuffer< vector<uint, 3> > BufU32x3;
\r
28 StructuredBuffer<half2> BufF16x2;
\r
29 StructuredBuffer<float3> BufF32x3;
\r
30 // TODO: StructuredBuffer<snorm half> BufSNormF16;
\r
31 // TODO: StructuredBuffer<unorm half> BufUNormF16;
\r
32 // TODO: StructuredBuffer<snorm float> BufSNormF32;
\r
33 // TODO: StructuredBuffer<unorm float> BufUNormF32;
\r
34 // TODO: StructuredBuffer<snorm double> BufSNormF64;
\r
35 // TODO: StructuredBuffer<unorm double> BufUNormF64;
\r
38 void main(int GI : SV_GroupIndex) {
\r
39 int16_t v1 = BufI16[GI];
\r
40 uint16_t v2 = BufU16[GI];
\r
41 int v3 = BufI32[GI];
\r
42 uint v4 = BufU32[GI];
\r
43 int64_t v5 = BufI64[GI];
\r
44 uint64_t v6 = BufU64[GI];
\r
45 half v7 = BufF16[GI];
\r
46 float v8 = BufF32[GI];
\r
47 double v9 = BufF64[GI];
\r
48 vector<int16_t,4> v10 = BufI16x4[GI];
\r
49 vector<int, 3> v11 = BufU32x3[GI];
\r
50 half2 v12 = BufF16x2[GI];
\r
51 float3 v13 = BufF32x3[GI];
\r