RenderBuffersManager class
Suballocates vertex, index and uniform data from a pool of OpenGL buffer objects.
Maintains one or more mapped (or host-backed) buffer objects per buffer type and hands out aligned sub-ranges of them to render commands through AcquireMemory(). Buffers are flushed to the GPU once all commands have written their data and remapped right after the frame is drawn, ready for the next one. Persistently mapped buffers stay mapped and cycle through a ring of sections instead.
Public types
- struct BufferSpecifications
- Configuration of a buffer object for a given type.
- enum class BufferTypes { Array = 0, ElementArray, Uniform, Count }
- Type of data a buffer holds.
-
using Parameters = RHI::
BufferRange - Result of a memory request, locating a sub-range within a buffer object.
Constructors, destructors, conversion operators
-
RenderBuffersManager(bool useBufferMapping,
bool useBufferStorage,
std::
uint32_t vboMaxSize, std:: uint32_t iboMaxSize) - ~RenderBuffersManager()
Public functions
- auto Specs(BufferTypes type) const -> const BufferSpecifications&
- Returns the specifications for a buffer of the specified type.
-
auto AcquireMemory(BufferTypes type,
std::
uint32_t bytes) -> Parameters - Requests an amount of bytes from the specified buffer type.
-
auto AcquireMemory(BufferTypes type,
std::
uint32_t bytes, std:: uint32_t alignment) -> Parameters - Requests an amount of bytes from the specified buffer type with a custom alignment requirement.
Enum documentation
enum class nCine:: RenderBuffersManager:: BufferTypes
Type of data a buffer holds.
| Enumerators | |
|---|---|
| Array |
Vertex buffer object |
| ElementArray |
Index (element array) buffer object |
| Uniform |
Uniform buffer object |
| Count |
Number of buffer types |