mirror of
https://github.com/storytold/wgpu.git
synced 2026-12-01 10:34:57 +01:00
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:
1 parent
ea50486b2d
commit
f30f3a3db6
2 files changed
+50
-1
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user