Skip to content

Commit 97cd8ae

Browse files
committed
address PR comments, remove status and CheckAccessFullyMapped, remove unsupported targets
1 parent 0a747f5 commit 97cd8ae

File tree

3 files changed

+48
-118
lines changed

3 files changed

+48
-118
lines changed

test/Feature/ByteAddressBuffer/ByteAddressBuffers-16bit.test

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,27 @@
55

66
// The expected behaviour is to load the values in `In0` and `In1` at the given
77
// byte-offset, add them, and store the result at the respective offset in
8-
// `Out`. We expect each load and store to only access mapped resource data, so
9-
// `CheckAccessFullyMapped` should always return `true = 1`.
8+
// `Out`.
109

1110
ByteAddressBuffer In0 : register(t0);
1211
ByteAddressBuffer In1 : register(t1);
13-
RWByteAddressBuffer Out : register(u0);
14-
RWBuffer<uint> Mapped : register(u0, space1);
12+
RWByteAddressBuffer Out : register(u2);
1513

1614
[numthreads(4,1,1)]
1715
void main() {
18-
uint status;
19-
20-
int16_t U0 = In0.Load<int16_t>(0, status);
21-
Mapped[0] = CheckAccessFullyMapped(status);
16+
int16_t U0 = In0.Load<int16_t>(0);
2217
int16_t V0 = In1.Load<int16_t>(0);
2318
Out.Store<int16_t>(0, U0 + V0);
2419

25-
int16_t2 U1 = In0.Load<int16_t2>(8, status);
26-
Mapped[1] = CheckAccessFullyMapped(status);
20+
int16_t2 U1 = In0.Load<int16_t2>(8);
2721
int16_t2 V1 = In1.Load<int16_t2>(8);
2822
Out.Store<int16_t2>(8, U1 + V1);
2923

30-
int16_t3 U2 = In0.Load<int16_t3>(16, status);
31-
Mapped[2] = CheckAccessFullyMapped(status);
24+
int16_t3 U2 = In0.Load<int16_t3>(16);
3225
int16_t3 V2 = In1.Load<int16_t3>(16);
3326
Out.Store<int16_t3>(16, U2 + V2);
3427

35-
int16_t4 U3 = In0.Load<int16_t4>(24, status);
36-
Mapped[3] = CheckAccessFullyMapped(status);
28+
int16_t4 U3 = In0.Load<int16_t4>(24);
3729
int16_t4 V3 = In1.Load<int16_t4>(24);
3830
Out.Store<int16_t4>(24, U3 + V3);
3931
}
@@ -65,50 +57,37 @@ Buffers:
6557
Stride: 2
6658
Data: [ 0x101, 0x000, 0x000, 0x000, 0x505, 0x606, 0x000, 0x000,
6759
0x909, 0xA0A, 0xB0B, 0x000, 0xD0D, 0xE0E, 0xF0F, 0x1010 ]
68-
- Name: Mapped
69-
Format: Int32
70-
Stride: 4
71-
FillSize: 16
72-
- Name: ExpectedMapped
73-
Format: Int32
74-
Stride: 4
75-
Data: [ 1, 1, 1, 1 ]
7660
Results:
7761
- Result: Test0
7862
Rule: BufferExact
7963
Actual: Out
8064
Expected: ExpectedOut
81-
- Result: Test1
82-
Rule: BufferExact
83-
Actual: Mapped
84-
Expected: ExpectedMapped
8565
DescriptorSets:
8666
- Resources:
8767
- Name: In0
8868
Kind: ByteAddressBuffer
8969
DirectXBinding:
9070
Register: 0
9171
Space: 0
72+
VulkanBinding:
73+
Binding: 0
9274
- Name: In1
9375
Kind: ByteAddressBuffer
9476
DirectXBinding:
9577
Register: 1
9678
Space: 0
79+
VulkanBinding:
80+
Binding: 1
9781
- Name: Out
9882
Kind: RWByteAddressBuffer
9983
DirectXBinding:
100-
Register: 0
84+
Register: 2
10185
Space: 0
102-
- Name: Mapped
103-
Kind: RWBuffer
104-
DirectXBinding:
105-
Register: 0
106-
Space: 1
86+
VulkanBinding:
87+
Binding: 2
10788
...
10889
#--- end
10990

