From 54ab11e461283b29afa576f8e800d96ad052d2c2 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 30 Nov 2023 15:40:01 +0100 Subject: [PATCH] Implement hash for core types --- vulkan-sys/src/types/core.rs | 50 ++++++++++++++++++------------------ vulkan-sys/src/types/khr.rs | 14 +++++----- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/vulkan-sys/src/types/core.rs b/vulkan-sys/src/types/core.rs index 575f4cb..4273984 100644 --- a/vulkan-sys/src/types/core.rs +++ b/vulkan-sys/src/types/core.rs @@ -1,124 +1,124 @@ #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkBuffer(u64); SetupU64Conv!(VkBuffer); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkBufferView(u64); SetupU64Conv!(VkBufferView); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkCommandBuffer(usize); SetupUSizeConv!(VkCommandBuffer); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkCommandPool(u64); SetupU64Conv!(VkCommandPool); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDescriptorPool(u64); SetupU64Conv!(VkDescriptorPool); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDescriptorSet(u64); SetupU64Conv!(VkDescriptorSet); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDescriptorSetLayout(u64); SetupU64Conv!(VkDescriptorSetLayout); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDevice(usize); SetupUSizeConv!(VkDevice); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDeviceMemory(u64); SetupU64Conv!(VkDeviceMemory); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkEvent(u64); SetupU64Conv!(VkEvent); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkFence(u64); SetupU64Conv!(VkFence); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkFramebuffer(u64); SetupU64Conv!(VkFramebuffer); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkImage(u64); SetupU64Conv!(VkImage); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkImageView(u64); SetupU64Conv!(VkImageView); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkInstance(usize); SetupUSizeConv!(VkInstance); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkPhysicalDevice(usize); SetupUSizeConv!(VkPhysicalDevice); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkPipeline(u64); SetupU64Conv!(VkPipeline); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkPipelineCache(u64); SetupU64Conv!(VkPipelineCache); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkPipelineLayout(u64); SetupU64Conv!(VkPipelineLayout); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkQueryPool(u64); SetupU64Conv!(VkQueryPool); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkQueue(usize); SetupUSizeConv!(VkQueue); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkRenderPass(u64); SetupU64Conv!(VkRenderPass); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkSampler(u64); SetupU64Conv!(VkSampler); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkSemaphore(u64); SetupU64Conv!(VkSemaphore); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkShaderModule(u64); SetupU64Conv!(VkShaderModule); diff --git a/vulkan-sys/src/types/khr.rs b/vulkan-sys/src/types/khr.rs index 3ffc1cb..d4793db 100644 --- a/vulkan-sys/src/types/khr.rs +++ b/vulkan-sys/src/types/khr.rs @@ -1,34 +1,34 @@ #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDescriptorUpdateTemplateKHR(u64); SetupU64Conv!(VkDescriptorUpdateTemplateKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDisplayKHR(u64); SetupU64Conv!(VkDisplayKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDisplayModeKHR(u64); SetupU64Conv!(VkDisplayModeKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkSurfaceKHR(u64); SetupU64Conv!(VkSurfaceKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkSwapchainKHR(u64); SetupU64Conv!(VkSwapchainKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkAccelerationStructureKHR(u64); SetupU64Conv!(VkAccelerationStructureKHR); #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct VkDeferredOperationKHR(u64); SetupU64Conv!(VkDeferredOperationKHR);