-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathinc_counter_array.test
More file actions
65 lines (53 loc) · 1.61 KB
/
inc_counter_array.test
File metadata and controls
65 lines (53 loc) · 1.61 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
#--- source.hlsl
// This test verifies handling of resource arrays when the
// resource type has a counter.
RWStructuredBuffer<int> Out[4] : register(u0);
[numthreads(4,1,1)]
void main(uint GI : SV_GroupIndex) {
for (int i = 0; i < GI; i++)
Out[NonUniformResourceIndex(GI)].IncrementCounter();
Out[NonUniformResourceIndex(GI)][0] = Out[NonUniformResourceIndex(GI)].IncrementCounter();
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: Out
Format: Hex32
Stride: 4
ArraySize: 4
FillSize: 4
DescriptorSets:
- Resources:
- Name: Out
Kind: RWStructuredBuffer
HasCounter: true
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
CounterBinding: 1
...
#--- end
# Bug https://github.com/llvm/llvm-project/issues/162841
# XFAIL: Clang && Vulkan
# Offload tests are missing support for counters and resource arrays on Metal
# Unimplemented https://github.com/llvm/offload-test-suite/issues/304
# Unimplemented https://github.com/llvm/offload-test-suite/issues/305
# 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 | FileCheck %s %if DirectX %{ --check-prefixes=CHECK,DX-CHECK %}
# DX-CHECK: Creating UAV: { Size = 4100, Register = u0, Space = 0, HasCounter = 1 }
# DX-CHECK: UAV: HeapIdx = 0 EltSize = 4 NumElts = 1 HasCounter = 1
# CHECK: Name: Out
# CHECK: Counters: [ 1, 2, 3, 4 ]
# CHECK: Data:
# CHECK-NEXT: - [ 0x0 ]
# CHECK-NEXT: - [ 0x1 ]
# CHECK-NEXT: - [ 0x2 ]
# CHECK-NEXT: - [ 0x3 ]