diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-08-11 18:19:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-11 18:19:11 -0400 |
| commit | ec095a3a736f88f095fc947659da1793c8ccc54a (patch) | |
| tree | 4a4466c4fd49e7eef5f1e69480fd1185ba5ec1dd /tests | |
| parent | cc64c619baf9ca5cdeda3f2ec83f613e753a5934 (diff) | |
Bugfix: WaveActiveCountBits on glsl output. (#1488)
* Fix WaveActiveCountBits on glsl output.
* Fix warning `could not be inlined because the return instruction is not at the end of the function. This could be fixed by running merge-return before inlining.` from glslang - because we weren't including the CreateMergeReturnPasss on default optimization, and it's assumed in InlineExhaustivePass.
* Keep WaveActiveCountBits use the default WaveMask impl.
* Fix WaveCountBits calculation.
Use WaveActiveBallot instead of the _WaveActiveBallot.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hlsl-intrinsic/wave-active-count-bits.slang | 17 | ||||
| -rw-r--r-- | tests/hlsl-intrinsic/wave-active-count-bits.slang.expected.txt | 8 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/hlsl-intrinsic/wave-active-count-bits.slang b/tests/hlsl-intrinsic/wave-active-count-bits.slang new file mode 100644 index 000000000..f337a70bb --- /dev/null +++ b/tests/hlsl-intrinsic/wave-active-count-bits.slang @@ -0,0 +1,17 @@ +//TEST_CATEGORY(wave, compute) +//DISABLE_TEST:COMPARE_COMPUTE_EX:-cpu -compute +//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute +//TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -use-dxil -profile cs_6_0 +//TEST(vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST:COMPARE_COMPUTE_EX:-cuda -compute -render-features cuda_sm_7_0 + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(8, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int idx = int(dispatchThreadID.x); + + outputBuffer[idx] = WaveActiveCountBits(idx & 5); +}
\ No newline at end of file diff --git a/tests/hlsl-intrinsic/wave-active-count-bits.slang.expected.txt b/tests/hlsl-intrinsic/wave-active-count-bits.slang.expected.txt new file mode 100644 index 000000000..9d96764ee --- /dev/null +++ b/tests/hlsl-intrinsic/wave-active-count-bits.slang.expected.txt @@ -0,0 +1,8 @@ +6 +6 +6 +6 +6 +6 +6 +6 |
