Skip to content

Commit

Permalink
Memory allocator impl (vulkano-rs#2289)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vE5li authored and hakolao committed Feb 20, 2024
1 parent d6ad110 commit 564edc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions vulkano/src/command_buffer/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ unsafe impl CommandBufferAllocator for StandardCommandBufferAllocator {
}
}

unsafe impl CommandBufferAllocator for Arc<StandardCommandBufferAllocator> {
type Iter = IntoIter<[StandardCommandBufferBuilderAlloc; 1]>;
unsafe impl<T: CommandBufferAllocator> CommandBufferAllocator for Arc<T> {
type Iter = T::Iter;

type Builder = StandardCommandBufferBuilderAlloc;
type Builder = T::Builder;

type Alloc = StandardCommandBufferAlloc;
type Alloc = T::Alloc;

#[inline]
fn allocate(
Expand Down
4 changes: 2 additions & 2 deletions vulkano/src/descriptor_set/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ unsafe impl DescriptorSetAllocator for StandardDescriptorSetAllocator {
}
}

unsafe impl DescriptorSetAllocator for Arc<StandardDescriptorSetAllocator> {
type Alloc = StandardDescriptorSetAlloc;
unsafe impl<T: DescriptorSetAllocator> DescriptorSetAllocator for Arc<T> {
type Alloc = T::Alloc;

#[inline]
fn allocate(
Expand Down
2 changes: 1 addition & 1 deletion vulkano/src/memory/allocator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ unsafe impl<S: Suballocator> MemoryAllocator for GenericMemoryAllocator<S> {
}
}

unsafe impl<S: Suballocator> MemoryAllocator for Arc<GenericMemoryAllocator<S>> {
unsafe impl<T: MemoryAllocator> MemoryAllocator for Arc<T> {
fn find_memory_type_index(
&self,
memory_type_bits: u32,
Expand Down

0 comments on commit 564edc3

Please sign in to comment.