## 23.1. Flat Shading

Flat shading a vertex output attribute means to assign all vertices of the primitive the same value for that output.

The output values assigned are those of the provoking vertex of the primitive. The provoking vertex depends on the primitive topology, and is generally the “first” vertex of the primitive. For primitives not processed by tessellation or geometry shaders, the provoking vertex is selected from the input vertices according to the following table.

Table 23.1. Provoking vertex selection

Primitive type of primitive i | Provoking vertex number
`VK_PRIMITIVE_TOPOLOGY_POINT_LIST` | i
`VK_PRIMITIVE_TOPOLOGY_LINE_LIST` | 2 i
`VK_PRIMITIVE_TOPOLOGY_LINE_STRIP` | i
`VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST` | 3 i
`VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP` | i
`VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN` | i + 1
`VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY` | 4 i + 1
`VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY` | i + 1
`VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY` | 6 i
`VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY` | 2 i

Flat shading is applied to those vertex attributes that match fragment input attributes which are decorated as `Flat`.

If a geometry shader is active, the output primitive topology is either points, line strips, or triangle strips, and the selection of the provoking vertex behaves according to the corresponding row of the table. If a tessellation evaluation shader is active and a geometry shader is not active, the provoking vertex is undefined but must be one of the vertices of the primitive.