[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / CodeGenHLSL / builtins / RasterizerOrderedStructuredBuffer-elementtype.hlsl
blob68d626de689f2e1d1a1020eaebdf45d8db2dfdfc
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=DXIL\r
2 \r
3 struct MyStruct {\r
4   float4 a;\r
5   int2 b;\r
6 };\r
7 \r
8 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer" = type { target("dx.RawBuffer", i16, 1, 1) }\r
9 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.0" = type { target("dx.RawBuffer", i16, 1, 1) }\r
10 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.1" = type { target("dx.RawBuffer", i32, 1, 1) }\r
11 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.2" = type { target("dx.RawBuffer", i32, 1, 1) }\r
12 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.3" = type { target("dx.RawBuffer", i64, 1, 1) }\r
13 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.4" = type { target("dx.RawBuffer", i64, 1, 1) }\r
14 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.5" = type { target("dx.RawBuffer", half, 1, 1)  }\r
15 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.6" = type { target("dx.RawBuffer", float, 1, 1) }\r
16 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.7" = type { target("dx.RawBuffer", double, 1, 1) }\r
17 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.8" = type { target("dx.RawBuffer", <4 x i16>, 1, 1) }\r
18 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.9" = type { target("dx.RawBuffer", <3 x i32>, 1, 1) }\r
19 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.10" = type { target("dx.RawBuffer", <2 x half>, 1, 1) }\r
20 // DXIL: %"class.hlsl::RasterizerOrderedStructuredBuffer.11" = type { target("dx.RawBuffer", <3 x float>, 1, 1) }\r
21 // DXIL: %struct.MyStruct = type { <4 x float>, <2 x i32>, [8 x i8] }\r
23 RasterizerOrderedStructuredBuffer<int16_t> BufI16;\r
24 RasterizerOrderedStructuredBuffer<uint16_t> BufU16;\r
25 RasterizerOrderedStructuredBuffer<int> BufI32;\r
26 RasterizerOrderedStructuredBuffer<uint> BufU32;\r
27 RasterizerOrderedStructuredBuffer<int64_t> BufI64;\r
28 RasterizerOrderedStructuredBuffer<uint64_t> BufU64;\r
29 RasterizerOrderedStructuredBuffer<half> BufF16;\r
30 RasterizerOrderedStructuredBuffer<float> BufF32;\r
31 RasterizerOrderedStructuredBuffer<double> BufF64;\r
32 RasterizerOrderedStructuredBuffer< vector<int16_t, 4> > BufI16x4;\r
33 RasterizerOrderedStructuredBuffer< vector<uint, 3> > BufU32x3;\r
34 RasterizerOrderedStructuredBuffer<half2> BufF16x2;\r
35 RasterizerOrderedStructuredBuffer<float3> BufF32x3;\r
36 // TODO: RasterizerOrderedStructuredBuffer<snorm half> BufSNormF16;\r
37 // TODO: RasterizerOrderedStructuredBuffer<unorm half> BufUNormF16;\r
38 // TODO: RasterizerOrderedStructuredBuffer<snorm float> BufSNormF32;\r
39 // TODO: RasterizerOrderedStructuredBuffer<unorm float> BufUNormF32;\r
40 // TODO: RasterizerOrderedStructuredBuffer<snorm double> BufSNormF64;\r
41 // TODO: RasterizerOrderedStructuredBuffer<unorm double> BufUNormF64;\r
42 RasterizerOrderedStructuredBuffer<MyStruct> BufMyStruct;\r
44 [numthreads(1,1,1)]\r
45 void main(int GI : SV_GroupIndex) {\r
46   BufI16[GI] = 0;\r
47   BufU16[GI] = 0;\r
48   BufI32[GI] = 0;\r
49   BufU32[GI] = 0;\r
50   BufI64[GI] = 0;\r
51   BufU64[GI] = 0;\r
52   BufF16[GI] = 0;\r
53   BufF32[GI] = 0;\r
54   BufF64[GI] = 0;\r
55   BufI16x4[GI] = 0;\r
56   BufU32x3[GI] = 0;\r
57   BufF16x2[GI] = 0;\r
58   BufF32x3[GI] = 0;\r
59   BufMyStruct[GI] = {{0,0,0,0},{0,0}};\r
60 }\r