Description

This sample demonstrates the basic uses cases for using warp vote and warp shuffle intrinsics

Screenshot

APIs Used

  • Vulkan 1.0

Shared User Interface

The Graphics samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen which lets you interactively control certain variables in each sample.

To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.

Technical Details

Shuffle Intrinsics Vulkan Sample

This sample accompanies an article on the GameWorks developer blog and illustrates basic uses for warp shuffle and warp vote intrinsics and how you can take advantage of them in Vulkan. This application renders a triangle and then allows the user to select various rendermodes. Additionally, Vulkan shader specialization is used.

GLSL Intrinsics used in this sample

  • ballotThreadNV
  • readFirstInvocationARB
  • shuffleXorNV
  • gl_ThreadInWarpNV
  • gl_SubGroupInvocationARB
  • gl_WarpIDNV
  • gl_SMIDNV
Note: For the time being this sample requires the use of the VK_NV_glsl_shader extension. We plan to migrate to SPIR-V, once the required extensions are available.

Adjustable Options

The TweakBar features the following options you can adjust:
  • Render mode: Selects various modes
    • pass through color
    • lane id
    • tag first lane
    • tag first + last lane
    • ratio of active lanes
    • maximum across warp
    • minimum across warp
    • gl_WarpIDNV
    • gl_SMIDNV