-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathres-in-struct-mix.test
More file actions
126 lines (107 loc) · 2.25 KB
/
res-in-struct-mix.test
File metadata and controls
126 lines (107 loc) · 2.25 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#--- source.hlsl
// This test verifies handling of a resource in a class.
class E {
RWBuffer<int> UavBuf1;
};
class F {
StructuredBuffer<int> SrvBuf1;
};
class G : F {
E e;
StructuredBuffer<int> SrvBuf2;
RWBuffer<int> UavBuf2;
};
RWStructuredBuffer<int4> Out : register(u0);
G g : register(u5) : register(t3);
[numthreads(4, 1, 1)]
void main(uint3 ID : SV_GroupThreadID) {
int x = g.e.UavBuf1[ID.x];
int y = g.SrvBuf1[ID.x];
int z = g.SrvBuf2[ID.x];
int w = g.UavBuf2[ID.x];
Out[ID.x] = int4(x, y, z, w);
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: Buf_g_F_SrvBuf1
Format: Int32
Data:
[ 1, 2, 3, 4 ]
- Name: Buf_g_SrvBuf2
Format: Int32
Data:
[ 10, 20, 30, 40 ]
- Name: Buf_g_e_UavBuf1
Format: Int32
Data:
[ 100, 200, 300, 400 ]
- Name: Buf_g_UavBuf2
Format: Int32
Data:
[ 1000, 2000, 3000, 4000 ]
- Name: BufOut
Format: Int32
Stride: 16
FillSize: 64
- Name: ExpectedBufOut
Format: Int32
Stride: 16
Data:
[ 100, 1, 10, 1000,
200, 2, 20, 2000,
300, 3, 30, 3000,
400, 4, 40, 4000 ]
Results:
- Result: ExpectedResult
Rule: BufferExact
Actual: BufOut
Expected: ExpectedBufOut
DescriptorSets:
- Resources:
- Name: Buf_g_F_SrvBuf1
Kind: StructuredBuffer
DirectXBinding:
Register: 3
Space: 0
VulkanBinding:
Binding: 3
- Name: Buf_g_SrvBuf2
Kind: StructuredBuffer
DirectXBinding:
Register: 4
Space: 0
VulkanBinding:
Binding: 4
- Name: Buf_g_e_UavBuf1
Kind: RWBuffer
DirectXBinding:
Register: 5
Space: 0
VulkanBinding:
Binding: 5
- Name: Buf_g_UavBuf2
Kind: RWBuffer
DirectXBinding:
Register: 6
Space: 0
VulkanBinding:
Binding: 6
- Name: BufOut
Kind: RWStructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
...
#--- end
# Bug https://github.com/llvm/offload-test-suite/issues/642
# XFAIL: Metal
# 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