Struct three_d::core::buffer::UniformBuffer[][src]

pub struct UniformBuffer { /* fields omitted */ }
Expand description

A buffer for transferring a set of uniform variables to the shader program (see also use_uniform_block).

Implementations

Creates a new uniform buffer with room for a set of variables of varying length defined by the sizes argument. So for example if you create a uniform buffer with &[3, 1, 4, 16] as the sizes argument, you will have a uniform buffer that has four variables: The first with 3 elements (a Vec3), the second with 1 element (a f32), the third with four elements (a Vec4) and the last with 16 elements (a Mat4). The variables are initialized to 0.

Update the values of the variable at the given index with the given data.

Errors

Will return an error if the index is not in the range [0-max] where max is the length of the sizes argument given at construction. Will return an error if the data length does not match the element count of the variable (defined at construction) at the given index.

Returns the values of the variable at the given index.

Errors

Will return an error if the index is not in the range [0-max] where max is the length of the sizes argument given at construction.

Trait Implementations

Executes the destructor for this type. Read more

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

Performs the conversion.

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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