pub fn build_standard_allocator(
    ash_instance: ash::Instance,
    logical_device: ash::Device,
    physical_device: ash::vk::PhysicalDevice,
) -> Box<impl DeviceAllocator> {
    let device_allocator = SharedRefAllocator::new(MetricsAllocator::new(
        "Device Allocator",
        ConsoleMarkdownReport::new(ash_instance.clone(), physical_device),
        PassthroughAllocator::create(logical_device),
    ));

    let typed_allocator = PageAllocator::new(
        TypeIndexAllocator::new(
            &ash_instance,
            physical_device,
            |_memory_type_index, _memory_type| {
                SizeSelector::new(
                    // For allocations below 512KiB
                    PoolAllocator::new(
                        device_allocator.clone(),
                        MemUnit::MiB(1),
                    ),
                    MemUnit::KiB(512),
                    // for allocations above 512KiB
                    SizeSelector::new(
                        // for allocations below 256MiB
                        PoolAllocator::new(
                            device_allocator.clone(),
                            MemUnit::MiB(512),
                        ),
                        MemUnit::MiB(256),
                        // for allocations above 256MiB
                        device_allocator.clone(),
                    ),
                )
            },
        ),
        MemUnit::KiB(1),
    );

    Box::new(typed_allocator)
}
/// Build the standard allocator implementation.
///
/// The return is a boxed impl so that consumers are not dependent on the
/// specific implementation (often the full type is unwieldy because it is a
/// composition of DeviceAllocator implementations).
///
/// The caller is responsible for keeping the ash instance, logical device, and
/// physical device alive for at least as long as the allocator exists.
Build the standard allocator implementation.
The return is a boxed impl so that consumers are not dependent on the
specific implementation (often the full type is unwieldy because it is a
composition of DeviceAllocator implementations).

The caller is responsible for keeping the ash instance, logical device, and
physical device alive for at least as long as the allocator exists.
Build the standard allocator implementation . The return is a boxed impl so that consumers are not dependent on the specific implementation ( often the full type is unwieldy because it is a composition of DeviceAllocator implementations ) . The caller is responsible for keeping the ash instance logical device and physical device alive for at least as long as the allocator exists .
pub fn build_standard_allocator(
    ash_instance: ash::Instance,
    logical_device: ash::Device,
    physical_device: ash::vk::PhysicalDevice,
) -> Box<impl DeviceAllocator> {
    let device_allocator = SharedRefAllocator::new(MetricsAllocator::new(
        "Device Allocator",
        ConsoleMarkdownReport::new(ash_instance.clone(), physical_device),
        PassthroughAllocator::create(logical_device),
    ));
    let typed_allocator = PageAllocator::new(
        TypeIndexAllocator::new(
            &ash_instance,
            physical_device,
            |_memory_type_index, _memory_type| {
                SizeSelector::new(
                    // For allocations below 512KiB
                    PoolAllocator::new(
                        device_allocator.clone(),
                        MemUnit::MiB(1),
                    ),
                    MemUnit::KiB(512),
                    // for allocations above 512KiB
                    SizeSelector::new(
                        // for allocations below 256MiB
                        PoolAllocator::new(
                            device_allocator.clone(),
                            MemUnit::MiB(512),
                        ),
                        MemUnit::MiB(256),
                        // for allocations above 256MiB
                        device_allocator.clone(),
                    ),
                )
            },
        ),
        MemUnit::KiB(1),
    );
    Box::new(typed_allocator)
}
pub fn build_standard_allocator ( ash_instance : ash :: Instance , logical_device : ash :: Device , physical_device : ash :: vk :: PhysicalDevice , ) -> Box < impl DeviceAllocator > { let device_allocator = SharedRefAllocator :: new ( MetricsAllocator :: new ( " " , ConsoleMarkdownReport :: new ( ash_instance . clone ( ) , physical_device ) , PassthroughAllocator :: create ( logical_device ) , ) ) ; let typed_allocator = PageAllocator :: new ( TypeIndexAllocator :: new ( & ash_instance , physical_device , | _memory_type_index , _memory_type | { SizeSelector :: new ( // For allocations below 512KiB PoolAllocator :: new ( device_allocator . clone ( ) , MemUnit :: MiB ( 1 ) , ) , MemUnit :: KiB ( 512 ) , // for allocations above 512KiB SizeSelector :: new ( // for allocations below 256MiB PoolAllocator :: new ( device_allocator . clone ( ) , MemUnit :: MiB ( 512 ) , ) , MemUnit :: MiB ( 256 ) , // for allocations above 256MiB device_allocator . clone ( ) , ) , ) } , ) , MemUnit :: KiB ( 1 ) , ) ; Box :: new ( typed_allocator ) }
Build the standard allocator implementation.
Build the standard allocator implementation .
ash_instance
ash::Instance
logical_device
ash::Device
physical_device
ash::vk::PhysicalDevice