Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/compiler/translator/ir/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// look up and checking that !is_dead_code_eliminated
// - If there's a cached "has side effect", that it's correct.
// - No operations should have entirely constant arguments, that should be folded (and
// transformations shouldn't retintroduce it)
// transformations shouldn't reintroduce it)
// - Catch misuse of built-in names.
// - Precision is not applied to types that don't are not applicable. It _is_ applied to types
// that are applicable (including uniforms and samplers for example). Needs to work to make
Expand Down Expand Up @@ -408,7 +408,7 @@ impl<'a> Validator<'a> {
for variable in &block.variables {
if variable.id >= self.max_variable_count {
self.on_error(format_args!(
"invalid variable id {} found in block variabls",
"invalid variable id {} found in block variables",
variable.id
));
}
Expand Down Expand Up @@ -1557,6 +1557,13 @@ impl<'a> Validator<'a> {
that is out of bounds",
struct_type, field_index
));
} else if let Some(non_struct_type) = struct_type
&& !matches!(non_struct_type, Type::Struct(_, _, _))
{
self.on_error(format_args!(
"OpCode::Access/ExtractStructField expects a struct type, got {:?}",
non_struct_type
));
}
}

Expand Down