Atomic parsing in WGSL

This commit is contained in:
Dzmitry Malyshau
2021-06-02 14:57:05 -04:00
committed by Dzmitry Malyshau
parent 8cb09c24c5
commit 33db45e681
2 changed files with 5 additions and 2 deletions

View File

@@ -65,6 +65,7 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
pub(super) fn parse_function(&mut self, module: &mut crate::Module) -> Result<(), Error> {
self.lookup_expression.clear();
self.lookup_load_override.clear();
self.lookup_sampled_image.clear();
let result_type_id = self.next()?;
let fun_id = self.next()?;
@@ -391,8 +392,6 @@ impl<I: Iterator<Item = u32>> super::Parser<I> {
module.apply_common_default_interpolation();
self.lookup_expression.clear();
self.lookup_sampled_image.clear();
Ok(())
}
}

View File

@@ -2245,6 +2245,10 @@ impl Parser {
width,
}
}
"atomic" => {
let (kind, width) = lexer.next_scalar_generic()?;
crate::TypeInner::Atomic { kind, width }
}
"ptr" => {
lexer.expect_generic_paren('<')?;
let (ident, span) = lexer.next_ident_with_span()?;