diff --git a/ash/src/vk/extensions.rs b/ash/src/vk/extensions.rs index bee1c89..2b130f1 100644 --- a/ash/src/vk/extensions.rs +++ b/ash/src/vk/extensions.rs @@ -1538,6 +1538,8 @@ impl KhrSamplerMirrorClampToEdgeFn { impl SamplerAddressMode { #[doc = "Note that this defines what was previously a core enum, and so uses the 'value' attribute rather than 'offset', and does not have a suffix. This is a special case, and should not be repeated"] pub const MIRROR_CLAMP_TO_EDGE: Self = Self(4); + #[deprecated = "Introduced for consistency with extension suffixing rules"] + pub const MIRROR_CLAMP_TO_EDGE_KHR: Self = Self::MIRROR_CLAMP_TO_EDGE; } impl ImgFilterCubicFn { #[inline] diff --git a/generator/src/lib.rs b/generator/src/lib.rs index b1b8ca0..ab9788e 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1112,7 +1112,10 @@ pub fn generate_extension_constants<'a>( continue; } - if enum_.deprecated.is_some() { + if enum_.deprecated.is_some() + // TODO: Remove deprecated alias on next breaking release + && enum_.name != "VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR" + { continue; } @@ -1460,10 +1463,19 @@ pub fn bitflags_impl_block( ) -> TokenStream { let variants = constants .iter() - .filter(|constant| !constant.is_deprecated()) + .filter(|constant| { + !constant.is_deprecated() + // TODO: Remove deprecated alias on next breaking release + || constant.variant_ident(enum_name) == "MIRROR_CLAMP_TO_EDGE_KHR" + }) .map(|constant| { let variant_ident = constant.variant_ident(enum_name); - let notation = constant.doc_attribute(); + let notation = if variant_ident == "MIRROR_CLAMP_TO_EDGE_KHR" { + let comment = constant.formatted_notation(); + Some(quote!(#[deprecated = #comment])) + } else { + constant.doc_attribute() + }; let constant = constant.constant(enum_name); let value = if let Constant::Alias(_) = &constant { quote!(#constant)