---
source: wgsl_bindgen/src/structs.rs
---
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct Scalars {
pub a: u32,
pub b: i32,
pub c: f32,
}
impl Scalars {
pub const fn new(a: u32, b: i32, c: f32) -> Self {
Self { a, b, c }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct VectorsU32 {
pub a: [u32; 2],
pub b: [u32; 4],
pub c: [u32; 4],
}
impl VectorsU32 {
pub const fn new(a: [u32; 2], b: [u32; 4], c: [u32; 4]) -> Self {
Self { a, b, c }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct VectorsI32 {
pub a: [i32; 2],
pub b: [i32; 4],
pub c: [i32; 4],
}
impl VectorsI32 {
pub const fn new(a: [i32; 2], b: [i32; 4], c: [i32; 4]) -> Self {
Self { a, b, c }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct VectorsF32 {
pub a: [f32; 2],
pub b: [f32; 4],
pub c: [f32; 4],
}
impl VectorsF32 {
pub const fn new(a: [f32; 2], b: [f32; 4], c: [f32; 4]) -> Self {
Self { a, b, c }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct MatricesF32 {
pub a: [[f32; 4]; 4],
pub b: [[f32; 4]; 4],
pub c: [[f32; 2]; 4],
pub d: [[f32; 4]; 3],
pub e: [[f32; 4]; 3],
pub f: [[f32; 2]; 3],
pub g: [[f32; 4]; 2],
pub h: [[f32; 4]; 2],
pub i: [[f32; 2]; 2],
}
impl MatricesF32 {
pub const fn new(
a: [[f32; 4]; 4],
b: [[f32; 4]; 4],
c: [[f32; 2]; 4],
d: [[f32; 4]; 3],
e: [[f32; 4]; 3],
f: [[f32; 2]; 3],
g: [[f32; 4]; 2],
h: [[f32; 4]; 2],
i: [[f32; 2]; 2],
) -> Self {
Self {
a,
b,
c,
d,
e,
f,
g,
h,
i,
}
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct StaticArrays {
pub a: [u32; 5],
pub b: [f32; 3],
pub c: [[[f32; 4]; 4]; 512],
}
impl StaticArrays {
pub const fn new(a: [u32; 5], b: [f32; 3], c: [[[f32; 4]; 4]; 512]) -> Self {
Self { a, b, c }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct Nested {
pub a: MatricesF32,
pub b: VectorsF32,
}
impl Nested {
pub const fn new(a: MatricesF32, b: VectorsF32) -> Self {
Self { a, b }
}
}