Skip to content

Commit

Permalink
Fix off-by-one error in SubpassDescription::validate (#2556)
Browse files Browse the repository at this point in the history
* fix: off-by-one error in `SubpassDescription::validate`

* use `view_count` instead of `highest_view_index`
  • Loading branch information
interacsion authored Aug 14, 2024
1 parent d02165a commit 817b52c
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 view_count = u32::BITS - view_mask.leading_zeros();

if highest_view_index >= properties.max_multiview_view_count.unwrap_or(0) {
if view_count > properties.max_multiview_view_count.unwrap_or(0) {
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 817b52c

Please sign in to comment.