diff options
| author | Yong He <yonghe@outlook.com> | 2024-01-24 15:36:49 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-24 15:36:49 -0800 |
| commit | e7b6de334f320429462a0257e2191ccf3cbc9a0d (patch) | |
| tree | 7e2f6802a2f6fa5217903948efbd994b51e103b7 /tests/spirv/coherent-2.slang | |
| parent | dd57306d951dbcaf6471659fcd1d2c37738f36d0 (diff) | |
[SPIRV] Support `globallycoherent` and `[vk::index()]`. (#3488)
* [SPIRV] Support `globallycoherent` modifier.
* Fix.
* Disable executable cooperative vector tests.
* Update expected failure.
* [SPIRV] Emit varying output index decoration.
* Add test.
* Update tests.
* Fix test.
* Emit `SpvExecutionModeEarlyFragmentTests`.
* Lower `StructuredBuffer<bool>`.
* Support globallycoherent on ByteAddressBuffer.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/spirv/coherent-2.slang')
| -rw-r--r-- | tests/spirv/coherent-2.slang | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/spirv/coherent-2.slang b/tests/spirv/coherent-2.slang new file mode 100644 index 000000000..cd7eab8c3 --- /dev/null +++ b/tests/spirv/coherent-2.slang @@ -0,0 +1,15 @@ +// Test that globallycoherent works on arrays of uavs. + +//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry main -emit-spirv-directly + +globallycoherent RWByteAddressBuffer buffer[]; + +RWStructuredBuffer<float> output; +[numthreads(4,1,1)] +void main(int tid : SV_DispatchThreadID) +{ + buffer[NonUniformResourceIndex(0)].InterlockedAdd(0, 1); + AllMemoryBarrier(); + output[tid] = buffer[0].Load(0); + // CHECK-DAG: OpDecorate %buffer Coherent +} |
