Skip to content

Commit

Permalink
fixup! refactor: split handle validation into early pass in `Validato…
Browse files Browse the repository at this point in the history
…r::validate`

Resolves
<gfx-rs#2090 (comment)>.
  • Loading branch information
ErichDonGubler committed Dec 16, 2022
1 parent 62f43a6 commit e1229f1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/valid/handles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,22 @@ impl super::Validator {
.check_dep(image)?
.check_dep(sampler)?
.check_dep(coordinate)?
.check_dep_opt(array_index)?
.check_dep_opt(depth_ref)?;
.check_dep_opt(array_index)?;

match level {
crate::SampleLevel::Auto | crate::SampleLevel::Zero => (),
crate::SampleLevel::Exact(expr) => {
handle.check_dep(expr)?;
}
crate::SampleLevel::Bias(expr) => {
handle.check_dep(expr)?;
}
crate::SampleLevel::Gradient { x, y } => {
handle.check_dep(x)?.check_dep(y)?;
}
};

handle.check_dep_opt(depth_ref)?;
}
crate::Expression::ImageLoad {
image,
Expand Down

0 comments on commit e1229f1

Please sign in to comment.