-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathlocal_resource_conditional_init.test
More file actions
57 lines (52 loc) · 1.3 KB
/
local_resource_conditional_init.test
File metadata and controls
57 lines (52 loc) · 1.3 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
#--- source.hlsl
// Test that a conditionally initialized local resource works correctly.
// DXC rejects this because it cannot prove the local resource maps to a
// unique global resource through the conditional branch.
RWByteAddressBuffer gBuf : register(u0);
[numthreads(1,1,1)]
void main(uint3 tid : SV_DispatchThreadID) {
RWByteAddressBuffer buf;
if (tid.x == 0)
buf = gBuf;
buf.Store(0, 42);
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: gBuf
Format: Int32
Stride: 4
Data: [0]
- Name: ExpectedGBuf
Format: Int32
Stride: 4
Data: [42]
Results:
- Result: Test0
Rule: BufferExact
Actual: gBuf
Expected: ExpectedGBuf
DescriptorSets:
- Resources:
- Name: gBuf
Kind: RWByteAddressBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
...
#--- end
# Bug: https://github.com/llvm/llvm-project/issues/192542
# XFAIL: DXC && Vulkan
# Bug: TODO - DXC codegen error: local resource not guaranteed to map to unique global resource
# XFAIL: DXC
# Bug: https://github.com/llvm/llvm-project/issues/192523
# XFAIL: Clang && Vulkan
# 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