GPU Buffer wrappers for ChuGL
Class representing a GPU Storage Buffer.
StorageBuffer()
Default constructor for StorageBuffer.
void size(int size)
Sets size in 4-byte units of the buffer. Does NOT copy data from old buffer to new one if buffer is resized. Buffer size in bytes will be 4 * size.
void write(float[] data)
Writes data to the start of buffer. Floats from the chuck data array are converted into 4-byte f32s. Will increase buffer size if needed. Will not decrease buffer size if data is smaller than buffer size.
void write(float[] data, int offset_bytes)
Writes data to the buffer at the specified offset in floatas. Floats from the chuck array are converted into 4-byte f32s. Fails if buffer size is too small.
[ top ]