Skip to content

Commit b79aa01

Browse files
more tess
1 parent 8959296 commit b79aa01

File tree

41 files changed

+7238
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7238
-0
lines changed
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
#--- source.hlsl
2+
RWStructuredBuffer<uint> _participant_check_sum : register(u1);
3+
4+
[numthreads(64, 1, 1)]
5+
void main(uint3 tid : SV_DispatchThreadID) {
6+
_participant_check_sum[tid.x] = 0;
7+
uint result = 0;
8+
switch ((WaveGetLaneIndex() % 4)) {
9+
case 0: {
10+
if ((WaveGetLaneIndex() < 8)) {
11+
result = (result + WaveActiveSum(1));
12+
uint _participantCount = WaveActiveSum(1);
13+
bool _isCorrect = (_participantCount == 2);
14+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
15+
}
16+
break;
17+
}
18+
case 1: {
19+
if (((WaveGetLaneIndex() % 2) == 0)) {
20+
result = (result + WaveActiveSum(2));
21+
uint _participantCount = WaveActiveSum(1);
22+
bool _isCorrect = (_participantCount == 0);
23+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
24+
}
25+
break;
26+
}
27+
case 2: {
28+
if (true) {
29+
result = (result + WaveActiveSum(3));
30+
uint _participantCount = WaveActiveSum(1);
31+
bool _isCorrect = (_participantCount == 16);
32+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
33+
}
34+
break;
35+
}
36+
case 3: {
37+
if ((WaveGetLaneIndex() < 20)) {
38+
result = (result + WaveActiveSum(4));
39+
uint _participantCount = WaveActiveSum(1);
40+
bool _isCorrect = (_participantCount == 5);
41+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
42+
}
43+
break;
44+
}
45+
default: {
46+
result = (result + WaveActiveSum(99));
47+
uint _participantCount = WaveActiveSum(1);
48+
bool _isCorrect = (_participantCount == 0);
49+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
50+
break;
51+
}
52+
}
53+
for (uint i0 = 0; (i0 < 2); i0 = (i0 + 1)) {
54+
if ((WaveGetLaneIndex() >= 40)) {
55+
result = (result + WaveActiveMin(result));
56+
uint _participantCount = WaveActiveSum(1);
57+
bool _isCorrect = (_participantCount == 24);
58+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
59+
}
60+
for (uint i1 = 0; (i1 < 2); i1 = (i1 + 1)) {
61+
if (((WaveGetLaneIndex() & 1) == 0)) {
62+
if (((WaveGetLaneIndex() & 1) == 1)) {
63+
result = (result + WaveActiveMax(result));
64+
uint _participantCount = WaveActiveSum(1);
65+
bool _isCorrect = (_participantCount == 0);
66+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
67+
}
68+
if (((WaveGetLaneIndex() & 1) == 1)) {
69+
result = (result + WaveActiveMin(9));
70+
uint _participantCount = WaveActiveSum(1);
71+
bool _isCorrect = (_participantCount == 0);
72+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
73+
}
74+
} else {
75+
if (((WaveGetLaneIndex() == 6) || (WaveGetLaneIndex() == 37))) {
76+
result = (result + WaveActiveMin((WaveGetLaneIndex() + 1)));
77+
uint _participantCount = WaveActiveSum(1);
78+
bool _isCorrect = (_participantCount == 1);
79+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
80+
}
81+
}
82+
if ((WaveGetLaneIndex() == 27)) {
83+
result = (result + WaveActiveSum(6));
84+
uint _participantCount = WaveActiveSum(1);
85+
bool _isCorrect = (_participantCount == 1);
86+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
87+
}
88+
if ((i1 == 1)) {
89+
continue;
90+
}
91+
}
92+
if ((i0 == 1)) {
93+
break;
94+
}
95+
}
96+
switch ((WaveGetLaneIndex() % 4)) {
97+
case 0: {
98+
if ((WaveGetLaneIndex() < 10)) {
99+
if ((WaveGetLaneIndex() < 13)) {
100+
result = (result + WaveActiveSum(result));
101+
uint _participantCount = WaveActiveSum(1);
102+
bool _isCorrect = (_participantCount == 3);
103+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
104+
}
105+
switch ((WaveGetLaneIndex() % 3)) {
106+
case 0: {
107+
if (((WaveGetLaneIndex() < 17) || (WaveGetLaneIndex() >= 61))) {
108+
if (((WaveGetLaneIndex() < 4) || (WaveGetLaneIndex() >= 45))) {
109+
result = (result + WaveActiveSum(WaveGetLaneIndex()));
110+
uint _participantCount = WaveActiveSum(1);
111+
bool _isCorrect = (_participantCount == 1);
112+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
113+
}
114+
if (((WaveGetLaneIndex() < 10) || (WaveGetLaneIndex() >= 60))) {
115+
result = (result + WaveActiveSum((WaveGetLaneIndex() + 2)));
116+
uint _participantCount = WaveActiveSum(1);
117+
bool _isCorrect = (_participantCount == 1);
118+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
119+
}
120+
}
121+
break;
122+
}
123+
case 1: {
124+
if (((WaveGetLaneIndex() % 2) == 0)) {
125+
result = (result + WaveActiveSum(2));
126+
uint _participantCount = WaveActiveSum(1);
127+
bool _isCorrect = (_participantCount == 1);
128+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
129+
}
130+
break;
131+
}
132+
case 2: {
133+
if (true) {
134+
result = (result + WaveActiveSum(3));
135+
uint _participantCount = WaveActiveSum(1);
136+
bool _isCorrect = (_participantCount == 1);
137+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
138+
}
139+
break;
140+
}
141+
}
142+
}
143+
break;
144+
}
145+
case 1: {
146+
if (((WaveGetLaneIndex() % 2) == 0)) {
147+
result = (result + WaveActiveSum(2));
148+
uint _participantCount = WaveActiveSum(1);
149+
bool _isCorrect = (_participantCount == 0);
150+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
151+
}
152+
break;
153+
}
154+
case 2: {
155+
if (((((WaveGetLaneIndex() == 16) || (WaveGetLaneIndex() == 22)) || (WaveGetLaneIndex() == 46)) || (WaveGetLaneIndex() == 34))) {
156+
if ((((WaveGetLaneIndex() == 9) || (WaveGetLaneIndex() == 58)) || (WaveGetLaneIndex() == 40))) {
157+
result = (result + WaveActiveMin(WaveGetLaneIndex()));
158+
uint _participantCount = WaveActiveSum(1);
159+
bool _isCorrect = (_participantCount == 0);
160+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
161+
}
162+
uint counter2 = 0;
163+
while ((counter2 < 3)) {
164+
counter2 = (counter2 + 1);
165+
if ((WaveGetLaneIndex() == 13)) {
166+
result = (result + WaveActiveSum(10));
167+
uint _participantCount = WaveActiveSum(1);
168+
bool _isCorrect = (_participantCount == 0);
169+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
170+
}
171+
uint counter3 = 0;
172+
while ((counter3 < 2)) {
173+
counter3 = (counter3 + 1);
174+
if (((WaveGetLaneIndex() & 1) == 0)) {
175+
result = (result + WaveActiveMax((WaveGetLaneIndex() + 1)));
176+
uint _participantCount = WaveActiveSum(1);
177+
bool _isCorrect = (_participantCount == 3);
178+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
179+
}
180+
if ((counter3 == 1)) {
181+
break;
182+
}
183+
}
184+
if ((counter2 == 2)) {
185+
break;
186+
}
187+
}
188+
}
189+
break;
190+
}
191+
case 3: {
192+
if ((WaveGetLaneIndex() < 20)) {
193+
result = (result + WaveActiveSum(4));
194+
uint _participantCount = WaveActiveSum(1);
195+
bool _isCorrect = (_participantCount == 5);
196+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
197+
}
198+
break;
199+
}
200+
}
201+
}
202+
203+
#--- pipeline.yaml
204+
---
205+
Shaders:
206+
- Stage: Compute
207+
Entry: main
208+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
209+
Buffers:
210+
- Name: _participant_check_sum
211+
Format: UInt32
212+
Stride: 4
213+
Fill: 0
214+
Size: 64
215+
- Name: expected_participants
216+
Format: UInt32
217+
Stride: 4
218+
Data: [4, 0, 1, 2, 3, 0, 1, 2, 2, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 3, 0, 0, 0, 1, 4, 0, 0, 1, 0, 0, 0, 3, 0, 0, 4, 1, 0, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2]
219+
Results:
220+
- Result: WaveOpValidation
221+
Rule: BufferExact
222+
Actual: _participant_check_sum
223+
Expected: expected_participants
224+
DescriptorSets:
225+
- Resources:
226+
- Name: _participant_check_sum
227+
Kind: RWStructuredBuffer
228+
DirectXBinding:
229+
Register: 1
230+
Space: 0
231+
VulkanBinding:
232+
Binding: 1
233+
...
234+
#--- end
235+
236+
# RUN: split-file %s %t
237+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
238+
# RUN: %offloader %t/pipeline.yaml %t.o
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#--- source.hlsl
2+
RWStructuredBuffer<uint> _participant_check_sum : register(u1);
3+
4+
[numthreads(64, 1, 1)]
5+
void main(uint3 tid : SV_DispatchThreadID) {
6+
_participant_check_sum[tid.x] = 0;
7+
uint result = 0;
8+
if (((WaveGetLaneIndex() < 8) || (WaveGetLaneIndex() >= 46))) {
9+
if (((WaveGetLaneIndex() < 16) || (WaveGetLaneIndex() >= 59))) {
10+
result = (result + WaveActiveMin(result));
11+
uint _participantCount = WaveActiveSum(1);
12+
bool _isCorrect = (_participantCount == 13);
13+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
14+
}
15+
for (uint i0 = 0; (i0 < 3); i0 = (i0 + 1)) {
16+
if ((WaveGetLaneIndex() >= 45)) {
17+
result = (result + WaveActiveSum(9));
18+
uint _participantCount = WaveActiveSum(1);
19+
bool _isCorrect = (_participantCount == 18);
20+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
21+
}
22+
if (((WaveGetLaneIndex() < 5) || (WaveGetLaneIndex() >= 43))) {
23+
if (((WaveGetLaneIndex() < 18) || (WaveGetLaneIndex() >= 56))) {
24+
result = (result + WaveActiveMin(result));
25+
uint _participantCount = WaveActiveSum(1);
26+
bool _isCorrect = (_participantCount == 13);
27+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
28+
}
29+
}
30+
if ((WaveGetLaneIndex() < 11)) {
31+
result = (result + WaveActiveSum((WaveGetLaneIndex() + 3)));
32+
uint _participantCount = WaveActiveSum(1);
33+
bool _isCorrect = (_participantCount == 8);
34+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
35+
}
36+
}
37+
if (((WaveGetLaneIndex() < 7) || (WaveGetLaneIndex() >= 56))) {
38+
result = (result + WaveActiveMin(WaveGetLaneIndex()));
39+
uint _participantCount = WaveActiveSum(1);
40+
bool _isCorrect = (_participantCount == 15);
41+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
42+
}
43+
}
44+
switch ((WaveGetLaneIndex() % 2)) {
45+
case 0: {
46+
if ((WaveGetLaneIndex() == 53)) {
47+
for (uint i1 = 0; (i1 < 2); i1 = (i1 + 1)) {
48+
if ((WaveGetLaneIndex() == 59)) {
49+
result = (result + WaveActiveSum(10));
50+
uint _participantCount = WaveActiveSum(1);
51+
bool _isCorrect = (_participantCount == 0);
52+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
53+
}
54+
}
55+
if ((WaveGetLaneIndex() == 50)) {
56+
result = (result + WaveActiveMin(result));
57+
uint _participantCount = WaveActiveSum(1);
58+
bool _isCorrect = (_participantCount == 0);
59+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
60+
}
61+
}
62+
break;
63+
}
64+
case 1: {
65+
if (((WaveGetLaneIndex() % 2) == 0)) {
66+
result = (result + WaveActiveSum(2));
67+
uint _participantCount = WaveActiveSum(1);
68+
bool _isCorrect = (_participantCount == 0);
69+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
70+
}
71+
break;
72+
}
73+
}
74+
}
75+
76+
#--- pipeline.yaml
77+
---
78+
Shaders:
79+
- Stage: Compute
80+
Entry: main
81+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
82+
Buffers:
83+
- Name: _participant_check_sum
84+
Format: UInt32
85+
Stride: 4
86+
Fill: 0
87+
Size: 64
88+
- Name: expected_participants
89+
Format: UInt32
90+
Stride: 4
91+
Data: [8, 8, 8, 8, 8, 5, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 8, 8, 8, 8, 8]
92+
Results:
93+
- Result: WaveOpValidation
94+
Rule: BufferExact
95+
Actual: _participant_check_sum
96+
Expected: expected_participants
97+
DescriptorSets:
98+
- Resources:
99+
- Name: _participant_check_sum
100+
Kind: RWStructuredBuffer
101+
DirectXBinding:
102+
Register: 1
103+
Space: 0
104+
VulkanBinding:
105+
Binding: 1
106+
...
107+
#--- end
108+
109+
# RUN: split-file %s %t
110+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
111+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)