Implement hash for core types

This commit is contained in:
hodasemi 2023-11-30 15:40:01 +01:00
parent 42900dab46
commit 54ab11e461
2 changed files with 32 additions and 32 deletions

View file

@ -1,124 +1,124 @@
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkBuffer(u64); pub struct VkBuffer(u64);
SetupU64Conv!(VkBuffer); SetupU64Conv!(VkBuffer);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkBufferView(u64); pub struct VkBufferView(u64);
SetupU64Conv!(VkBufferView); SetupU64Conv!(VkBufferView);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkCommandBuffer(usize); pub struct VkCommandBuffer(usize);
SetupUSizeConv!(VkCommandBuffer); SetupUSizeConv!(VkCommandBuffer);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkCommandPool(u64); pub struct VkCommandPool(u64);
SetupU64Conv!(VkCommandPool); SetupU64Conv!(VkCommandPool);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDescriptorPool(u64); pub struct VkDescriptorPool(u64);
SetupU64Conv!(VkDescriptorPool); SetupU64Conv!(VkDescriptorPool);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDescriptorSet(u64); pub struct VkDescriptorSet(u64);
SetupU64Conv!(VkDescriptorSet); SetupU64Conv!(VkDescriptorSet);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDescriptorSetLayout(u64); pub struct VkDescriptorSetLayout(u64);
SetupU64Conv!(VkDescriptorSetLayout); SetupU64Conv!(VkDescriptorSetLayout);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDevice(usize); pub struct VkDevice(usize);
SetupUSizeConv!(VkDevice); SetupUSizeConv!(VkDevice);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDeviceMemory(u64); pub struct VkDeviceMemory(u64);
SetupU64Conv!(VkDeviceMemory); SetupU64Conv!(VkDeviceMemory);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkEvent(u64); pub struct VkEvent(u64);
SetupU64Conv!(VkEvent); SetupU64Conv!(VkEvent);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkFence(u64); pub struct VkFence(u64);
SetupU64Conv!(VkFence); SetupU64Conv!(VkFence);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkFramebuffer(u64); pub struct VkFramebuffer(u64);
SetupU64Conv!(VkFramebuffer); SetupU64Conv!(VkFramebuffer);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkImage(u64); pub struct VkImage(u64);
SetupU64Conv!(VkImage); SetupU64Conv!(VkImage);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkImageView(u64); pub struct VkImageView(u64);
SetupU64Conv!(VkImageView); SetupU64Conv!(VkImageView);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkInstance(usize); pub struct VkInstance(usize);
SetupUSizeConv!(VkInstance); SetupUSizeConv!(VkInstance);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkPhysicalDevice(usize); pub struct VkPhysicalDevice(usize);
SetupUSizeConv!(VkPhysicalDevice); SetupUSizeConv!(VkPhysicalDevice);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkPipeline(u64); pub struct VkPipeline(u64);
SetupU64Conv!(VkPipeline); SetupU64Conv!(VkPipeline);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkPipelineCache(u64); pub struct VkPipelineCache(u64);
SetupU64Conv!(VkPipelineCache); SetupU64Conv!(VkPipelineCache);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkPipelineLayout(u64); pub struct VkPipelineLayout(u64);
SetupU64Conv!(VkPipelineLayout); SetupU64Conv!(VkPipelineLayout);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkQueryPool(u64); pub struct VkQueryPool(u64);
SetupU64Conv!(VkQueryPool); SetupU64Conv!(VkQueryPool);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkQueue(usize); pub struct VkQueue(usize);
SetupUSizeConv!(VkQueue); SetupUSizeConv!(VkQueue);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkRenderPass(u64); pub struct VkRenderPass(u64);
SetupU64Conv!(VkRenderPass); SetupU64Conv!(VkRenderPass);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkSampler(u64); pub struct VkSampler(u64);
SetupU64Conv!(VkSampler); SetupU64Conv!(VkSampler);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkSemaphore(u64); pub struct VkSemaphore(u64);
SetupU64Conv!(VkSemaphore); SetupU64Conv!(VkSemaphore);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkShaderModule(u64); pub struct VkShaderModule(u64);
SetupU64Conv!(VkShaderModule); SetupU64Conv!(VkShaderModule);

View file

@ -1,34 +1,34 @@
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDescriptorUpdateTemplateKHR(u64); pub struct VkDescriptorUpdateTemplateKHR(u64);
SetupU64Conv!(VkDescriptorUpdateTemplateKHR); SetupU64Conv!(VkDescriptorUpdateTemplateKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDisplayKHR(u64); pub struct VkDisplayKHR(u64);
SetupU64Conv!(VkDisplayKHR); SetupU64Conv!(VkDisplayKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDisplayModeKHR(u64); pub struct VkDisplayModeKHR(u64);
SetupU64Conv!(VkDisplayModeKHR); SetupU64Conv!(VkDisplayModeKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkSurfaceKHR(u64); pub struct VkSurfaceKHR(u64);
SetupU64Conv!(VkSurfaceKHR); SetupU64Conv!(VkSurfaceKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkSwapchainKHR(u64); pub struct VkSwapchainKHR(u64);
SetupU64Conv!(VkSwapchainKHR); SetupU64Conv!(VkSwapchainKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkAccelerationStructureKHR(u64); pub struct VkAccelerationStructureKHR(u64);
SetupU64Conv!(VkAccelerationStructureKHR); SetupU64Conv!(VkAccelerationStructureKHR);
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VkDeferredOperationKHR(u64); pub struct VkDeferredOperationKHR(u64);
SetupU64Conv!(VkDeferredOperationKHR); SetupU64Conv!(VkDeferredOperationKHR);