mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 16:31:11 +01:00
Add support for other matrices keywords (#121)
Add mat2x3, mat2x4, mat3x2, mat3x4, mat4x2, and mat4x3 keywords
This commit is contained in:
1 parent
745ef6a6d6
commit
6db5b373f8
1 file changed
+54
@@ -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