Trait glsl_layout::Uniform [−][src]
pub trait Uniform: Copy { type Align: Copy; type Std140: Std140; fn align() -> Self::Align; fn std140(&self) -> Self::Std140; }
Structure to transform data from rust's structure to the raw data ready to upload to UBO.
Users should prepfer to use derive(Uniform)
instead of implementing this manually.
Associated Types
type Align: Copy
ZST that enforces alignment required for this type.
type Std140: Std140
Type that contain same data with memory layout matching glsl's layout(std140)
.
Required Methods
fn align() -> Self::Align
The value of the Align
.
fn std140(&self) -> Self::Std140
Get aligned data from structure.
Implementations on Foreign Types
impl<T> Uniform for [T; 0] where
T: Uniform,
[src]
impl<T> Uniform for [T; 0] where
T: Uniform,
impl<T> Uniform for [T; 1] where
T: Uniform,
[src]
impl<T> Uniform for [T; 1] where
T: Uniform,
impl<T> Uniform for [T; 2] where
T: Uniform,
[src]
impl<T> Uniform for [T; 2] where
T: Uniform,
impl<T> Uniform for [T; 3] where
T: Uniform,
[src]
impl<T> Uniform for [T; 3] where
T: Uniform,
impl<T> Uniform for [T; 4] where
T: Uniform,
[src]
impl<T> Uniform for [T; 4] where
T: Uniform,
Implementors
impl Uniform for boolean type Align = Align4; type Std140 = boolean;
impl Uniform for int type Align = Align4; type Std140 = int;
impl Uniform for uint type Align = Align4; type Std140 = uint;
impl Uniform for float type Align = Align4; type Std140 = float;
impl Uniform for double type Align = Align8; type Std140 = double;
impl Uniform for bvec2 type Align = Align8; type Std140 = bvec2;
impl Uniform for bvec3 type Align = Align16; type Std140 = bvec3;
impl Uniform for bvec4 type Align = Align16; type Std140 = bvec4;
impl Uniform for ivec2 type Align = Align8; type Std140 = ivec2;
impl Uniform for ivec3 type Align = Align16; type Std140 = ivec3;
impl Uniform for ivec4 type Align = Align16; type Std140 = ivec4;
impl Uniform for uvec2 type Align = Align8; type Std140 = uvec2;
impl Uniform for uvec3 type Align = Align16; type Std140 = uvec3;
impl Uniform for uvec4 type Align = Align16; type Std140 = uvec4;
impl Uniform for vec2 type Align = Align8; type Std140 = vec2;
impl Uniform for vec3 type Align = Align16; type Std140 = vec3;
impl Uniform for vec4 type Align = Align16; type Std140 = vec4;
impl Uniform for dvec2 type Align = Align16; type Std140 = dvec2;
impl Uniform for dvec3 type Align = Align32; type Std140 = dvec3;
impl Uniform for dvec4 type Align = Align32; type Std140 = dvec4;
impl<T> Uniform for Array<T, [Element<T>; 0]> where
T: Uniform, type Align = Align16; type Std140 = Array<T::Std140, [Element<T::Std140>; 0]>;impl<T> Uniform for Array<T, [Element<T>; 1]> where
T: Uniform, type Align = Align16; type Std140 = Array<T::Std140, [Element<T::Std140>; 1]>;impl<T> Uniform for Array<T, [Element<T>; 2]> where
T: Uniform, type Align = Align16; type Std140 = Array<T::Std140, [Element<T::Std140>; 2]>;impl<T> Uniform for Array<T, [Element<T>; 3]> where
T: Uniform, type Align = Align16; type Std140 = Array<T::Std140, [Element<T::Std140>; 3]>;impl<T> Uniform for Array<T, [Element<T>; 4]> where
T: Uniform, type Align = Align16; type Std140 = Array<T::Std140, [Element<T::Std140>; 4]>;