[][src]Trait glsl_layout::AsStd140

pub unsafe trait AsStd140 {
    type Align: Copy + Default;
    type Std140: Std140 + ?Sized;
    fn std140(&self) -> Self::Std140
    where
        Self::Std140: Sized
; }

Structure to transform data from rust's structure to the raw data ready to upload to UBO. Users should prefer to use derive(AsStd140) instead of implementing this manually.

Associated Types

type Align: Copy + Default

ZST that enforces alignment required for this type.

type Std140: Std140 + ?Sized

Type that contain same data with memory layout matching glsl's layout(std140).

Loading content...

Required methods

fn std140(&self) -> Self::Std140 where
    Self::Std140: Sized

Get aligned data from structure.

Loading content...

Implementations on Foreign Types

impl<T> AsStd140 for [Element<T>] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>]

fn std140(&self) -> [Element<T::Std140>] where
    [Element<T::Std140>]: Sized
[src]

Get aligned data from structure.

impl<T> AsStd140 for [T; 0] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 0]

impl<T> AsStd140 for [Element<T>; 0] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 0]

impl<T> AsStd140 for [T; 1] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 1]

impl<T> AsStd140 for [Element<T>; 1] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 1]

impl<T> AsStd140 for [T; 2] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 2]

impl<T> AsStd140 for [Element<T>; 2] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 2]

impl<T> AsStd140 for [T; 3] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 3]

impl<T> AsStd140 for [Element<T>; 3] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 3]

impl<T> AsStd140 for [T; 4] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 4]

impl<T> AsStd140 for [Element<T>; 4] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 4]

impl<T> AsStd140 for [T; 5] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 5]

impl<T> AsStd140 for [Element<T>; 5] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 5]

impl<T> AsStd140 for [T; 6] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 6]

impl<T> AsStd140 for [Element<T>; 6] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 6]

impl<T> AsStd140 for [T; 7] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 7]

impl<T> AsStd140 for [Element<T>; 7] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 7]

impl<T> AsStd140 for [T; 8] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 8]

impl<T> AsStd140 for [Element<T>; 8] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 8]

impl<T> AsStd140 for [T; 9] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 9]

impl<T> AsStd140 for [Element<T>; 9] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 9]

impl<T> AsStd140 for [T; 10] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 10]

impl<T> AsStd140 for [Element<T>; 10] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 10]

impl<T> AsStd140 for [T; 11] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 11]

impl<T> AsStd140 for [Element<T>; 11] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 11]

impl<T> AsStd140 for [T; 12] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 12]

impl<T> AsStd140 for [Element<T>; 12] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 12]

impl<T> AsStd140 for [T; 13] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 13]

impl<T> AsStd140 for [Element<T>; 13] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 13]

impl<T> AsStd140 for [T; 14] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 14]

impl<T> AsStd140 for [Element<T>; 14] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 14]

impl<T> AsStd140 for [T; 15] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 15]

impl<T> AsStd140 for [Element<T>; 15] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 15]

impl<T> AsStd140 for [T; 16] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 16]

impl<T> AsStd140 for [Element<T>; 16] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 16]

impl<T> AsStd140 for [T; 17] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 17]

impl<T> AsStd140 for [Element<T>; 17] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 17]

impl<T> AsStd140 for [T; 18] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 18]

impl<T> AsStd140 for [Element<T>; 18] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 18]

impl<T> AsStd140 for [T; 19] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 19]

impl<T> AsStd140 for [Element<T>; 19] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 19]

impl<T> AsStd140 for [T; 20] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 20]

impl<T> AsStd140 for [Element<T>; 20] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 20]

impl<T> AsStd140 for [T; 21] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 21]

impl<T> AsStd140 for [Element<T>; 21] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 21]

impl<T> AsStd140 for [T; 22] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 22]

impl<T> AsStd140 for [Element<T>; 22] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 22]

