mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 08:51:05 +01:00
Require dynamically sized arrays to appear in 'storage' memory.
WGSL requires that runtime-sized arrays appear only as the last member of a structure in in the `storage` storage class. It seems to me that Naga should enforce this restriction on its own IR as well.
This commit is contained in:
1 parent
813da7a87e
commit
99fbb34bd6
2 files changed
+12
-6
No files matched your search
@@ -346,9 +346,11 @@ impl super::Validator {
|
||||
};
|
||||
(access, TypeFlags::empty(), true)
|
||||
}
|
||||
crate::StorageClass::Private | crate::StorageClass::WorkGroup => {
|
||||
(crate::StorageAccess::empty(), TypeFlags::DATA, false)
|
||||
}
|
||||
crate::StorageClass::Private | crate::StorageClass::WorkGroup => (
|
||||
crate::StorageAccess::empty(),
|
||||
TypeFlags::DATA | TypeFlags::SIZED,
|
||||
false,
|
||||
),
|
||||
crate::StorageClass::PushConstant => {
|
||||
if !self.capabilities.contains(Capabilities::PUSH_CONSTANT) {
|
||||
return Err(GlobalVariableError::UnsupportedCapability(
|
||||
@@ -357,7 +359,7 @@ impl super::Validator {
|
||||
}
|
||||
(
|
||||
crate::StorageAccess::LOAD,
|
||||
TypeFlags::DATA | TypeFlags::HOST_SHARED,
|
||||
TypeFlags::DATA | TypeFlags::HOST_SHARED | TypeFlags::SIZED,
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user