mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Add support for other matrices keywords (#121)
Add mat2x3, mat2x4, mat3x2, mat3x4, mat4x2, and mat4x3 keywords
This commit is contained in:
@@ -1046,6 +1046,33 @@ impl Parser {
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat2x3") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Bi,
|
||||
rows: crate::VectorSize::Tri,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat2x4") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Bi,
|
||||
rows: crate::VectorSize::Quad,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat3x2") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Tri,
|
||||
rows: crate::VectorSize::Bi,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat3x3") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
@@ -1055,6 +1082,33 @@ impl Parser {
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat3x4") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Tri,
|
||||
rows: crate::VectorSize::Quad,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat4x2") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Quad,
|
||||
rows: crate::VectorSize::Bi,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat4x3") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
columns: crate::VectorSize::Quad,
|
||||
rows: crate::VectorSize::Tri,
|
||||
kind,
|
||||
width,
|
||||
}
|
||||
}
|
||||
Token::Word("mat4x4") => {
|
||||
let (kind, width) = lexer.next_scalar_generic()?;
|
||||
crate::TypeInner::Matrix {
|
||||
|
||||
Reference in New Issue
Block a user