Allow to translate from bool to another type in validator

This commit is contained in:
Gordon-F authored and Dzmitry Malyshau committed 2021-07-24 17:53:24 -04:00
1 parent 3000232844
commit 7bb28201dd
1 file changed
+1 -14
+1 -14
View File
@@ -1142,20 +1142,7 @@ impl super::Validator {
}
ShaderStages::all()
}
E::As {
expr,
kind,
convert,
} => {
let prev_kind = resolver
.resolve(expr)?
.scalar_kind()
.ok_or(ExpressionError::InvalidCastArgument)?;
if prev_kind == Sk::Bool || kind == Sk::Bool {
return Err(ExpressionError::InvalidCastArgument);
}
E::As { kind, convert, .. } => {
match convert {
Some(width) if !self.check_width(kind, width) => {
return Err(ExpressionError::InvalidCastArgument)