diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compute/vector-scalar-compare.slang | 25 | ||||
| -rw-r--r-- | tests/compute/vector-scalar-compare.slang.expected.txt | 16 |
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/compute/vector-scalar-compare.slang b/tests/compute/vector-scalar-compare.slang new file mode 100644 index 000000000..e8e701dbc --- /dev/null +++ b/tests/compute/vector-scalar-compare.slang @@ -0,0 +1,25 @@ +//TEST(compute):COMPARE_COMPUTE:-dx12 -compute +//TEST(compute):COMPARE_COMPUTE:-vk -compute +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):dxbinding(0),glbinding(0),out + +// Test doing vector comparisons +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 4, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint2 threadInGroup = dispatchThreadID.xy; + + int r = 0; + if(all((threadInGroup & 1) == 0)) + { + r = 0; + } + else + { + r = 1; + } + + int index = threadInGroup.x + threadInGroup.y * 4; + outputBuffer[index] = r; +}
\ No newline at end of file diff --git a/tests/compute/vector-scalar-compare.slang.expected.txt b/tests/compute/vector-scalar-compare.slang.expected.txt new file mode 100644 index 000000000..1424570bc --- /dev/null +++ b/tests/compute/vector-scalar-compare.slang.expected.txt @@ -0,0 +1,16 @@ +0 +1 +0 +1 +1 +1 +1 +1 +0 +1 +0 +1 +1 +1 +1 +1 |
