mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
validate: check global var type to be in range
This commit is contained in:
@@ -332,7 +332,10 @@ impl super::Validator {
|
||||
use super::TypeFlags;
|
||||
|
||||
log::debug!("var {:?}", var);
|
||||
let type_info = &self.types[var.ty.index()];
|
||||
let type_info = self
|
||||
.types
|
||||
.get(var.ty.index())
|
||||
.ok_or(GlobalVariableError::InvalidType)?;
|
||||
|
||||
let (required_type_flags, is_resource) = match var.class {
|
||||
crate::StorageClass::Function => return Err(GlobalVariableError::InvalidUsage),
|
||||
|
||||
Reference in New Issue
Block a user