Skip to main content
We recommend that you first read the Meshlets topic. The Meshlet culling example topic presents the pseudocode of an Amplification Shader implementation of a technique called meshlet culling. Since a meshlet’s primitives ideally conform to spatial and orientational coherence, we can store efficient culling data per-meshlet. This can be used to quickly cull a meshlet list against a view in an Amplification Shader and only dispatch Mesh Shader instances for those surviving meshlets. The technique starts with an Amplification Shader where each thread processes a single meshlet. This means that we must dispatch ceil(MeshletCount / GROUP_SIZE) threadgroups on the command list. Each Amplification Shader threadgroup is then responsible for processing GROUP_SIZE meshlets. Each thread culls its meshlet against the view frustum, determines its export slot, and then writes its index to the payload data. It then uses DispatchMesh to dispatch one Mesh Shader threadgroup for each surviving meshlet to render. Each Mesh Shader threadgroup then loads its meshlet from the payload data and exports its geometry. The full sample can be found on the XBOX Developer Downloads page.

Amplification Shader

The Amplification Shader structure is identical to compute shaders but concludes with at most one ‘DispatchMesh(…)’ call. First, each thread loads its meshlet and culls it against the view. Next, a compaction routine is performed to determine each thread’s final write location. This also provides the final count of unculled meshlets for the threadgroup. Finally, the meshlet index is then written to the groupshared payload data, and DispatchMesh is called with the surviving meshlet count and the payload data. The following example shows an Amplification Shader implementing meshlet culling in pseudocode.

Mesh Shader

The pipeline’s Mesh Shader is very similar to meshlet rendering by using a Mesh Shader-only pipeline except that we read the threadgroup’s meshlet index from the payload data. The payload data is the same data that’s built and exported from the preceding Amplification Shader. GroupIDs and DispatchThreadIDs are localized to the Mesh Shader cluster that’s dispatched from the invoking Amplification Shader threadgroup, and they all share the same payload data. This code example shows the Mesh Shader following the previous Amplification Shader.

See also

Mesh Shader pipeline overview Why Mesh Shaders? Mesh Shader API overview Meshlets
Last modified on August 20, 2026