pub enum ConstantType {
Scalar(ScalarType),
Vector(Value),
Matrix {
scalar: ScalarType,
rows: u8,
columns: u8,
major: Majorness,
stride: u32,
},
Array {
element: Box<ConstantType>,
count: u32,
stride: u32,
},
Struct {
members: Vec<Member>,
},
}Expand description
The type of one constant, with the layout it has in its buffer written out: vectors are tightly packed lanes, every matrix line and array element sits at a stated stride, whatever packing rules (D3D, std140, std430, DX9 registers) put it there.
Variants§
Scalar(ScalarType)
A single value.
Vector(Value)
Consecutive lanes of one scalar type with no padding between them.
Matrix
rows by columns of scalar. The matrix is stored as lines (rows for Majorness::Row, columns for
Majorness::Column), stride bytes apart; each line’s lanes are consecutive.
Fields
scalar: ScalarTypeThe scalar type of every lane.
Array
A run of equal elements.
Fields
element: Box<ConstantType>The element type.
Struct
Named members at explicit offsets.
Implementations§
Source§impl ConstantType
impl ConstantType
Sourcepub fn size(&self) -> Option<u32>
pub fn size(&self) -> Option<u32>
Bytes from the start of a value of this type to the end of its last byte of data: no padding after the last
matrix line, array element or member (a buffer whose rules pad an array’s tail states that in the
buffer’s size). A value with no data (a matrix of no lines or lanes, an array of no elements) is 0. None if the
layout overflows 32 bits.
Trait Implementations§
Source§impl Clone for ConstantType
impl Clone for ConstantType
Source§fn clone(&self) -> ConstantType
fn clone(&self) -> ConstantType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more