Skip to content

Commit 697045f

Browse files
aleino-nvslangbot
andauthored
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>
1 parent 59ba259 commit 697045f

3 files changed

+29
-1
lines changed

tests/bugs/buffer-swizzle-store.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
22
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type
33
//TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl -output-using-type
4-
// Slang-RHI/WGPU: Invalid bind group layout entry used #5612
4+
// Not supported in WGSL: read-write storage texture with "rg16f" format
55
//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-wgpu
66

77
//TEST_INPUT: RWTexture2D(format=R16G16_FLOAT, size=4, content = one, mipMaps = 1):name g_test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//TEST(compute):COMPARE_COMPUTE: -shaderobj
2+
3+
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4),name=buf
4+
RWStructuredBuffer<float4> buf;
5+
6+
//TEST_INPUT:ubuffer(data=[0], stride=4):out,name outputBuffer
7+
RWStructuredBuffer<int> outputBuffer;
8+
9+
[numthreads(1,1,1)]
10+
void computeMain()
11+
{
12+
float sum = 0.0f;
13+
14+
buf[0].wxyz = float4(1.0, 0.0, 0.0, 0.0);
15+
sum += buf[0].w;
16+
17+
buf[0].xwyz = float4(0.0, 1.0, 0.0, 0.0);
18+
sum += buf[0].w;
19+
20+
buf[0].xywz = float4(0.0, 0.0, 1.0, 0.0);
21+
sum += buf[0].w;
22+
23+
buf[0].xyzw = float4(0.0, 0.0, 0.0, 1.0);
24+
sum += buf[0].w;
25+
26+
outputBuffer[0] = int(sum);
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4

0 commit comments

Comments
 (0)