3
3
4
4
; CHECK-PRETTY: Type Format Dim ID HLSL Bind Count
5
5
; CHECK-PRETTY: ---------- ------- ----------- ------- -------------- ---------
6
- ; CHECK-PRETTY: SRV f32 buf T0 t0 unbounded
6
+ ; CHECK-PRETTY: SRV f32 buf T0 t7 unbounded
7
7
; CHECK-PRETTY: SRV byte r/o T1 t8,space1 1
8
8
; CHECK-PRETTY: SRV struct r/o T2 t2,space4 1
9
9
; CHECK-PRETTY: SRV u32 buf T3 t3,space5 24
@@ -18,48 +18,49 @@ define void @test_bindings() {
18
18
; RWBuffer<float4> Buf : register(u5, space3)
19
19
%typed0 = call target ("dx.TypedBuffer" , <4 x float >, 1 , 0 , 0 )
20
20
@llvm.dx.handle.fromBinding.tdx.TypedBuffer_v4f32_1_0_0 (
21
- i32 3 , i32 5 , i32 1 , i32 4 , i1 false )
22
- ; CHECK: [[BUF0:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 5, i32 5, i32 3, i8 1 }, i32 4 , i1 false)
21
+ i32 3 , i32 5 , i32 1 , i32 0 , i1 false )
22
+ ; CHECK: [[BUF0:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 5, i32 5, i32 3, i8 1 }, i32 5 , i1 false)
23
23
; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF0]], %dx.types.ResourceProperties { i32 4106, i32 1033 })
24
24
25
25
; RWBuffer<int> Buf : register(u7, space2)
26
26
%typed1 = call target ("dx.TypedBuffer" , i32 , 1 , 0 , 1 )
27
27
@llvm.dx.handle.fromBinding.tdx.TypedBuffer_i32_1_0_0t (
28
- i32 2 , i32 7 , i32 1 , i32 6 , i1 false )
29
- ; CHECK: [[BUF1:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 7, i32 7, i32 2, i8 1 }, i32 6 , i1 false)
28
+ i32 2 , i32 7 , i32 1 , i32 0 , i1 false )
29
+ ; CHECK: [[BUF1:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 7, i32 7, i32 2, i8 1 }, i32 7 , i1 false)
30
30
; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF1]], %dx.types.ResourceProperties { i32 4106, i32 260 })
31
31
32
32
; Buffer<uint4> Buf[24] : register(t3, space5)
33
33
; Buffer<uint4> typed2 = Buf[4]
34
34
; Note that the index below is 3 + 4 = 7
35
35
%typed2 = call target ("dx.TypedBuffer" , <4 x i32 >, 0 , 0 , 0 )
36
36
@llvm.dx.handle.fromBinding.tdx.TypedBuffer_i32_0_0_0t (
37
- i32 5 , i32 3 , i32 24 , i32 7 , i1 false )
37
+ i32 5 , i32 3 , i32 24 , i32 4 , i1 false )
38
38
; CHECK: [[BUF2:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 3, i32 26, i32 5, i8 0 }, i32 7, i1 false)
39
39
; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF2]], %dx.types.ResourceProperties { i32 10, i32 1029 })
40
40
41
41
; struct S { float4 a; uint4 b; };
42
42
; StructuredBuffer<S> Buf : register(t2, space4)
43
43
%struct0 = call target ("dx.RawBuffer" , {<4 x float >, <4 x i32 >}, 0 , 0 )
44
44
@llvm.dx.handle.fromBinding.tdx.RawBuffer_sl_v4f32v4i32s_0_0t (
45
- i32 4 , i32 2 , i32 1 , i32 10 , i1 true )
46
- ; CHECK: [[BUF3:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 2, i32 2, i32 4, i8 0 }, i32 10 , i1 true)
45
+ i32 4 , i32 2 , i32 1 , i32 0 , i1 true )
46
+ ; CHECK: [[BUF3:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 2, i32 2, i32 4, i8 0 }, i32 2 , i1 true)
47
47
; CHECK: = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF3]], %dx.types.ResourceProperties { i32 1036, i32 32 })
48
48
49
49
; ByteAddressBuffer Buf : register(t8, space1)
50
50
%byteaddr0 = call target ("dx.RawBuffer" , i8 , 0 , 0 )
51
51
@llvm.dx.handle.fromBinding.tdx.RawBuffer_i8_0_0t (
52
- i32 1 , i32 8 , i32 1 , i32 12 , i1 false )
53
- ; CHECK: [[BUF4:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 8, i32 8, i32 1, i8 0 }, i32 12 , i1 false)
52
+ i32 1 , i32 8 , i32 1 , i32 0 , i1 false )
53
+ ; CHECK: [[BUF4:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 8, i32 8, i32 1, i8 0 }, i32 8 , i1 false)
54
54
; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF4]], %dx.types.ResourceProperties { i32 11, i32 0 })
55
55
56
- ; Buffer<float4> Buf[] : register(t0 )
56
+ ; Buffer<float4> Buf[] : register(t7 )
57
57
; Buffer<float4> typed3 = Buf[ix]
58
58
%typed3_ix = call i32 @some_val ()
59
59
%typed3 = call target ("dx.TypedBuffer" , <4 x float >, 0 , 0 , 0 )
60
60
@llvm.dx.handle.fromBinding.tdx.TypedBuffer_v4f32_0_0_0t (
61
- i32 0 , i32 0 , i32 -1 , i32 %typed3_ix , i1 false )
62
- ; CHECK: [[BUF5:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 -1, i32 0, i8 0 }, i32 %typed3_ix, i1 false)
61
+ i32 0 , i32 7 , i32 -1 , i32 %typed3_ix , i1 false )
62
+ ; CHECK: %[[IX:.*]] = add i32 %typed3_ix, 7
63
+ ; CHECK: [[BUF5:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 7, i32 -1, i32 0, i8 0 }, i32 %[[IX]], i1 false)
63
64
; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF5]], %dx.types.ResourceProperties { i32 10, i32 1033 })
64
65
65
66
ret void
0 commit comments