mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 23:11:01 +01:00
Allow indexing value pointers (#758)
This commit is contained in:
1 parent
0917e3740b
commit
0725417193
1 file changed
+6
-2
@@ -146,7 +146,8 @@ impl super::Validator {
|
||||
Ti::Vector { .. }
|
||||
| Ti::Matrix { .. }
|
||||
| Ti::Array { .. }
|
||||
| Ti::Pointer { .. } => {}
|
||||
| Ti::Pointer { .. }
|
||||
| Ti::ValuePointer { size: Some(_), .. } => {}
|
||||
ref other => {
|
||||
log::error!("Indexing of {:?}", other);
|
||||
return Err(ExpressionError::InvalidBaseType(base));
|
||||
@@ -171,7 +172,10 @@ impl super::Validator {
|
||||
}
|
||||
E::AccessIndex { base, index } => {
|
||||
let limit = match *resolver.resolve(base)? {
|
||||
Ti::Vector { size, .. } => size as u32,
|
||||
Ti::Vector { size, .. }
|
||||
| Ti::ValuePointer {
|
||||
size: Some(size), ..
|
||||
} => size as u32,
|
||||
Ti::Matrix { columns, .. } => columns as u32,
|
||||
Ti::Array {
|
||||
size: crate::ArraySize::Constant(handle),
|
||||
|
||||
Reference in new issue
Block a user