-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathSparseTypedLoad.test
More file actions
73 lines (62 loc) · 1.5 KB
/
SparseTypedLoad.test
File metadata and controls
73 lines (62 loc) · 1.5 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
#--- source.hlsl
Buffer<int4> X : register(t0);
RWStructuredBuffer<int> Out : register(u1);
[numthreads(1,1,1)]
void main() {
int4 Result;
// Index 0: Tile 0 of X. Mapped.
Result = X.Load(0);
Out[0] = Result.x;
// Index 5000: Tile 1 of X. Unmapped.
Result = X.Load(5000);
Out[1] = Result.x;
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: X
Format: Int32
Channels: 4
FillSize: 131072 # 128KB
FillValue: 9001
- Name: Out
Format: Int32
Stride: 4
FillSize: 8
DescriptorSets:
- Resources:
- Name: X
Kind: Buffer
IsReserved: true
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
TilesMapped: 1
- Name: Out
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
#--- end
# REQUIRES: !Vulkan || sparseBinding
# REQUIRES: !Vulkan || sparseResidencyBuffer
# REQUIRES: !Vulkan || residencyNonResidentStrict
# Unimplemented: https://github.com/llvm/offload-test-suite/issues/515
# XFAIL: Metal
# Bug: https://github.com/llvm/llvm-project/issues/191248
# XFAIL: DirectX && Clang
# 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 | FileCheck %s
# CHECK: - Name: Out
# CHECK-NEXT: Format: Int32
# CHECK-NEXT: Stride: 4
# CHECK-NEXT: Data: [ 9001, 0 ]