Require that Function and Private variables be CONSTRUCTIBLE.

Change the validator to enforce WGSL's requirement that all variables
in the `function` and `private` address spaces must have constructible
types.

Mark the `RayQuery` type as `CONSTRUCTIBLE`, since it is intended to
be used for local variables.

Add a regression test.
This commit is contained in:
Jim Blandy authored and Teodor Tanasoaia committed 2023-10-09 12:27:05 +02:00
1 parent fa0fed100e
commit fe484b3a1b
4 files changed
+24 -8

No files matched your search

+2 -3
View File
@@ -541,9 +541,8 @@ impl super::Validator {
(TypeFlags::empty(), true)
}
crate::AddressSpace::Private | crate::AddressSpace::WorkGroup => {
(TypeFlags::DATA | TypeFlags::SIZED, false)
}
crate::AddressSpace::Private => (TypeFlags::CONSTRUCTIBLE, false),
crate::AddressSpace::WorkGroup => (TypeFlags::DATA | TypeFlags::SIZED, false),
crate::AddressSpace::PushConstant => {
if !self.capabilities.contains(Capabilities::PUSH_CONSTANT) {
return Err(GlobalVariableError::UnsupportedCapability(