Skip to content

Instantly share code, notes, and snippets.

@Pyromuffin
Last active July 19, 2018 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyromuffin/8a71d4d400edb8e3af2aadc7e477f6a6 to your computer and use it in GitHub Desktop.
Save Pyromuffin/8a71d4d400edb8e3af2aadc7e477f6a6 to your computer and use it in GitHub Desktop.
[numthreads(64, 1, 1)]
void BallotExample(uint gtid : SV_GroupThreadID)
{
// assuming GCN architecture with WAVE_SIZE == 64
bool firstHalf = gtid < 32;
uint2 ballotResult = WaveActiveBallot(firstHalf);
// ballotResult == 0x0000 0000 FFFF FFFF in ALL threads.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment