naga::front::glsl::offset

Function calculate_offset

source
pub fn calculate_offset(
    ty: Handle<Type>,
    meta: Span,
    layout: StructLayout,
    types: &mut UniqueArena<Type>,
    errors: &mut Vec<Error>,
) -> TypeAlignSpan
Expand description

Returns the type, alignment and span of a struct member according to a StructLayout.

The functions returns a TypeAlignSpan which has a ty member this should be used as the struct member type because for example arrays may have to change the stride and as such need to have a different type.