-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathcountbits.32.test
More file actions
98 lines (90 loc) · 2.1 KB
/
countbits.32.test
File metadata and controls
98 lines (90 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#--- source.hlsl
StructuredBuffer<int4> InInt : register(t0);
StructuredBuffer<uint4> InUInt : register(t1);
RWStructuredBuffer<uint4> OutInt : register(u2);
RWStructuredBuffer<uint4> OutUInt : register(u3);
[numthreads(1,1,1)]
void main() {
// Int
OutInt[0] = countbits(InInt[0]);
uint4 OutOne = {countbits(InInt[0].xyz), countbits(InInt[0].w)};
OutInt[1] = OutOne;
OutInt[2].xy = countbits(InInt[0].xy);
// UInt
OutUInt[0] = countbits(InUInt[0]);
uint4 OutUOne = {countbits(InUInt[0].xyz), countbits(InUInt[0].w)};
OutUInt[1] = OutUOne;
OutUInt[2].xy = countbits(InUInt[0].xy);
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: InInt
Format: Int32
Stride: 16
Data: [0x2A, 0, 0x0f0f0f0f, -1]
- Name: InUInt
Format: UInt32
Stride: 16
Data: [0x2A, 0, 0x0f0f0f0f, 0xffffffff]
- Name: OutInt
Format: UInt32
Stride: 16
FillSize: 48
- Name: OutUInt
Format: UInt32
Stride: 16
FillSize: 48
- Name: ExpectedOut # The result we expect
Format: UInt32
Stride: 16
Data: [3, 0, 16, 32, 3, 0, 16, 32, 3, 0, 0, 0]
Results:
- Result: Test1
Rule: BufferExact
Actual: OutInt
Expected: ExpectedOut
- Result: Test2
Rule: BufferExact
Actual: OutUInt
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: InInt
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: InUInt
Kind: StructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
- Name: OutInt
Kind: RWStructuredBuffer
DirectXBinding:
Register: 2
Space: 0
VulkanBinding:
Binding: 2
- Name: OutUInt
Kind: RWStructuredBuffer
DirectXBinding:
Register: 3
Space: 0
VulkanBinding:
Binding: 3
...
#--- end
# Bug https://github.com/llvm/llvm-project/issues/170241
# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o