diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-02 22:04:40 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-02 22:04:40 -0800 |
| commit | c15e7ade4e27e1649d5b98f5854e9e52bb9e60ae (patch) | |
| tree | 22082fda85b2b25eec36da8c4505de7b6cb987fc /tests/hlsl-intrinsic/texture | |
| parent | a67cb0609587c230746b52567ff5775cab215220 (diff) | |
Atomics+Wave ops intrinsics fixes. (#3542)
* Fix atomics intrinsics, increase kMaxDescriptorSets.
* Add SPIRVASM to known non-differentiable insts.
* Support fp16 wave ops when targeting glsl.
* Fixes.
* Fix vk validation errors.
* Fix.
* Add to allowed failures.
Diffstat (limited to 'tests/hlsl-intrinsic/texture')
| -rw-r--r-- | tests/hlsl-intrinsic/texture/float-atomics.slang | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/hlsl-intrinsic/texture/float-atomics.slang b/tests/hlsl-intrinsic/texture/float-atomics.slang index 4e7405f3d..02cb5570c 100644 --- a/tests/hlsl-intrinsic/texture/float-atomics.slang +++ b/tests/hlsl-intrinsic/texture/float-atomics.slang @@ -7,29 +7,23 @@ //TEST_INPUT: set t = RWTexture2D(format=R32_FLOAT, size=4, content = zero, mipMaps = 1) [format("r32f")] -RWTexture2D<float> t; +globallycoherent RWTexture2D<float> t; //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<float> outputBuffer; [shader("compute")] -[numthreads(1, 1, 1)] +[numthreads(4, 1, 1)] void computeMain(uint3 tid : SV_DispatchThreadID) { float originalValue; + // HLSL: {{.*}}originalValue{{.*}} = NvInterlockedAddFp32({{.*}}t{{.*}}, {{.*}}, {{.*}}1.0{{.*}}); - // HLSL: {{.*}}originalValue{{.*}} = NvInterlockedAddFp32({{.*}}t{{.*}}, {{.*}}, {{.*}}2.0{{.*}}); - // HLSL: {{.*}}originalValue{{.*}} = NvInterlockedAddFp32({{.*}}t{{.*}}, {{.*}}, {{.*}}3.0{{.*}}); - t.InterlockedAddF32(uint2(0, 0), 1.0, originalValue); - t.InterlockedAddF32(uint2(1, 0), 2.0, originalValue); - t.InterlockedAddF32(uint2(1, 1), 3.0, originalValue); - // CHECK: 1.0 - outputBuffer[0] = t[uint2(0, 0)]; - // CHECK: 2.0 - outputBuffer[1] = t[uint2(1, 0)]; - // CHECK: 3.0 - outputBuffer[2] = t[uint2(1, 1)]; - // CHECK: 0.0 - outputBuffer[3] = originalValue; + t.InterlockedAddF32(uint2(1, 0), 1.0, originalValue); + + AllMemoryBarrier(); + + // CHECK: 4.0 + outputBuffer[0] = t[uint2(1, 0)]; } |
