Fix off-by-one error in SubpassDescription::validate (#2556)

* fix: off-by-one error in `SubpassDescription::validate`

* use `view_count` instead of `highest_view_index`
This commit is contained in:
Mai 2024-08-14 08:16:10 +03:00 committed by GitHub
parent d02165a28c
commit 817b52cee5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 \