---
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 VectorsF64 {
pub a: [f64; 2],
pub b: [f64; 4],
pub c: [f64; 4],
}
impl VectorsF64 {
pub const fn new(a: [f64; 2], b: [f64; 4], c: [f64; 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 MatricesF64 {
pub a: [[f64; 4]; 4],
pub b: [[f64; 4]; 4],
pub c: [[f64; 2]; 4],
pub d: [[f64; 4]; 3],
pub e: [[f64; 4]; 3],
pub f: [[f64; 2]; 3],
pub g: [[f64; 4]; 2],
pub h: [[f64; 4]; 2],
pub i: [[f64; 2]; 2],
}
impl MatricesF64 {
pub const fn new(
a: [[f64; 4]; 4],
b: [[f64; 4]; 4],
c: [[f64; 2]; 4],
d: [[f64; 4]; 3],
e: [[f64; 4]; 3],
f: [[f64; 2]; 3],
g: [[f64; 4]; 2],
h: [[f64; 4]; 2],
i: [[f64; 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: MatricesF64,
}
impl Nested {
pub const fn new(a: MatricesF32, b: MatricesF64) -> Self {
Self { a, b }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct VectorsF16 {
pub a: [half::f16; 2],
pub b: [half::f16; 4],
}
impl VectorsF16 {
pub const fn new(a: [half::f16; 2], b: [half::f16; 4]) -> Self {
Self { a, b }
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct MatricesF16 {
pub a: [[half::f16; 4]; 4],
pub b: [[half::f16; 4]; 4],
pub c: [[half::f16; 2]; 4],
pub d: [[half::f16; 4]; 3],
pub e: [[half::f16; 4]; 3],
pub f: [[half::f16; 2]; 3],
pub g: [[half::f16; 4]; 2],
pub h: [[half::f16; 4]; 2],
pub i: [[half::f16; 2]; 2],
}
impl MatricesF16 {
pub const fn new(
a: [[half::f16; 4]; 4],
b: [[half::f16; 4]; 4],
c: [[half::f16; 2]; 4],
d: [[half::f16; 4]; 3],
e: [[half::f16; 4]; 3],
f: [[half::f16; 2]; 3],
g: [[half::f16; 4]; 2],
h: [[half::f16; 4]; 2],
i: [[half::f16; 2]; 2],
) -> Self {
Self {
a,
b,
c,
d,
e,
f,
g,
h,
i,
}
}
}
#[repr(C)]
#[derive(Debug, PartialEq, Clone, Copy, encase :: ShaderType)]
pub struct Atomics {
pub num: u32,
pub numi: i32,
}
impl Atomics {
pub const fn new(num: u32, numi: i32) -> Self {
Self { num, numi }
}
}