VAO perfomance

VAO has already been discussed too much, so I appreciate pointing me to any old discussion if there’s a helpful info (regarding my problem, but not a general info).

The question concerns VAO performance in case of having multiple patterns of vertex attributes that require binding. Imagine you have 4 vertex attributes & indexes. In the first case I need only 1-st attribute, in the second case I need all of them and in the third case I need, to say, only 2-nd and 4-th.

What of these approaches are considered to be more effective?
1:single) have a single VAO containing all attributes, activate it when needed
2:multi) have multiple VAO: one for each usage scheme
3:merged) bind attributes in VBO’s manually when you need just 1 or 2 more than some VAO does, for example.

Nobody really knows. I would suggest 2; it ought to be no slower than 1 or 3. And it has a chance of being faster, depending on optimizations.

Thanks Alfonse,
I thought about 2-nd variant as well to be the best choice. Just curious about hidden bottlenecks with multiple VAO that I’m not aware of…

Well I think that finally the road to wisdom is a 2 legged journey: (1) read the vendor perf docs for your target hardware and (2) bench, bench, how much ya bench?

  1. I don’t have a concrete target hw.
  2. Currently i’m in stage of designing the class structure. I don’t have a set of examples to test with, just wondering if similar tests were already performed by someone.