Mesh Shader Max Output Vertices Hardware Limits
In modern graphics APIs like Vulkan and OpenGL, GLSL mesh shaders
provide compute-like control over the geometry pipeline, but their
maximum output vertices per workgroup are strictly constrained by the
underlying GPU architecture. The limit—typically reported by the
hardware as maxMeshOutputVertices and standardized to a
maximum of 256 vertices across major vendors—is dictated by physical
on-chip memory limits, index bit-width designs, register allocation, and
fixed-function rasterizer interfaces.
On-Chip Memory and Primitive Cache Size
The primary hardware limitation constraining vertex output is the physical size of on-chip storage (such as Local Data Share on AMD or Shared Memory/Register Files on NVIDIA). A mesh shader does not write vertices directly to off-chip VRAM; instead, it outputs vertex attributes to low-latency, on-chip SRAM to be fed directly into the rasterizer.
Because each vertex requires storage for positions, normals, texture coordinates, and custom user-defined varyings, the total memory consumed by a single workgroup scales directly with the vertex count multiplied by the attribute payload size. GPU architectures have a fixed allocation per streaming multiprocessor (SM) or compute unit (CU). Increasing the maximum vertex count would rapidly exhaust this memory, severely reducing workgroup occupancy or exceeding the physical cache line budgets assigned to the primitive pipelines.
8-Bit Indexing Architecture
Mesh shader hardware is optimized around localized micro-meshes (meshlets). To minimize memory bandwidth and footprint within the shader core, the hardware's internal primitive generation logic typically relies on compact 8-bit indices for triangle topologies.
A single byte (uint8_t) can address an index range from
0 to 255, providing a natural hardware boundary of 256 unique output
vertices. Moving beyond 256 vertices would require 16-bit indices, which
would immediately double the size of the primitive index buffer and
increase data routing complexity inside the hardware primitive assembly
units.
Wavefront and Warp Granularity
Mesh shader workgroups execute on hardware SIMD units (e.g., 32-thread warps or 32/64-thread wavefronts). GPUs are designed to balance the ratio between thread count, register usage, and vertex output. Hardware schedulers distribute work based on expected power-of-two batches. A limit of 256 vertices cleanly maps to standard wave dimensions (such as 4 to 8 waves of 32 or 64 threads), ensuring that primitive and vertex memory layouts can be evenly partitioned without creating memory bank conflicts or underutilizing SIMD lanes.
Interconnect Bandwidth to the Rasterizer
Once a workgroup finishes processing, the assembled primitives and interpolated vertices must be transferred across the internal crossbar to the primitive distributors and hardware rasterizers. The rasterization front-end is provisioned with fixed-size input buffers. If a single workgroup were permitted to output arbitrary or massive numbers of vertices, it could create bottlenecks in the rasterizer’s attribute interpolation stage and cause pipeline stalls, degrading throughput across concurrent stages of the graphics pipeline.