Hello,
I’m tinkering around with modern OpenGL (using vaos w/ indexed vbos) and efficient usage of vbos. My (hopefully reasonable) goal is to minimise the amount of vaos and in consequence less switching between vaos (which - as I understand it - is really expensive performancewise).
So the main difference between different vaos is the data storage namely the type (GL_POINT, GL_LINE, GL_TRIANGLE) and the attributes (datatype, name, location).
I observed that (at least) in my applications certain types of vaos are used very frequently:
- [GL_TRIANGLE, (3x4 float Attrib)]
- [GL_TRIANGLE, (4x4 float Attrib)]
- […]
Currently I have quite a decent amount of different vaos despite an overlap of this distinctive vao characteristic. So I thought about creating exactly one vao for each of these commonly used specifications and applying different shader programs with different uniforms as I need them. In other words: pooling commonly used vao specifications.
Possible downsides are:
- increased shader program switching
- forcing a standardised shader attrib naming for the pooled vaos and all shader programs I want to use with them
- significant more effort required write the code manageing the pool
- can you point out some more?
Do you think that might work at all? In my applications that would reduce the amount of vaos from ~80 to ~30 vaos which is quite a huge number. Do you think the performance increase is worth the hassle?
Thanks in advance!