forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WGPU: Add new test and explanation for disabled test (shader-slang#5731)
* Add buffer swizzle store test using structured buffers This helps to address shader-slang#5612 * WGPU: Add explanation for tests/bugs/buffer-swizzle-store.slang This closes shader-slang#5612. * Manual formatting fix * format code --------- Co-authored-by: slangbot <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
1 change: 1 addition & 0 deletions
1
tests/compute/structured-buffer-swizzle-store.slang.expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4 |