Struct kiss3d::resource::GPUVec [] [src]

pub struct GPUVec<T> { /* fields omitted */ }

A vector of elements that can be loaded to the GPU, on the RAM, or both.

Methods

impl<T: GLPrimitive> GPUVec<T>
[src]

Creates a new GPUVec that is not yet uploaded to the GPU.

The length of this vector.

Mutably accesses the vector if it is available on RAM.

This method will mark this vector as trash.

Immutably accesses the vector if it is available on RAM.

Returns true if this vector is already uploaded to the GPU.

Returns true if the cpu data and gpu data are out of sync.

Returns true if this vector is available on RAM.

Note that a GPUVec may be both on RAM and on the GPU.

Loads the vector from the RAM to the GPU.

If the vector is not available on RAM or already loaded to the GPU, nothing will happen.

Binds this vector to the appropriate gpu array.

This does not associate this buffer with any shader attribute.

Unbind this vector to the corresponding gpu buffer.

Loads the vector from the GPU to the RAM.

If the vector is not available on the GPU or already loaded to the RAM, nothing will happen.

Unloads this resource from the GPU.

Removes this resource from the RAM.

This is useful to save memory for vectors required on the GPU only.

impl<T: Clone + GLPrimitive> GPUVec<T>
[src]

Returns this vector as an owned vector if it is available on RAM.

If it has been uploaded to the GPU, and unloaded from the RAM, call load_to_ram first to make the data accessible.