-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathlocal_resource_const_param.test
More file actions
54 lines (50 loc) · 1.09 KB
/
local_resource_const_param.test
File metadata and controls
54 lines (50 loc) · 1.09 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
#--- source.hlsl
// Test that a const resource parameter can be read from inside a helper function.
RWByteAddressBuffer gBuf : register(u0);
void UseConst(const RWByteAddressBuffer buf, out uint val) {
val = buf.Load(0);
}
[numthreads(1,1,1)]
void main() {
const RWByteAddressBuffer local = gBuf;
gBuf.Store(0, 99);
uint val;
UseConst(local, val);
gBuf.Store(0, val == 99 ? 42 : 0);
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: Out
Format: Int32
Stride: 4
Data: [0]
- Name: ExpectedOut
Format: Int32
Stride: 4
Data: [42]
Results:
- Result: Test0
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: Out
Kind: RWByteAddressBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
...
#--- end
# Bug: https://github.com/llvm/llvm-project/issues/192557
# XFAIL: Clang
# 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