diff options
| author | Anders Leino <aleino@nvidia.com> | 2024-12-04 10:58:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-04 00:58:40 -0800 |
| commit | 697045f1b4f7d0977c69fd5b67089d735fff428d (patch) | |
| tree | 6fbd8b3242e088496187148d104442a452bf8fc1 | |
| parent | 59ba2594dedac02ad2ef7bc049bd78f5412e1a92 (diff) | |
WGPU: Add new test and explanation for disabled test (#5731)
* Add buffer swizzle store test using structured buffers
This helps to address #5612
* WGPU: Add explanation for tests/bugs/buffer-swizzle-store.slang
This closes #5612.
* Manual formatting fix
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
| -rw-r--r-- | tests/bugs/buffer-swizzle-store.slang | 2 | ||||
| -rw-r--r-- | tests/compute/structured-buffer-swizzle-store.slang | 27 | ||||
| -rw-r--r-- | tests/compute/structured-buffer-swizzle-store.slang.expected.txt | 1 |
3 files changed, 29 insertions, 1 deletions
diff --git a/tests/bugs/buffer-swizzle-store.slang b/tests/bugs/buffer-swizzle-store.slang index 6fdcc4df3..33e8a8ab9 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 000000000..7f07f0033 --- /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<float4> buf; + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer +RWStructuredBuffer<int> 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 000000000..b8626c4cf --- /dev/null +++ b/tests/compute/structured-buffer-swizzle-store.slang.expected.txt @@ -0,0 +1 @@ +4 |
