RenderVaoPool class
#include <nCine/Graphics/RenderVaoPool.h>
Pool of reusable Vertex Array Objects.
Caches VAOs keyed by their vertex format so the same configuration can be rebound across frames instead of recreated. When the pool is full the least recently used binding is recycled.
Constructors, destructors, conversion operators
-
RenderVaoPool(std::
uint32_t vaoPoolSize) explicit
Public functions
- void BindVao(const RHI::VertexFormat& vertexFormat)
- Binds a VAO matching the specified vertex format, reusing a pooled one or creating it.
- void BindEmptyVao()
- Binds a VAO without any attributes, for a draw that reads nothing from a buffer.
Function documentation
void nCine:: RenderVaoPool:: BindEmptyVao()
Binds a VAO without any attributes, for a draw that reads nothing from a buffer.
The same as BindVao() with an empty vertex format, but without searching the pool, a VAO of its own is kept for it, so drawing many such commands in a row costs a single comparison each.