diff --git a/tests/bugs/buffer-swizzle-store.slang b/tests/bugs/buffer-swizzle-store.slang index 6fdcc4df39..33e8a8ab9b 100644 --- a/tests/bugs/buffer-swizzle-store.slang +++ b/tests/bugs/buffer-swizzle-store.slang @@ -1,7 +1,7 @@ //TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type //TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl -output-using-type -// Slang-RHI/WGPU: Invalid bind group layout entry used #5612 +// Not supported in WGSL: read-write storage texture with "rg16f" format //DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-wgpu //TEST_INPUT: RWTexture2D(format=R16G16_FLOAT, size=4, content = one, mipMaps = 1):name g_test diff --git a/tests/compute/structured-buffer-swizzle-store.slang b/tests/compute/structured-buffer-swizzle-store.slang new file mode 100644 index 0000000000..7f07f00331 --- /dev/null +++ b/tests/compute/structured-buffer-swizzle-store.slang @@ -0,0 +1,27 @@ +//TEST(compute):COMPARE_COMPUTE: -shaderobj + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4),name=buf +RWStructuredBuffer buf; + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer +RWStructuredBuffer outputBuffer; + +[numthreads(1,1,1)] +void computeMain() +{ + float sum = 0.0f; + + buf[0].wxyz = float4(1.0, 0.0, 0.0, 0.0); + sum += buf[0].w; + + buf[0].xwyz = float4(0.0, 1.0, 0.0, 0.0); + sum += buf[0].w; + + buf[0].xywz = float4(0.0, 0.0, 1.0, 0.0); + sum += buf[0].w; + + buf[0].xyzw = float4(0.0, 0.0, 0.0, 1.0); + sum += buf[0].w; + + outputBuffer[0] = int(sum); +} diff --git a/tests/compute/structured-buffer-swizzle-store.slang.expected.txt b/tests/compute/structured-buffer-swizzle-store.slang.expected.txt new file mode 100644 index 0000000000..b8626c4cff --- /dev/null +++ b/tests/compute/structured-buffer-swizzle-store.slang.expected.txt @@ -0,0 +1 @@ +4