Skip to content

Commit 85f2317

Browse files
committed
WIP adduint64 tests
1 parent 5b2eba7 commit 85f2317

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

test/Feature/HLSLLib/adduint64.test

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#--- source.hlsl
2+
3+
StructuredBuffer<float4> In : register(t0);
4+
RWStructuredBuffer<float4> Out : register(u1);
5+
6+
[numthreads(1,1,1)]
7+
void main() {
8+
Out[0].xy = AddUint64(In[0].xy, In[0].xy);
9+
Out[0].zw = AddUint64(In[0].zw, In[0].zw);
10+
Out[1].xy = AddUint64(In[1].xy, In[1].xy);
11+
Out[1].zw = AddUint64(In[1].zw, In[1].zw);
12+
Out[2].xy = AddUint64(In[2].xy, In[2].xy);
13+
Out[2].zw = AddUint64(In[2].zw, In[2].zw);
14+
}
15+
16+
//--- pipeline.yaml
17+
18+
---
19+
Shaders:
20+
- Stage: Compute
21+
Entry: main
22+
DispatchSize: [1, 1, 1]
23+
Buffers:
24+
- Name: In
25+
Format: Float32
26+
Stride: 16
27+
Data: [ 1, 0, 1, 256, 10000, 10001, 0x80000000, 1, 0x7fffffff, 0x7fffffff, 0xffffffff, 0x7fffffff ]
28+
- Name: Out
29+
Format: Float32
30+
Stride: 16
31+
ZeroInitSize: 48
32+
- Name: ExpectedOut # The result we expect
33+
Format: Float32
34+
Stride: 16
35+
Data: [ 2, 0, 2, 512, 20000, 20002, 0, 3, 0xfffffffe, 0xfffffffe, 0xfffffffe, 0xffffffff ]
36+
Results:
37+
- Result: Test1
38+
Rule: BufferFloatEpsilon
39+
Epsilon: 0
40+
Actual: Out
41+
Expected: ExpectedOut
42+
DescriptorSets:
43+
- Resources:
44+
- Name: In
45+
Kind: StructuredBuffer
46+
DirectXBinding:
47+
Register: 0
48+
Space: 0
49+
VulkanBinding:
50+
Binding: 0
51+
- Name: Out
52+
Kind: RWStructuredBuffer
53+
DirectXBinding:
54+
Register: 1
55+
Space: 0
56+
VulkanBinding:
57+
Binding: 1
58+
...
59+
#--- end
60+
61+
# UNSUPPORTED: Clang-Vulkan
62+
# RUN: split-file %s %t
63+
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
64+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)