Skip to content

Commit 8415e05

Browse files
authored
Add test for WaveGetLaneIndex (#235)
Test WaveGetLaneIndex; no control flow usage. Closes #158
1 parent 183b0c8 commit 8415e05

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#--- source.hlsl
2+
RWStructuredBuffer<uint> Out : register(u0);
3+
4+
[numthreads(4, 1, 1)]
5+
void main(uint3 threadID : SV_DispatchThreadID) {
6+
Out[threadID.x] = WaveGetLaneIndex();
7+
}
8+
9+
//--- pipeline.yaml
10+
11+
---
12+
Shaders:
13+
- Stage: Compute
14+
Entry: main
15+
DispatchSize: [2, 1, 1]
16+
Buffers:
17+
- Name: Out
18+
Format: UInt32
19+
Stride: 4
20+
ZeroInitSize: 32
21+
- Name: ExpectedOut
22+
Format: UInt32
23+
Stride: 4
24+
Data: [0, 1, 2, 3, 0, 1, 2, 3]
25+
Results:
26+
- Result: Test
27+
Rule: BufferExact
28+
Actual: Out
29+
Expected: ExpectedOut
30+
DescriptorSets:
31+
- Resources:
32+
- Name: Out
33+
Kind: RWStructuredBuffer
34+
DirectXBinding:
35+
Register: 0
36+
Space: 0
37+
VulkanBinding:
38+
Binding: 0
39+
...
40+
#--- end
41+
42+
# https://github.com/llvm/llvm-project/issues/145953
43+
# XFAIL: Clang-Vulkan
44+
# RUN: split-file %s %t
45+
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
46+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)