Home » Samples »

Vulkan® mbcnt Sample

This sample shows how to use the AMD_shader_ballot extension and mbcnt to perform a fast reduction within a wavefront.

For more information about Vulkan®, visit our dedicated page:

Vulkan®

Vulkan® gives software developers control over the performance, efficiency, and capabilities of AMD Radeon™ GPUs and multi-core CPUs.

Extension details

  • mbcnt computes the number of bits set in the provided argument, masked with a thread mask which contains 1 for all active threads less than the current thread within a wavefront.
  • ballot returns a 64-bit mask which contains 1 if that thread within the wavefront passed true into the instruction, and 0 otherwise.

Requirements

  • AMD Radeon™ GCN-based GPU (HD 7000 series or newer)
    • Or other Vulkan® compatible discrete GPU.
  • 64-bit Windows® 7 (SP1 with the Platform Update), Windows® 8.1, or Windows® 10.
  • Visual Studio® 2013 or Visual Studio® 2015.
  • Graphics driver with Vulkan® support
    • For example, AMD Radeon™ Software Crimson Edition 16.5.2 or later.
  • The Vulkan® SDK must be installed.

You may also be interested in...

Some light reading to take away with you. Our presentations, ISAs, manuals, whitepapers, and many more.

Developer guides

Browse our developer guides, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan, DirectX, UE4, and lots more.

Words not enough? How about pictures? How about moving pictures? We have some amazing videos to share with you!

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Product Blogs

Our handy product blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

Publications

Discover our published publications.