use align::{Align16, Align32};
use array::{Element, MapArray};
use vec::{bvec2, bvec3, bvec4, dvec2, dvec3, dvec4, ivec2, ivec3, ivec4, uvec2, uvec3, uvec4,
vec2, vec3, vec4};
use std140::{AsStd140, Std140};
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat2x2([Element<bvec2>; 2]);
unsafe impl Std140 for bmat2x2 {}
unsafe impl AsStd140 for bmat2x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for bmat2x2
where
T: Into<bvec2>,
{
fn from(values: [T; 2]) -> Self {
bmat2x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec2>; 2]> for bmat2x2 {
fn from(values: [Element<bvec2>; 2]) -> Self {
bmat2x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat2x3([Element<bvec3>; 2]);
unsafe impl Std140 for bmat2x3 {}
unsafe impl AsStd140 for bmat2x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for bmat2x3
where
T: Into<bvec3>,
{
fn from(values: [T; 2]) -> Self {
bmat2x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec3>; 2]> for bmat2x3 {
fn from(values: [Element<bvec3>; 2]) -> Self {
bmat2x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat2x4([Element<bvec4>; 2]);
unsafe impl Std140 for bmat2x4 {}
unsafe impl AsStd140 for bmat2x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for bmat2x4
where
T: Into<bvec4>,
{
fn from(values: [T; 2]) -> Self {
bmat2x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec4>; 2]> for bmat2x4 {
fn from(values: [Element<bvec4>; 2]) -> Self {
bmat2x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat3x2([Element<bvec2>; 3]);
unsafe impl Std140 for bmat3x2 {}
unsafe impl AsStd140 for bmat3x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for bmat3x2
where
T: Into<bvec2>,
{
fn from(values: [T; 3]) -> Self {
bmat3x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec2>; 3]> for bmat3x2 {
fn from(values: [Element<bvec2>; 3]) -> Self {
bmat3x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat3x3([Element<bvec3>; 3]);
unsafe impl Std140 for bmat3x3 {}
unsafe impl AsStd140 for bmat3x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for bmat3x3
where
T: Into<bvec3>,
{
fn from(values: [T; 3]) -> Self {
bmat3x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec3>; 3]> for bmat3x3 {
fn from(values: [Element<bvec3>; 3]) -> Self {
bmat3x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat3x4([Element<bvec4>; 3]);
unsafe impl Std140 for bmat3x4 {}
unsafe impl AsStd140 for bmat3x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for bmat3x4
where
T: Into<bvec4>,
{
fn from(values: [T; 3]) -> Self {
bmat3x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec4>; 3]> for bmat3x4 {
fn from(values: [Element<bvec4>; 3]) -> Self {
bmat3x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat4x2([Element<bvec2>; 4]);
unsafe impl Std140 for bmat4x2 {}
unsafe impl AsStd140 for bmat4x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for bmat4x2
where
T: Into<bvec2>,
{
fn from(values: [T; 4]) -> Self {
bmat4x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec2>; 4]> for bmat4x2 {
fn from(values: [Element<bvec2>; 4]) -> Self {
bmat4x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat4x3([Element<bvec3>; 4]);
unsafe impl Std140 for bmat4x3 {}
unsafe impl AsStd140 for bmat4x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for bmat4x3
where
T: Into<bvec3>,
{
fn from(values: [T; 4]) -> Self {
bmat4x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec3>; 4]> for bmat4x3 {
fn from(values: [Element<bvec3>; 4]) -> Self {
bmat4x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct bmat4x4([Element<bvec4>; 4]);
unsafe impl Std140 for bmat4x4 {}
unsafe impl AsStd140 for bmat4x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for bmat4x4
where
T: Into<bvec4>,
{
fn from(values: [T; 4]) -> Self {
bmat4x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<bvec4>; 4]> for bmat4x4 {
fn from(values: [Element<bvec4>; 4]) -> Self {
bmat4x4(values)
}
}
pub type bmat2 = bmat2x2;
pub type bmat3 = bmat3x3;
pub type bmat4 = bmat4x4;
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat2x2([Element<ivec2>; 2]);
unsafe impl Std140 for imat2x2 {}
unsafe impl AsStd140 for imat2x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for imat2x2
where
T: Into<ivec2>,
{
fn from(values: [T; 2]) -> Self {
imat2x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec2>; 2]> for imat2x2 {
fn from(values: [Element<ivec2>; 2]) -> Self {
imat2x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat2x3([Element<ivec3>; 2]);
unsafe impl Std140 for imat2x3 {}
unsafe impl AsStd140 for imat2x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for imat2x3
where
T: Into<ivec3>,
{
fn from(values: [T; 2]) -> Self {
imat2x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec3>; 2]> for imat2x3 {
fn from(values: [Element<ivec3>; 2]) -> Self {
imat2x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat2x4([Element<ivec4>; 2]);
unsafe impl Std140 for imat2x4 {}
unsafe impl AsStd140 for imat2x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for imat2x4
where
T: Into<ivec4>,
{
fn from(values: [T; 2]) -> Self {
imat2x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec4>; 2]> for imat2x4 {
fn from(values: [Element<ivec4>; 2]) -> Self {
imat2x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat3x2([Element<ivec2>; 3]);
unsafe impl Std140 for imat3x2 {}
unsafe impl AsStd140 for imat3x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for imat3x2
where
T: Into<ivec2>,
{
fn from(values: [T; 3]) -> Self {
imat3x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec2>; 3]> for imat3x2 {
fn from(values: [Element<ivec2>; 3]) -> Self {
imat3x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat3x3([Element<ivec3>; 3]);
unsafe impl Std140 for imat3x3 {}
unsafe impl AsStd140 for imat3x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for imat3x3
where
T: Into<ivec3>,
{
fn from(values: [T; 3]) -> Self {
imat3x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec3>; 3]> for imat3x3 {
fn from(values: [Element<ivec3>; 3]) -> Self {
imat3x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat3x4([Element<ivec4>; 3]);
unsafe impl Std140 for imat3x4 {}
unsafe impl AsStd140 for imat3x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for imat3x4
where
T: Into<ivec4>,
{
fn from(values: [T; 3]) -> Self {
imat3x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec4>; 3]> for imat3x4 {
fn from(values: [Element<ivec4>; 3]) -> Self {
imat3x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat4x2([Element<ivec2>; 4]);
unsafe impl Std140 for imat4x2 {}
unsafe impl AsStd140 for imat4x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for imat4x2
where
T: Into<ivec2>,
{
fn from(values: [T; 4]) -> Self {
imat4x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec2>; 4]> for imat4x2 {
fn from(values: [Element<ivec2>; 4]) -> Self {
imat4x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat4x3([Element<ivec3>; 4]);
unsafe impl Std140 for imat4x3 {}
unsafe impl AsStd140 for imat4x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for imat4x3
where
T: Into<ivec3>,
{
fn from(values: [T; 4]) -> Self {
imat4x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec3>; 4]> for imat4x3 {
fn from(values: [Element<ivec3>; 4]) -> Self {
imat4x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct imat4x4([Element<ivec4>; 4]);
unsafe impl Std140 for imat4x4 {}
unsafe impl AsStd140 for imat4x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for imat4x4
where
T: Into<ivec4>,
{
fn from(values: [T; 4]) -> Self {
imat4x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<ivec4>; 4]> for imat4x4 {
fn from(values: [Element<ivec4>; 4]) -> Self {
imat4x4(values)
}
}
pub type imat2 = imat2x2;
pub type imat3 = imat3x3;
pub type imat4 = imat4x4;
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat2x2([Element<uvec2>; 2]);
unsafe impl Std140 for umat2x2 {}
unsafe impl AsStd140 for umat2x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for umat2x2
where
T: Into<uvec2>,
{
fn from(values: [T; 2]) -> Self {
umat2x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec2>; 2]> for umat2x2 {
fn from(values: [Element<uvec2>; 2]) -> Self {
umat2x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat2x3([Element<uvec3>; 2]);
unsafe impl Std140 for umat2x3 {}
unsafe impl AsStd140 for umat2x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for umat2x3
where
T: Into<uvec3>,
{
fn from(values: [T; 2]) -> Self {
umat2x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec3>; 2]> for umat2x3 {
fn from(values: [Element<uvec3>; 2]) -> Self {
umat2x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat2x4([Element<uvec4>; 2]);
unsafe impl Std140 for umat2x4 {}
unsafe impl AsStd140 for umat2x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for umat2x4
where
T: Into<uvec4>,
{
fn from(values: [T; 2]) -> Self {
umat2x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec4>; 2]> for umat2x4 {
fn from(values: [Element<uvec4>; 2]) -> Self {
umat2x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat3x2([Element<uvec2>; 3]);
unsafe impl Std140 for umat3x2 {}
unsafe impl AsStd140 for umat3x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for umat3x2
where
T: Into<uvec2>,
{
fn from(values: [T; 3]) -> Self {
umat3x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec2>; 3]> for umat3x2 {
fn from(values: [Element<uvec2>; 3]) -> Self {
umat3x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat3x3([Element<uvec3>; 3]);
unsafe impl Std140 for umat3x3 {}
unsafe impl AsStd140 for umat3x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for umat3x3
where
T: Into<uvec3>,
{
fn from(values: [T; 3]) -> Self {
umat3x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec3>; 3]> for umat3x3 {
fn from(values: [Element<uvec3>; 3]) -> Self {
umat3x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat3x4([Element<uvec4>; 3]);
unsafe impl Std140 for umat3x4 {}
unsafe impl AsStd140 for umat3x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for umat3x4
where
T: Into<uvec4>,
{
fn from(values: [T; 3]) -> Self {
umat3x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec4>; 3]> for umat3x4 {
fn from(values: [Element<uvec4>; 3]) -> Self {
umat3x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat4x2([Element<uvec2>; 4]);
unsafe impl Std140 for umat4x2 {}
unsafe impl AsStd140 for umat4x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for umat4x2
where
T: Into<uvec2>,
{
fn from(values: [T; 4]) -> Self {
umat4x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec2>; 4]> for umat4x2 {
fn from(values: [Element<uvec2>; 4]) -> Self {
umat4x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat4x3([Element<uvec3>; 4]);
unsafe impl Std140 for umat4x3 {}
unsafe impl AsStd140 for umat4x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for umat4x3
where
T: Into<uvec3>,
{
fn from(values: [T; 4]) -> Self {
umat4x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec3>; 4]> for umat4x3 {
fn from(values: [Element<uvec3>; 4]) -> Self {
umat4x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq, Ord, Eq, Hash)]
#[repr(transparent)]
pub struct umat4x4([Element<uvec4>; 4]);
unsafe impl Std140 for umat4x4 {}
unsafe impl AsStd140 for umat4x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for umat4x4
where
T: Into<uvec4>,
{
fn from(values: [T; 4]) -> Self {
umat4x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<uvec4>; 4]> for umat4x4 {
fn from(values: [Element<uvec4>; 4]) -> Self {
umat4x4(values)
}
}
pub type umat2 = umat2x2;
pub type umat3 = umat3x3;
pub type umat4 = umat4x4;
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat2x2([Element<vec2>; 2]);
unsafe impl Std140 for mat2x2 {}
unsafe impl AsStd140 for mat2x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for mat2x2
where
T: Into<vec2>,
{
fn from(values: [T; 2]) -> Self {
mat2x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec2>; 2]> for mat2x2 {
fn from(values: [Element<vec2>; 2]) -> Self {
mat2x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat2x3([Element<vec3>; 2]);
unsafe impl Std140 for mat2x3 {}
unsafe impl AsStd140 for mat2x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for mat2x3
where
T: Into<vec3>,
{
fn from(values: [T; 2]) -> Self {
mat2x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec3>; 2]> for mat2x3 {
fn from(values: [Element<vec3>; 2]) -> Self {
mat2x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat2x4([Element<vec4>; 2]);
unsafe impl Std140 for mat2x4 {}
unsafe impl AsStd140 for mat2x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for mat2x4
where
T: Into<vec4>,
{
fn from(values: [T; 2]) -> Self {
mat2x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec4>; 2]> for mat2x4 {
fn from(values: [Element<vec4>; 2]) -> Self {
mat2x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat3x2([Element<vec2>; 3]);
unsafe impl Std140 for mat3x2 {}
unsafe impl AsStd140 for mat3x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for mat3x2
where
T: Into<vec2>,
{
fn from(values: [T; 3]) -> Self {
mat3x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec2>; 3]> for mat3x2 {
fn from(values: [Element<vec2>; 3]) -> Self {
mat3x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat3x3([Element<vec3>; 3]);
unsafe impl Std140 for mat3x3 {}
unsafe impl AsStd140 for mat3x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for mat3x3
where
T: Into<vec3>,
{
fn from(values: [T; 3]) -> Self {
mat3x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec3>; 3]> for mat3x3 {
fn from(values: [Element<vec3>; 3]) -> Self {
mat3x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat3x4([Element<vec4>; 3]);
unsafe impl Std140 for mat3x4 {}
unsafe impl AsStd140 for mat3x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for mat3x4
where
T: Into<vec4>,
{
fn from(values: [T; 3]) -> Self {
mat3x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec4>; 3]> for mat3x4 {
fn from(values: [Element<vec4>; 3]) -> Self {
mat3x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat4x2([Element<vec2>; 4]);
unsafe impl Std140 for mat4x2 {}
unsafe impl AsStd140 for mat4x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for mat4x2
where
T: Into<vec2>,
{
fn from(values: [T; 4]) -> Self {
mat4x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec2>; 4]> for mat4x2 {
fn from(values: [Element<vec2>; 4]) -> Self {
mat4x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat4x3([Element<vec3>; 4]);
unsafe impl Std140 for mat4x3 {}
unsafe impl AsStd140 for mat4x3 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for mat4x3
where
T: Into<vec3>,
{
fn from(values: [T; 4]) -> Self {
mat4x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec3>; 4]> for mat4x3 {
fn from(values: [Element<vec3>; 4]) -> Self {
mat4x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct mat4x4([Element<vec4>; 4]);
unsafe impl Std140 for mat4x4 {}
unsafe impl AsStd140 for mat4x4 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for mat4x4
where
T: Into<vec4>,
{
fn from(values: [T; 4]) -> Self {
mat4x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<vec4>; 4]> for mat4x4 {
fn from(values: [Element<vec4>; 4]) -> Self {
mat4x4(values)
}
}
pub type mat2 = mat2x2;
pub type mat3 = mat3x3;
pub type mat4 = mat4x4;
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat2x2([Element<dvec2>; 2]);
unsafe impl Std140 for dmat2x2 {}
unsafe impl AsStd140 for dmat2x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for dmat2x2
where
T: Into<dvec2>,
{
fn from(values: [T; 2]) -> Self {
dmat2x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec2>; 2]> for dmat2x2 {
fn from(values: [Element<dvec2>; 2]) -> Self {
dmat2x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat2x3([Element<dvec3>; 2]);
unsafe impl Std140 for dmat2x3 {}
unsafe impl AsStd140 for dmat2x3 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for dmat2x3
where
T: Into<dvec3>,
{
fn from(values: [T; 2]) -> Self {
dmat2x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec3>; 2]> for dmat2x3 {
fn from(values: [Element<dvec3>; 2]) -> Self {
dmat2x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat2x4([Element<dvec4>; 2]);
unsafe impl Std140 for dmat2x4 {}
unsafe impl AsStd140 for dmat2x4 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 2]> for dmat2x4
where
T: Into<dvec4>,
{
fn from(values: [T; 2]) -> Self {
dmat2x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec4>; 2]> for dmat2x4 {
fn from(values: [Element<dvec4>; 2]) -> Self {
dmat2x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat3x2([Element<dvec2>; 3]);
unsafe impl Std140 for dmat3x2 {}
unsafe impl AsStd140 for dmat3x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for dmat3x2
where
T: Into<dvec2>,
{
fn from(values: [T; 3]) -> Self {
dmat3x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec2>; 3]> for dmat3x2 {
fn from(values: [Element<dvec2>; 3]) -> Self {
dmat3x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat3x3([Element<dvec3>; 3]);
unsafe impl Std140 for dmat3x3 {}
unsafe impl AsStd140 for dmat3x3 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for dmat3x3
where
T: Into<dvec3>,
{
fn from(values: [T; 3]) -> Self {
dmat3x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec3>; 3]> for dmat3x3 {
fn from(values: [Element<dvec3>; 3]) -> Self {
dmat3x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat3x4([Element<dvec4>; 3]);
unsafe impl Std140 for dmat3x4 {}
unsafe impl AsStd140 for dmat3x4 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 3]> for dmat3x4
where
T: Into<dvec4>,
{
fn from(values: [T; 3]) -> Self {
dmat3x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec4>; 3]> for dmat3x4 {
fn from(values: [Element<dvec4>; 3]) -> Self {
dmat3x4(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat4x2([Element<dvec2>; 4]);
unsafe impl Std140 for dmat4x2 {}
unsafe impl AsStd140 for dmat4x2 {
type Align = Align16;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for dmat4x2
where
T: Into<dvec2>,
{
fn from(values: [T; 4]) -> Self {
dmat4x2(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec2>; 4]> for dmat4x2 {
fn from(values: [Element<dvec2>; 4]) -> Self {
dmat4x2(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat4x3([Element<dvec3>; 4]);
unsafe impl Std140 for dmat4x3 {}
unsafe impl AsStd140 for dmat4x3 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for dmat4x3
where
T: Into<dvec3>,
{
fn from(values: [T; 4]) -> Self {
dmat4x3(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec3>; 4]> for dmat4x3 {
fn from(values: [Element<dvec3>; 4]) -> Self {
dmat4x3(values)
}
}
#[derive(Clone, Copy, Debug, Default, PartialOrd, PartialEq)]
#[repr(transparent)]
pub struct dmat4x4([Element<dvec4>; 4]);
unsafe impl Std140 for dmat4x4 {}
unsafe impl AsStd140 for dmat4x4 {
type Align = Align32;
type Std140 = Self;
fn std140(&self) -> Self::Std140 { *self }
}
impl<T> From<[T; 4]> for dmat4x4
where
T: Into<dvec4>,
{
fn from(values: [T; 4]) -> Self {
dmat4x4(MapArray::map_array(values, |v: T| v.into().into()))
}
}
impl From<[Element<dvec4>; 4]> for dmat4x4 {
fn from(values: [Element<dvec4>; 4]) -> Self {
dmat4x4(values)
}
}
pub type dmat2 = dmat2x2;
pub type dmat3 = dmat3x3;
pub type dmat4 = dmat4x4;