More robust Display for flags types
Fixes strange behavior if a Vulkan flags constant setting multiple bits is defined prior to that which sets only one of those bits.
This commit is contained in:
parent
d99ac29747
commit
a0424596a5
2970
ash/src/vk.rs
2970
ash/src/vk.rs
File diff suppressed because it is too large
Load diff
|
@ -1515,7 +1515,7 @@ pub fn generate_const_displays<'a>(const_values: &HashMap<Ident, Vec<Ident>>) ->
|
|||
let mut first = true;
|
||||
let mut accum = value;
|
||||
for (bit, name) in known {
|
||||
if accum & bit != 0 {
|
||||
if *bit != 0 && accum & *bit == *bit {
|
||||
if !first { f.write_str(" | ")?; }
|
||||
f.write_str(name)?;
|
||||
first = false;
|
||||
|
|
Loading…
Reference in a new issue