110-
# UNSUPPORTED: Vulkan, Metal
111-
11291
# Unimplemented https://github.com/llvm/llvm-project/issues/108058
11392
# XFAIL: Clang
11493

test/Feature/ByteAddressBuffer/ByteAddressBuffers-64bit.test

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,27 @@
55

66
// The expected behaviour is to load the values in `In0` and `In1` at the given
77
// byte-offset, add them, and store the result at the respective offset in
8-
// `Out`. We expect each load and store to only access mapped resource data, so
9-
// `CheckAccessFullyMapped` should always return `true = 1`.
8+
// `Out`.
109

1110
ByteAddressBuffer In0 : register(t0);
1211
ByteAddressBuffer In1 : register(t1);
13-
RWByteAddressBuffer Out : register(u0);
14-
RWBuffer<uint> Mapped : register(u0, space1);
12+
RWByteAddressBuffer Out : register(u2);
1513

1614
[numthreads(4,1,1)]
1715
void main() {
18-
uint status;
19-
20-
int64_t U0 = In0.Load<int64_t>(0, status);
21-
Mapped[0] = CheckAccessFullyMapped(status);
16+
int64_t U0 = In0.Load<int64_t>(0);
2217
int64_t V0 = In1.Load<int64_t>(0);
2318
Out.Store<int64_t>(0, U0 + V0);
2419

25-
int64_t2 U1 = In0.Load<int64_t2>(32, status);
26-
Mapped[1] = CheckAccessFullyMapped(status);
20+
int64_t2 U1 = In0.Load<int64_t2>(32);
2721
int64_t2 V1 = In1.Load<int64_t2>(32);
2822
Out.Store<int64_t2>(32, U1 + V1);
2923

30-
int64_t3 U2 = In0.Load<int64_t3>(64, status);
31-
Mapped[2] = CheckAccessFullyMapped(status);
24+
int64_t3 U2 = In0.Load<int64_t3>(64);
3225
int64_t3 V2 = In1.Load<int64_t3>(64);
3326
Out.Store<int64_t3>(64, U2 + V2);
3427

35-
int64_t4 U3 = In0.Load<int64_t4>(96, status);
36-
Mapped[3] = CheckAccessFullyMapped(status);
28+
int64_t4 U3 = In0.Load<int64_t4>(96);
3729
int64_t4 V3 = In1.Load<int64_t4>(96);
3830
Out.Store<int64_t4>(96, U3 + V3);
3931
}
@@ -65,50 +57,37 @@ Buffers:
6557
Stride: 8
6658
Data: [ 0x101, 0x000, 0x000, 0x000, 0x505, 0x606, 0x000, 0x000,
6759
0x909, 0xA0A, 0xB0B, 0x000, 0xD0D, 0xE0E, 0xF0F, 0x1010 ]
68-
- Name: Mapped
69-
Format: Int32
70-
Stride: 4
71-
FillSize: 16
72-
- Name: ExpectedMapped
73-
Format: Int32
74-
Stride: 4
75-
Data: [ 1, 1, 1, 1 ]
7660
Results:
7761
- Result: Test0
7862
Rule: BufferExact
7963
Actual: Out
8064
Expected: ExpectedOut
81-
- Result: Test1
82-
Rule: BufferExact
83-
Actual: Mapped
84-
Expected: ExpectedMapped
8565
DescriptorSets:
8666
- Resources:
8767
- Name: In0
8868
Kind: ByteAddressBuffer
8969
DirectXBinding:
9070
Register: 0
9171
Space: 0
72+
VulkanBinding:
73+
Binding: 0
9274
- Name: In1
9375
Kind: ByteAddressBuffer
9476
DirectXBinding:
9577
Register: 1
9678
Space: 0
79+
VulkanBinding:
80+
Binding: 1
9781
- Name: Out
9882
Kind: RWByteAddressBuffer
9983
DirectXBinding:
100-
Register: 0
84+
Register: 2
10185
Space: 0
102-
- Name: Mapped
103-
Kind: RWBuffer
104-
DirectXBinding:
105-
Register: 0
106-
Space: 1
86+
VulkanBinding:
87+
Binding: 2
10788
...
10889
#--- end
10990

