# Different Vertex structures in multi-purpose system

A typical definition of a Vertex structure in C++ might look something like this:

struct Vertex
{
Vec3 pos;
Vec3 color;
}


However, we found ourselves designing a multi-purpose system where sometimes we need textures, sometimes colors, sometimes normals etc. and sometimes even all 3.

How is this usually delt with in graphics programming, where a single system might need to make use of different types of vertex structures?

I see two main options:

1. Define a single vertex structure with all the attributes defined and only used those that are need for each scenario. The disadvantage for this seems to be the memory usage on both the CPU and GPU side for storing thse structure
2. Define multiple different structures with different attributes. The disadvantage for this might be that it could become a management nightmare.

Thoughts?