Very small sets of data and VAOs

Hello,

I’ve got another question concerning modern OpenGL. In my application I have a few very small (!) sets of vertex data. The vertex attributes are very specific and dont fit in other VAOs I already have. E.g.: I’ve got 4 vertices and 6 indices (defining 1 quad) for a very specific animated background.
As stated the configuration of vertex attributes doesn’t really fit the other VAOs and it would be ugly to force it into one of my existing VAOs (e.g. defining unused attributes or making the shadercode and variable naming very nasty).
But on the other hand its obviously far from optimal to create a new VAO including a VBO and IBO (with the lots of overhead on the client side as well as the cost of one additional VAO to switch between) either.

How would you suggest to deal with that?
Thanks in advance!

You could create a more generic shader which takes more parameters and branches depending on them which could let you batch the data into one buffer with the same vertex attributes. Assuming you’re making a 2D game, you’re almost always CPU-limited, so the additional GPU load will make the balance a bit more even.

Rumors say that on nVidia drivers VAOs are a tad slower than configuring vertex attributes when switching formats. Don’t blindly assume that VAOs are fast, or that the overhead of (not) using them is actually measurable.

I can confirm this, although very barely + my tests were a few driver versions ago.

Anyway, I still think you’re overdoing it, greenOwl. ^^ Just go for the easiest solution and optimize it if necessary later.

Could you explain what you mean with [quote]configuring vertex attributes
[/quote]
?
Yes you might be right … it just somehow bothers me to have such small VAOs as I do … especially if you look at the recommended size of one VBO …

It doesn’t matter with my small application anyway … thanks for answering though!