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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for UniformBuffer
impl !Send for UniformBuffer
impl !Sync for UniformBuffer
impl Unpin for UniformBuffer
impl !UnwindSafe for UniformBuffer
Blanket Implementations
Mutably borrows from an owned value. Read more
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