From 33a0eee190d36498b614add321a3f88e1c97baf7 Mon Sep 17 00:00:00 2001 From: Maik Klein Date: Wed, 1 Aug 2018 09:12:39 +0200 Subject: [PATCH] Remove "VK" from constants --- ash/src/vk.rs | 38 +++++++++++++++++++------------------- generator/src/lib.rs | 3 ++- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ash/src/vk.rs b/ash/src/vk.rs index 1f694e3..e76cf87 100644 --- a/ash/src/vk.rs +++ b/ash/src/vk.rs @@ -13506,25 +13506,25 @@ pub mod bitflags { pub const VARIABLE_DESCRIPTOR_COUNT: Self = DescriptorBindingFlagsEXT(0b1000); } } -pub const VK_MAX_PHYSICAL_DEVICE_NAME_SIZE: usize = 256; -pub const VK_UUID_SIZE: usize = 16; -pub const VK_LUID_SIZE: usize = 8; -pub const VK_MAX_EXTENSION_NAME_SIZE: usize = 256; -pub const VK_MAX_DESCRIPTION_SIZE: usize = 256; -pub const VK_MAX_MEMORY_TYPES: usize = 32; -pub const VK_MAX_MEMORY_HEAPS: usize = 16; -pub const VK_LOD_CLAMP_NONE: f32 = 1000.00; -pub const VK_REMAINING_MIP_LEVELS: u32 = !0; -pub const VK_REMAINING_ARRAY_LAYERS: u32 = !0; -pub const VK_WHOLE_SIZE: u64 = !0; -pub const VK_ATTACHMENT_UNUSED: u32 = !0; -pub const VK_TRUE: usize = 1; -pub const VK_FALSE: usize = 0; -pub const VK_QUEUE_FAMILY_IGNORED: u32 = !0; -pub const VK_QUEUE_FAMILY_EXTERNAL: u32 = !0 - 1; -pub const VK_QUEUE_FAMILY_FOREIGN_EXT: u32 = !0 - 2; -pub const VK_SUBPASS_EXTERNAL: u32 = !0; -pub const VK_MAX_DEVICE_GROUP_SIZE: usize = 32; +pub const MAX_PHYSICAL_DEVICE_NAME_SIZE: usize = 256; +pub const UUID_SIZE: usize = 16; +pub const LUID_SIZE: usize = 8; +pub const MAX_EXTENSION_NAME_SIZE: usize = 256; +pub const MAX_DESCRIPTION_SIZE: usize = 256; +pub const MAX_MEMORY_TYPES: usize = 32; +pub const MAX_MEMORY_HEAPS: usize = 16; +pub const LOD_CLAMP_NONE: f32 = 1000.00; +pub const REMAINING_MIP_LEVELS: u32 = !0; +pub const REMAINING_ARRAY_LAYERS: u32 = !0; +pub const WHOLE_SIZE: u64 = !0; +pub const ATTACHMENT_UNUSED: u32 = !0; +pub const TRUE: usize = 1; +pub const FALSE: usize = 0; +pub const QUEUE_FAMILY_IGNORED: u32 = !0; +pub const QUEUE_FAMILY_EXTERNAL: u32 = !0 - 1; +pub const QUEUE_FAMILY_FOREIGN_EXT: u32 = !0 - 2; +pub const SUBPASS_EXTERNAL: u32 = !0; +pub const MAX_DEVICE_GROUP_SIZE: usize = 32; pub mod extensions { use super::*; pub struct KhrSurfaceFn { diff --git a/generator/src/lib.rs b/generator/src/lib.rs index b3005f8..40996d9 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1399,7 +1399,8 @@ pub fn generate_constant<'a>( ) -> Tokens { cache.insert(constant.name.as_str()); let c = Constant::from_constant(constant); - let ident = Ident::from(constant.name.as_str()); + let name =constant.name.replace("VK_", ""); + let ident = Ident::from(name.as_str()); let value = c.to_tokens(); let ty = c.ty().to_tokens(); quote!{