Growable Mappable Ring Buffer
class GrowableMappableRingBuffer @JvmOverloads constructor(val label: String, val usage: Int, val growPolicy: GrowableMappableRingBuffer.GrowPolicy = GrowPolicy.DEFAULT)
A growable GpuBuffer wrapper for streaming GPU data (e.g. dynamic VBO/IBO uploads).
This class acts like a simple linear allocator on top of MappableRingBuffer: multiple uploads can append to the current buffer until it runs out of space, then it automatically rotates to the next backing buffer. If the requested upload is larger than the backing buffer size, the ring is grown.
Behavior for each upload(data):
If there is enough space after the last write, append to the current buffer.
If the buffer is large enough but the remaining space is not, rotate() and write from offset 0.
If the entire ring buffer is too small, grow it and write from offset 0.
Author
MukjepScarlet
Constructors
Link copied to clipboard
constructor(label: String, usage: Int, growPolicy: GrowableMappableRingBuffer.GrowPolicy = GrowPolicy.DEFAULT)