110-
# UNSUPPORTED: Vulkan, Metal
111-
11291
# Unimplemented https://github.com/llvm/llvm-project/issues/108058
11392
# XFAIL: Clang
11493

test/Feature/ByteAddressBuffer/ByteAddressBuffers.test

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
// The expected behaviour is to load the values in `In0` and `In1` at the given
77
// byte-offset, add them, and store the result at the respective offset in
8-
// `Out`. We expect each load and store to only access mapped resource data, so
9-
// `CheckAccessFullyMapped` should always return `true = 1`.
8+
// `Out`.
109

1110
struct S0 {
1211
int a;
@@ -22,74 +21,60 @@ struct S1 {
2221

2322
ByteAddressBuffer In0 : register(t0);
2423
ByteAddressBuffer In1 : register(t1);
25-
RWByteAddressBuffer Out : register(u0);
26-
RWBuffer<uint> Mapped : register(u0, space1);
24+
RWByteAddressBuffer Out : register(u2);
2725

2826
[numthreads(4,1,1)]
2927
void main() {
30-
uint status;
31-
3228
// uint
33-
uint U0 = In0.Load(0, status);
34-
Mapped[0] = CheckAccessFullyMapped(status);
29+
uint U0 = In0.Load(0);
3530
uint V0 = In1.Load(0);
3631
Out.Store(0, U0 + V0);
3732

38-
uint2 U1 = In0.Load2(16, status);
39-
Mapped[1] = CheckAccessFullyMapped(status);
33+
uint2 U1 = In0.Load2(16);
4034
uint2 V1 = In1.Load2(16);
4135
Out.Store2(16, U1 + V1);
4236

43-
uint3 U2 = In0.Load3(32, status);
44-
Mapped[2] = CheckAccessFullyMapped(status);
37+
uint3 U2 = In0.Load3(32);
4538
uint3 V2 = In1.Load3(32);
4639
Out.Store3(32, U2 + V2);
4740

48-
uint4 U3 = In0.Load4(48, status);
49-
Mapped[3] = CheckAccessFullyMapped(status);
41+
uint4 U3 = In0.Load4(48);
5042
uint4 V3 = In1.Load4(48);
5143
Out.Store4(48, U3 + V3);
5244

5345
// bool
54-
bool U4 = In0.Load<bool>(64, status);
55-
Mapped[4] = CheckAccessFullyMapped(status);
46+
bool U4 = In0.Load<bool>(64);
5647
bool V4 = In1.Load<bool>(64);
5748
Out.Store<bool>(64, U4 + V4);
5849

59-
bool2 U5 = In0.Load<bool2>(64, status);
60-
Mapped[5] = CheckAccessFullyMapped(status);
50+
bool2 U5 = In0.Load<bool2>(64);
6151
bool2 V5 = In1.Load<bool2>(64);
6252
Out.Store<bool2>(80, U5 + V5);
6353

64-
bool3 U6 = In0.Load<bool3>(64, status);
65-
Mapped[6] = CheckAccessFullyMapped(status);
54+
bool3 U6 = In0.Load<bool3>(64);
6655
bool3 V6 = In1.Load<bool3>(64);
6756
Out.Store<bool3>(96, U6 + V6);
6857

69-
bool4 U7 = In0.Load<bool4>(64, status);
70-
Mapped[7] = CheckAccessFullyMapped(status);
58+
bool4 U7 = In0.Load<bool4>(64);
7159
bool4 V7 = In1.Load<bool4>(64);
7260
Out.Store<bool4>(112, U7 + V7);
7361

7462
// array
75-
int U8[4] = In0.Load<int[4]>(0, status);
76-
Mapped[8] = CheckAccessFullyMapped(status);
63+
int U8[4] = In0.Load<int[4]>(0);
7764
int V8[4] = In1.Load<int[4]>(0);
7865
int TempArray[4];
79-
for(int i = 0; i < 4; i++) {
80-
TempArray[i] = U8[i] + V8[i];
66+
for(int I = 0; I < 4; I++) {
67+
TempArray[I] = U8[I] + V8[I];
8168
}
8269
Out.Store<int[4]>(128, TempArray);
8370

8471
// structs
85-
S0 U9 = In0.Load<S0>(0, status);
86-
Mapped[9] = CheckAccessFullyMapped(status);
72+
S0 U9 = In0.Load<S0>(0);
8773
S0 V9 = In1.Load<S0>(0);
8874
S0 TempStruct0 = {U9.a + V9.a, U9.b + V9.b};
8975
Out.Store<S0>(144, TempStruct0);
9076

91-
S1 U10 = In0.Load<S1>(0, status);
92-
Mapped[10] = CheckAccessFullyMapped(status);
77+
S1 U10 = In0.Load<S1>(0);
9378
S1 V10 = In1.Load<S1>(0);
9479
S1 TempStruct1 = {U10.a + V10.a, U10.b + V10.b, U10.c + V10.c, U10.d + V10.d};
9580
Out.Store<S1>(160, TempStruct1);
@@ -129,50 +114,37 @@ Buffers:
129114
0x101, 0x202, 0x303, 0x404, 0x101, 0x202, 0x000, 0x000,
130115
0x101, 0x202, 0x303, 0x404, 0x505, 0x606, 0x707, 0x808,
131116
0x909, 0xA0A, 0xB0B, 0xC0C, 0xD0D, 0xE0E, 0xF0F, 0x1010 ]
132-
- Name: Mapped
133-
Format: Int32
134-
Stride: 4
135-
FillSize: 44
136-
- Name: ExpectedMapped
137-
Format: Int32
138-
Stride: 4
139-
Data: [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
140117
Results:
141118
- Result: Test0
142119
Rule: BufferExact
143120
Actual: Out
144121
Expected: ExpectedOut
145-
- Result: Test1
146-
Rule: BufferExact
147-
Actual: Mapped
148-
Expected: ExpectedMapped
149122
DescriptorSets:
150123
- Resources:
151124
- Name: In0
152125
Kind: ByteAddressBuffer
153126
DirectXBinding:
154127
Register: 0
155128
Space: 0
129+
VulkanBinding:
130+
Binding: 0
156131
- Name: In1
157132
Kind: ByteAddressBuffer
158133
DirectXBinding:
159134
Register: 1
160135
Space: 0
136+
VulkanBinding:
137+
Binding: 1
161138
- Name: Out
162139
Kind: RWByteAddressBuffer
163140
DirectXBinding:
164-
Register: 0
141+
Register: 2
165142
Space: 0
166-
- Name: Mapped
167-
Kind: RWBuffer
168-
DirectXBinding:
169-
Register: 0
170-
Space: 1
143+
VulkanBinding:
144+
Binding: 2
171145
...
172146
#--- end
173147

174-
# UNSUPPORTED: Vulkan, Metal
175-
176148
# Unimplemented https://github.com/llvm/llvm-project/issues/108058
177149
# XFAIL: Clang
178150

0 commit comments

Comments
 (0)