From 54d20c0378ef2e996cbd9cd5b997dd7e0d6f2863 Mon Sep 17 00:00:00 2001 From: vE5li Date: Wed, 16 Aug 2023 11:52:59 +0200 Subject: [PATCH] Memory allocator impl (#2289) * Make the impl of Arc for MemoryAllocator more generic * Make the impl of Arc for CommandBufferAllocator more generic * Make the impl of Arc for DescriptorSetAllocator more generic --- vulkano/src/command_buffer/allocator.rs | 8 ++++---- vulkano/src/descriptor_set/allocator.rs | 4 ++-- vulkano/src/memory/allocator/mod.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vulkano/src/command_buffer/allocator.rs b/vulkano/src/command_buffer/allocator.rs index f8f86111..d741fe8f 100644 --- a/vulkano/src/command_buffer/allocator.rs +++ b/vulkano/src/command_buffer/allocator.rs @@ -276,12 +276,12 @@ unsafe impl CommandBufferAllocator for StandardCommandBufferAllocator { } } -unsafe impl CommandBufferAllocator for Arc { - type Iter = IntoIter<[StandardCommandBufferBuilderAlloc; 1]>; +unsafe impl CommandBufferAllocator for Arc { + type Iter = T::Iter; - type Builder = StandardCommandBufferBuilderAlloc; + type Builder = T::Builder; - type Alloc = StandardCommandBufferAlloc; + type Alloc = T::Alloc; #[inline] fn allocate( diff --git a/vulkano/src/descriptor_set/allocator.rs b/vulkano/src/descriptor_set/allocator.rs index 719f7a8a..108c8065 100644 --- a/vulkano/src/descriptor_set/allocator.rs +++ b/vulkano/src/descriptor_set/allocator.rs @@ -189,8 +189,8 @@ unsafe impl DescriptorSetAllocator for StandardDescriptorSetAllocator { } } -unsafe impl DescriptorSetAllocator for Arc { - type Alloc = StandardDescriptorSetAlloc; +unsafe impl DescriptorSetAllocator for Arc { + type Alloc = T::Alloc; #[inline] fn allocate( diff --git a/vulkano/src/memory/allocator/mod.rs b/vulkano/src/memory/allocator/mod.rs index d28792b1..3e071915 100644 --- a/vulkano/src/memory/allocator/mod.rs +++ b/vulkano/src/memory/allocator/mod.rs @@ -1566,7 +1566,7 @@ unsafe impl MemoryAllocator for GenericMemoryAllocator { } } -unsafe impl MemoryAllocator for Arc> { +unsafe impl MemoryAllocator for Arc { fn find_memory_type_index( &self, memory_type_bits: u32,