# dcl_maxOutputVertexCount (sm4 - asm)

Declares the maximum number of vertices that can be output by a geometry shader.

dcl_maxOutputVertexCount count |
---|

Item | Description |
---|---|

[in] A 32-bit unsigned integer between 1 and n, inclusive. |

A geometry shader can output a maximum of 1024 32-bit values. This maximum includes the size of the input data and the size of the data created by the shader.

Here are a few limitations:

- If the number of vertices is reached before the geometry shader finishes executing, the shader terminates.
- A geometry-shader can reach the end of its program before outputting any vertices; this is perfectly legal.
- If you are debugging a geometry shader, you can tell the number of vertices generated by counting the number of emit instructions generated.

This instruction applies to the following shader stages:

Vertex Shader | Geometry Shader | Pixel Shader |
---|---|---|

x |

This instruction is included to aid in debugging a shader in assembly; you cannot author a shader in assembly language using Shader Model 4.

## Example

Here are some examples.

Assume input data made up of position (.xyzw) and color (.rgb). Each component consumes one byte; given 7 bytes, the maximum number of vertices the shader can generate would be 1024 / (4 + 3) = 146.

dcl_maxOutputVertexCount 146

Assume your geometry shader creates 32 4-component vectors. The maximum number of vertices the shader can generate would be 1024 / (32 * 4) = 8.

dcl_maxOutputVertexCount 8

## Minimum Shader Model

This function is supported in the following shader models.

Shader Model | Supported |
---|---|

Shader Model 5 | yes |

Shader Model 4.1 | yes |

Shader Model 4 | yes |

Shader Model 3 (DirectX HLSL) | no |

Shader Model 2 (DirectX HLSL) | no |

Shader Model 1 (DirectX HLSL) | no |

## Related topics