diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2025-06-30 14:37:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-30 21:37:40 +0000 |
| commit | 46d0d97222d34374f45720cbdac1f823e42a4f0d (patch) | |
| tree | f63926dfb21afccb05c9673cdb9a36e2c2665ad0 /tests/compute/spirv-array-texel-pointer-atomic.slang | |
| parent | f28f67d988158d6c46f7ffe967152f98d32a37b2 (diff) | |
Emit sample index when constructing a `OpImageTexelPointer` (#7563)
* fix #7554
* format code
* test ms and non ms texture
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tests/compute/spirv-array-texel-pointer-atomic.slang')
| -rw-r--r-- | tests/compute/spirv-array-texel-pointer-atomic.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/compute/spirv-array-texel-pointer-atomic.slang b/tests/compute/spirv-array-texel-pointer-atomic.slang new file mode 100644 index 000000000..a0013e284 --- /dev/null +++ b/tests/compute/spirv-array-texel-pointer-atomic.slang @@ -0,0 +1,25 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry computeMain -stage compute +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -slang -output-using-type -shaderobj -vk + +//TEST_INPUT: RWTexture2D(format=R32Uint, size=4, content = zero, arrayLength=2, mipMaps = 1):name rwTexture2DArray +[[vk::binding(2)]] +RWTexture2DArray<uint> rwTexture2DArray; + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer +RWStructuredBuffer<uint> outputBuffer; + + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) +{ + uint3 loc = (uint2(0), 0); + uint prevVal; +//CHECK: %{{.*}} = OpImageTexelPointer %{{.*}} %{{.*}} %{{.*}} %int_0 + InterlockedExchange(rwTexture2DArray[loc], 3, prevVal); + outputBuffer[0] = uint(true + && rwTexture2DArray[loc] == 3 + && prevVal == 0 + ); +} + +//BUF: 1
\ No newline at end of file |
