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

+1 -4
View File
@@ -948,10 +948,7 @@ impl super::Validator {
.types
.get(var.ty.index())
.ok_or(LocalVariableError::InvalidType(var.ty))?;
if !type_info
.flags
.contains(super::TypeFlags::DATA | super::TypeFlags::SIZED)
{
if !type_info.flags.contains(super::TypeFlags::CONSTRUCTIBLE) {
return Err(LocalVariableError::InvalidType(var.ty));
}