Skip to content

Commit 501901e

Browse files
authored
[HLSL][NFC] Add test check to make sure the resource handle gets stored in the resource global (#124866)
1 parent 5566bfa commit 501901e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/test/CodeGenHLSL/resource-bindings.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
// CHECK: define internal void @_init_resource_U0S0()
44
// CHECK: %U0S0_h = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_v4f32_1_0_0t(i32 0, i32 0, i32 1, i32 0, i1 false)
5+
// CHECK: store target("dx.TypedBuffer", <4 x float>, 1, 0, 0) %U0S0_h, ptr @U0S0, align 4
56
RWBuffer<float4> U0S0 : register(u0);
67

78
// CHECK: define internal void @_init_resource_U5S3()
89
// CHECK: %U5S3_h = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0_0t(i32 3, i32 5, i32 1, i32 0, i1 false)
10+
// CHECK: store target("dx.TypedBuffer", float, 1, 0, 0) %U5S3_h, ptr @U5S3, align 4
911
RWBuffer<float> U5S3 : register(u5, space3);
1012

1113
// CHECK: define internal void @_init_resource_T2S2()
1214
// CHECK: %T2S2_h = call target("dx.RawBuffer", i32, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_i32_0_0t(i32 2, i32 2, i32 1, i32 0, i1 false)
15+
// CHECK: store target("dx.RawBuffer", i32, 0, 0) %T2S2_h, ptr @T2S2, align 4
1316
StructuredBuffer<int> T2S2 : register(t2, space2);
1417
struct S {
1518
float4 f;
@@ -18,6 +21,7 @@ struct S {
1821

1922
// CHECK: define internal void @_init_resource_T3S0()
2023
// CHECK: %T3S0_h = call target("dx.RawBuffer", %struct.S, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_s_struct.Ss_0_0t(i32 0, i32 3, i32 1, i32 0, i1 false)
24+
// CHECK: store target("dx.RawBuffer", %struct.S, 0, 0) %T3S0_h, ptr @T3S0, align 4
2125
StructuredBuffer<S> T3S0 : register(t3);
2226

2327
// CHECK: define void @main()

0 commit comments

Comments
 (0)