-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy patharray-of-structs-with-res.test
More file actions
104 lines (88 loc) · 1.75 KB
/
array-of-structs-with-res.test
File metadata and controls
104 lines (88 loc) · 1.75 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
99
100
101
102
103
104
#--- source.hlsl
// This test verifies handling of an array of structs with a resource.
struct A {
RWBuffer<int> Buf;
};
A d[8] : register(u10);
A e[6];
RWBuffer<int> Out : register(u100);
[numthreads(4, 1, 1)]
void main(uint3 ID : SV_GroupThreadID) {
int x = d[2].Buf[ID.x];
int y = d[7].Buf[ID.x];
e[0].Buf[ID.x] = x + y;
e[1].Buf[ID.x] = x * y;
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: BufD2
Format: Int32
Data:
[ 1, 2, 3, 4 ]
- Name: BufD7
Format: Int32
Data:
[ 10, 20, 30, 40 ]
- Name: BufE1
Format: Int32
FillSize: 16
- Name: BufE3
Format: Int32
FillSize: 16
- Name: ExpectedBufE1
Format: Int32
Data:
[ 11, 22, 33, 44 ]
- Name: ExpectedBufE3
Format: Int32
Data:
[ 10, 40, 90, 160 ]
Results:
- Result: ExpectedResult1
Rule: BufferExact
Actual: BufE1
Expected: ExpectedBufE1
- Result: ExpectedResult2
Rule: BufferExact
Actual: BufE3
Expected: ExpectedBufE3
DescriptorSets:
- Resources:
- Name: BufD2
Kind: RWBuffer
DirectXBinding:
Register: 12
Space: 0
VulkanBinding:
Binding: 12
- Name: BufD7
Kind: RWBuffer
DirectXBinding:
Register: 17
Space: 0
VulkanBinding:
Binding: 17
- Name: BufE1
Kind: RWBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: BufE3
Kind: RWBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
...
#--- end
# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o