-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parentheses to make precedence explicit (#6030)
* Add parentheses to make precedence explicit Add parentheses for a few cases that Dawn/Tint (WGSL compiler) complains about. Closes #6005. * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]>
- Loading branch information
1 parent
2249d6f
commit dab6cec
Showing
3 changed files
with
93 additions
and
0 deletions.
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,45 @@ | ||
//TEST(compute):COMPARE_COMPUTE:-shaderobj | ||
|
||
//TEST_INPUT:ubuffer(data=[3 7 8], stride=4):name=inputBuffer | ||
RWStructuredBuffer<uint> inputBuffer; | ||
|
||
//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer | ||
RWStructuredBuffer<uint> outputBuffer; | ||
|
||
[numthreads(1,1,1)] | ||
void computeMain() | ||
{ | ||
uint a = inputBuffer[0]; | ||
uint b = inputBuffer[1]; | ||
uint c = inputBuffer[2]; | ||
|
||
outputBuffer[0] = a+b ^ c; | ||
outputBuffer[1] = a ^ b+c; | ||
|
||
outputBuffer[2] = a-b | c; | ||
outputBuffer[3] = a | b-c; | ||
|
||
outputBuffer[4] = a+b & c; | ||
outputBuffer[5] = a & b+c; | ||
|
||
outputBuffer[6] = a<<b ^ c; | ||
outputBuffer[7] = a ^ b<<c; | ||
|
||
outputBuffer[8] = a>>b | c; | ||
outputBuffer[9] = a | b>>c; | ||
|
||
outputBuffer[10] = a<<b & c; | ||
outputBuffer[11] = a & b<<c; | ||
|
||
outputBuffer[12] = a<b && b!=c; | ||
outputBuffer[13] = a==b || b>=c; | ||
|
||
outputBuffer[14] = a*b ^ c; | ||
outputBuffer[15] = a ^ b*c; | ||
|
||
outputBuffer[16] = a/b | c; | ||
outputBuffer[17] = a | b/c; | ||
|
||
outputBuffer[18] = a*b & c; | ||
outputBuffer[19] = a & b*c; | ||
} |
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,20 @@ | ||
2 | ||
C | ||
FFFFFFFC | ||
FFFFFFFF | ||
8 | ||
3 | ||
188 | ||
703 | ||
8 | ||
3 | ||
0 | ||
0 | ||
1 | ||
0 | ||
1D | ||
3B | ||
8 | ||
3 | ||
0 | ||
0 |