impl<T> AsStd140 for [T; 23] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 23]

impl<T> AsStd140 for [Element<T>; 23] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 23]

impl<T> AsStd140 for [T; 24] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 24]

impl<T> AsStd140 for [Element<T>; 24] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 24]

impl<T> AsStd140 for [T; 25] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 25]

impl<T> AsStd140 for [Element<T>; 25] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 25]

impl<T> AsStd140 for [T; 26] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 26]

impl<T> AsStd140 for [Element<T>; 26] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 26]

impl<T> AsStd140 for [T; 27] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 27]

impl<T> AsStd140 for [Element<T>; 27] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 27]

impl<T> AsStd140 for [T; 28] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 28]

impl<T> AsStd140 for [Element<T>; 28] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 28]

impl<T> AsStd140 for [T; 29] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 29]

impl<T> AsStd140 for [Element<T>; 29] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 29]

impl<T> AsStd140 for [T; 30] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 30]

impl<T> AsStd140 for [Element<T>; 30] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 30]

impl<T> AsStd140 for [T; 31] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 31]

impl<T> AsStd140 for [Element<T>; 31] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 31]

impl<T> AsStd140 for [T; 32] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 32]

impl<T> AsStd140 for [Element<T>; 32] where
    T: AsStd140,
    T::Std140: Sized
[src]

type Align = Align16

type Std140 = [Element<T::Std140>; 32]

Loading content...

Implementors

impl AsStd140 for boolean[src]

type Align = Align4

type Std140 = boolean

impl AsStd140 for int[src]

type Align = Align4

type Std140 = int

impl AsStd140 for uint[src]

type Align = Align4

type Std140 = uint

impl AsStd140 for float[src]

type Align = Align4

type Std140 = float

impl AsStd140 for double[src]

type Align = Align8

type Std140 = double

impl AsStd140 for bmat2x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat2x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat2x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat3x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat3x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat3x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat4x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat4x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bmat4x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for bvec2[src]

type Align = Align8

type Std140 = bvec2

impl AsStd140 for bvec3[src]

type Align = Align16

type Std140 = bvec3

impl AsStd140 for bvec4[src]

type Align = Align16

type Std140 = bvec4

impl AsStd140 for dmat2x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for dmat2x3[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dmat2x4[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dmat3x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for dmat3x3[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dmat3x4[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dmat4x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for dmat4x3[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dmat4x4[src]

type Align = Align32

type Std140 = Self

impl AsStd140 for dvec2[src]

type Align = Align16

type Std140 = dvec2

impl AsStd140 for dvec3[src]

type Align = Align32

type Std140 = dvec3

impl AsStd140 for dvec4[src]

type Align = Align32

type Std140 = dvec4

impl AsStd140 for imat2x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat2x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat2x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat3x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat3x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat3x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat4x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat4x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for imat4x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for ivec2[src]

type Align = Align8

type Std140 = ivec2

impl AsStd140 for ivec3[src]

type Align = Align16

type Std140 = ivec3

impl AsStd140 for ivec4[src]

type Align = Align16

type Std140 = ivec4

impl AsStd140 for mat2x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat2x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat2x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat3x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat3x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat3x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat4x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat4x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for mat4x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat2x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat2x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat2x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat3x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat3x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat3x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat4x2[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat4x3[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for umat4x4[src]

type Align = Align16

type Std140 = Self

impl AsStd140 for uvec2[src]

type Align = Align8

type Std140 = uvec2

impl AsStd140 for uvec3[src]

type Align = Align16

type Std140 = uvec3

impl AsStd140 for uvec4[src]

type Align = Align16

type Std140 = uvec4

impl AsStd140 for vec2[src]

type Align = Align8

type Std140 = vec2

impl AsStd140 for vec3[src]

type Align = Align16

type Std140 = vec3

impl AsStd140 for vec4[src]

type Align = Align16

type Std140 = vec4

Loading content...