mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Validate image queries and valid shader stages for derivatives
This commit is contained in:
committed by
Dzmitry Malyshau
parent
ee43776c08
commit
7a246f6a14
@@ -453,7 +453,7 @@ impl super::Validator {
|
||||
module: &crate::Module,
|
||||
mod_info: &ModuleInfo,
|
||||
) -> Result<FunctionInfo, FunctionError> {
|
||||
let info = mod_info.process_function(fun, module, self.flags)?;
|
||||
let mut info = mod_info.process_function(fun, module, self.flags)?;
|
||||
|
||||
for (var_handle, var) in fun.local_variables.iter() {
|
||||
self.validate_local_var(var, &module.types, &module.constants)
|
||||
@@ -482,8 +482,16 @@ impl super::Validator {
|
||||
self.valid_expression_set.insert(handle.index());
|
||||
}
|
||||
if !self.flags.contains(ValidationFlags::EXPRESSIONS) {
|
||||
if let Err(error) = self.validate_expression(handle, expr, fun, module, &info) {
|
||||
return Err(FunctionError::Expression { handle, error });
|
||||
match self.validate_expression(
|
||||
handle,
|
||||
expr,
|
||||
fun,
|
||||
module,
|
||||
&info,
|
||||
&mod_info.functions,
|
||||
) {
|
||||
Ok(stages) => info.available_stages &= stages,
|
||||
Err(error) => return Err(FunctionError::Expression { handle, error }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user