mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-new] add vec2 and vec3
This commit is contained in:
committed by
Dzmitry Malyshau
parent
6db5b373f8
commit
f98054afdd
@@ -111,6 +111,8 @@ pub fn consume_token(mut input: &str) -> (Option<Token>, &str) {
|
||||
meta.chars.end = start + pos;
|
||||
match word {
|
||||
"void" => (Some(Token::Void(meta)), rest),
|
||||
"vec2" => (Some(Token::Vec2(meta)), rest),
|
||||
"vec3" => (Some(Token::Vec3(meta)), rest),
|
||||
"vec4" => (Some(Token::Vec4(meta)), rest),
|
||||
//TODO: remaining types
|
||||
_ => (Some(Token::Identifier((meta, String::from(word)))), rest),
|
||||
|
||||
@@ -462,6 +462,26 @@ pomelo! {
|
||||
}
|
||||
|
||||
type_specifier_nonarray ::= Void { None }
|
||||
type_specifier_nonarray ::= Vec2 {
|
||||
Some(Type {
|
||||
name: None,
|
||||
inner: TypeInner::Vector {
|
||||
size: VectorSize::Bi,
|
||||
kind: ScalarKind::Float,
|
||||
width: 4,
|
||||
}
|
||||
})
|
||||
}
|
||||
type_specifier_nonarray ::= Vec3 {
|
||||
Some(Type {
|
||||
name: None,
|
||||
inner: TypeInner::Vector {
|
||||
size: VectorSize::Tri,
|
||||
kind: ScalarKind::Float,
|
||||
width: 4,
|
||||
}
|
||||
})
|
||||
}
|
||||
type_specifier_nonarray ::= Vec4 {
|
||||
Some(Type {
|
||||
name: None,
|
||||
|
||||
Reference in New Issue
Block a user