Atomic parsing in WGSL

This commit is contained in:
Dzmitry Malyshau authored and Dzmitry Malyshau committed 2021-08-10 21:48:02 -04:00
1 parent 8cb09c24c5
commit 33db45e681
2 files changed
+5 -2

No files matched your search

+1 -2
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(())
}
}
+4
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()?;