Properly type-check Expression::Select arguments. (#1442)

Require the `accept` and `reject` arguments to `select` to be scalars or
vectors, per WGSL spec.
This commit is contained in:
Jim Blandy authored and GitHub committed 2021-10-01 12:47:39 -04:00
1 parent ea50486b2d
commit f30f3a3db6
2 files changed
+50 -1

No files matched your search

+8 -1
View File
@@ -795,7 +795,14 @@ impl super::Validator {
Ti::Scalar {
kind: Sk::Bool,
width: _,
} => accept_inner.is_sized(),
} => {
// When `condition` is a single boolean, `accept` and
// `reject` can be vectors or scalars.
match *accept_inner {
Ti::Scalar { .. } | Ti::Vector { .. } => true,
_ => false,
}
}
Ti::Vector {
size,
kind: Sk::Bool,