pub struct InstanceBuffer { /* private fields */ }
Expand description

A buffer containing per instance data. To send this data to a shader, use the Program::use_instance_attribute method.

Implementations

Creates a new empty instance buffer.

Creates a new instance buffer and fills it with the given data. The data should be in the same format as specified in the shader. As an example, if specified as vec3 in the shader it needs to be specified as an array of Vector3<T> where T is a primitive type that implements BufferDataType, for example can be f16 or f32.

Fills the instance buffer with the given data. The data should be in the same format as specified in the shader. As an example, if specified as vec3 in the shader it needs to be specified as an array of Vector3<T> where T is a primitive type that implements BufferDataType, for example can be f16 or f32.

The number of values in the buffer.

The number of instance attributes in the buffer.

👎 Deprecated:

use new_with_data() and specify the data in the same format as in the shader (for example an array of Vec3 instead of f32)

Creates a new instance buffer and fills it with the given data which must contain between 1 and 4 contiguous values for each vertex. Use this method instead of new_with_dynamic when you do not expect the data to change often.

👎 Deprecated:

use new_with_data() and specify the data in the same format as in the shader (for example an array of Vec3 instead of f32)

Creates a new instance buffer and fills it with the given data which must contain between 1 and 4 contiguous values for each vertex. Use this method instead of new_with_static when you expect the data to change often.

👎 Deprecated:

use fill() and specify the data in the same format as in the shader (for example an array of Vec3 instead of f32)

Fills the instance buffer with the given data which must contain between 1 and 4 contiguous values for each vertex. Use this method instead of fill_with_dynamic when you do not expect the data to change often.

👎 Deprecated:

use fill() and specify the data in the same format as in the shader (for example an array of Vec3 instead of f32)

Fills the instance buffer with the given data which must contain between 1 and 4 contiguous values for each vertex. Use this method instead of fill_with_static when you expect the data to change often.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more