vispy.gloo.buffer.
Buffer
Bases: vispy.gloo.globject.GLObject
vispy.gloo.globject.GLObject
Generic GPU buffer.
A generic buffer is an interface used to upload data to a GPU array buffer (ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER). It keeps track of buffer size but does not have any CPU storage. You can consider it as write-only.
The set_data is a deferred operation: you can call it even if an OpenGL context is not available. The update function is responsible to upload pending data to GPU memory and requires an active GL context.
The Buffer class only deals with data in terms of bytes; it is not aware of data type or element size.
Buffer data.
Buffer byte size.
nbytes
Buffer size in bytes
resize_bytes
Resize this buffer (deferred operation).
New buffer size in bytes.
set_data
Set data in the buffer (deferred operation).
This completely resets the size and contents of the buffer.
Data to be uploaded
Since the operation is deferred, data may change before data is actually uploaded to GPU memory. Asking explicitly for a copy will prevent this behavior.
set_subdata
Set a sub-region of the buffer (deferred operation).
Offset in buffer where to start copying data (in bytes)
DataBuffer
Bases: vispy.gloo.buffer.Buffer
vispy.gloo.buffer.Buffer
GPU data buffer that is aware of data type and elements size
dtype
Buffer dtype
glsl_type
GLSL declaration strings required for a variable to hold this data.
itemsize
The total number of bytes required to store the array data
offset
Buffer offset (in bytes) relative to base
Resize the buffer (in-place, deferred operation)
New buffer size in bytes
Notes
This clears any pending operations.
Set data (deferred operation)
Additional arguments.
Offset in buffer where to start copying data (i.e. index of starting element).
Additional keyword arguments.
size
Number of elements in the buffer
stride
Stride of data in memory
DataBufferView
Bases: vispy.gloo.buffer.DataBuffer
vispy.gloo.buffer.DataBuffer
View on a sub-region of a DataBuffer.
The buffer accessed by this view.
The index into the base buffer that defines a sub-region of the buffer to view. String arguments select a single field from multi-field dtypes, and other allowed types select a subset of rows.
It is generally not necessary to instantiate this class manually; use base_buffer[key] instead.
base_buffer[key]
base
Buffer base if this buffer is a view on another buffer.
glir
The glir queue for this object.
id
The id of this GL object used to reference the GL object in GLIR. id’s are unique within a process.
IndexBuffer
Buffer for index data
VertexBuffer
Buffer for vertex attribute data
Buffer data (optional)