
Mesh Shaders
Mesh Shaders (MS) are essentially compute shaders featuring stage-specific intrinsics to export vertices, indices, and primitive data to the primitive assembler. All data must be explicitly fetched from constant buffer views (CBVs) and shader resource views (SRVs) in shader code. This means that developers will need to readjust their view of draw calls to be more in line with the workflow of compute shaders. The shader author determines the threadgroup size and how each thread is used to complete the workload. They’ll have access to shader wave intrinsics and groupshared memory to share data and efficiently build a list of primitives for rasterization. Figure 2. Visualization of the GPU work dispatched from a DispatchMesh(4, 1, 1) call with a Mesh Shader-only pipeline bound. Like compute shaders, DispatchMesh requires threadgroup counts in the x-, y-, and z-dimensions. This dispatches the specified number of Mesh Shader threadgroups for execution.
Amplification Shaders
The Amplification Shader (AS) is an optional stage that precedes the Mesh Shader stage. This stage is also compute-like with the ability to dynamically dispatch a cluster of Mesh Shader threadgroups. Each threadgroup computes its own number of Mesh Shader threadgroups to dispatch. Each threadgroup also consists of up to 16 KB of shared, custom payload data to be passed to its spawned Mesh Shader threadgroups. This data may be exported directly from groupshared memory. The functionality of Amplification Shaders enables shader programs to dynamically reduce or amplify their workload based on custom criteria. This unlocks the possibility of efficient, lower-granularity culling or custom tessellation. Figure 3. Visualization of dispatching an AS-MS pipeline state (PS) object. Some AS threadgroups will choose to dispatch MS threadgroups. Others might dispatch none.
