644 words
3 minutes
The Mesh Shaders Rabbit Hole

If you ended up here you’re probably interested in mesh shaders. They are a relatively modern advancement in computer graphics and were thus not part of any university curriculum up until recently. That’s why I researched online anything I could find and compiled it into this collection of readaups, videos and projects that give a good view of the technology.

At a high level, mesh shaders are compute shaders applied to rendering, thus going from a segregated pipeline where each stage is its own shader (vertex, fragment etc…) to a unified one where only tessellation stages have to be programmed seperately, while the rest can be treated in one unified shader. The model came from the need of evolving beyond the previous graphics pipeline model, which inherited a lot of the fixed pipeline model from before the 2000s due to the need for retro compatibility. Now that the fixed pipeline is a thing of the past, going towards a more programmable approach was definitely the way to go. This is where Mesh Shaders came in. There is a great article by Timur, detailing what mesh shaders are and what they solve and a wonderful lecture from University of Utah on them:

Mesh shaders were also a great solution to one problem: geometry shaders. While they were extremely useful for contextual approaches to shading (e.g. vertex culling in a mesh for LOD), they were extremely slow. Tessellation shaders performed better but were not able to cover all the use cases offered by geometry shaders.

They were officially introduced by NVidia in 2018 but the support quickly spread to AMD and it became first part of the Direct3D API.

The NVidia team published some very useful articles on how to best apply the technology over the years:

AMD also published videos on the technology, through their GPU Open initiative:

The DirectX team also published some very useful lower level talks around how the new Mesh Shader pipelines change things, how to approach the problem of getting rid of the Input Assembly and Primitive Assembly stages and the takeways from tackling these problems.

The Vulkan team added the new Mesh Shader based rasterization pipeline 2 years later (4 years after the Turing Mesh Shaders were introduced by NVidia).
They also published an article introducing the new technology.

For anyone interested into using the technology, here is a collection of other links useful to better understand mesh shaders.

Bonus Content: Moving away from pipelines#

The issue of managing graphics pipelines and shader permutation has been one of the major bottleneck of graphics programming as of recently. In 2023 Vulkan introduced an extension that tried to move away from the pipeline model altogether, by hiding it behind the so called shader object: