-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmatrix_single_subscript_store.test
More file actions
71 lines (66 loc) · 1.4 KB
/
matrix_single_subscript_store.test
File metadata and controls
71 lines (66 loc) · 1.4 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
#--- source.hlsl
RWBuffer<int> In : register(u0);
RWBuffer<int> Out : register(u1);
[numthreads(1,1,1)]
void main() {
int4 vec = int4(In[0], In[1], In[2], In[3]);
int4x4 A;
for(int i = 0; i < 4; i++) {
if(i % 2 == 0)
A[i].rbag = vec;
// A[3] is exactly In Buffer
else if(i % 3 == 0)
A[i] = vec;
// A[1] is reverse In Buffer
else
A[i] = vec.bagr;
}
const uint COLS = 4;
for(int i = 0; i < 16; i++) {
uint row = i / COLS;
uint col = i % COLS;
Out[i] = A[row][col];
}
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In
Format: Int32
Data: [1, 2, 3, 4]
- Name: Out
Format: Int32
FillSize: 64
- Name: ExpectedOut
Format: Int32
Data: [ 1, 4, 2, 3, 3, 4, 2, 1, 1, 4, 2, 3, 1, 2, 3, 4 ]
Results:
- Result: Out
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: In
Kind: RWBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Out
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