Skip to content

Commit

Permalink
fix: off-by-one error in SubpassDescription::validate
Browse files Browse the repository at this point in the history
  • Loading branch information
interacsion committed Aug 13, 2024
1 parent 2aafcf9 commit 3580a0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vulkano/src/render_pass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2946,9 +2946,9 @@ impl SubpassDescription {
}));
}

let highest_view_index = u32::BITS - view_mask.leading_zeros();
let highest_view_index = 31 - view_mask.leading_zeros() as i32;

if highest_view_index >= properties.max_multiview_view_count.unwrap_or(0) {
if highest_view_index >= properties.max_multiview_view_count.unwrap_or(0) as i32 {
return Err(Box::new(ValidationError {
context: "view_mask".into(),
problem: "the highest enabled view index is not less than the \
Expand Down

0 comments on commit 3580a0c

Please sign in to comment.