Allow to translate from bool to another type in validator

This commit is contained in:
Gordon-F
2021-07-23 20:12:29 +03:00
committed by Dzmitry Malyshau
parent 3000232844
commit 7bb28201dd

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)