An object that allocates device memory. More...
#include <allocator.h>
Public Member Functions | |
virtual | ~Allocator () |
bool | IsValid () const |
std::shared_ptr< DeviceBuffer > | CreateBuffer (const DeviceBufferDescriptor &desc) |
std::shared_ptr< Texture > | CreateTexture (const TextureDescriptor &desc) |
virtual uint16_t | MinimumBytesPerRow (PixelFormat format) const |
Minimum value for row_bytes on a Texture. The row bytes parameter of that method must be aligned to this value. More... | |
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (const uint8_t *buffer, size_t length) |
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (const fml::Mapping &mapping) |
virtual ISize | GetMaxTextureSizeSupported () const =0 |
virtual void | DebugTraceMemoryStatistics () const |
Write debug memory usage information to the dart timeline in debug and profile modes. More... | |
virtual Bytes | DebugGetHeapUsage () const |
Protected Member Functions | |
Allocator () | |
virtual std::shared_ptr< DeviceBuffer > | OnCreateBuffer (const DeviceBufferDescriptor &desc)=0 |
virtual std::shared_ptr< Texture > | OnCreateTexture (const TextureDescriptor &desc)=0 |
An object that allocates device memory.
Definition at line 24 of file allocator.h.
|
virtualdefault |
|
protecteddefault |
std::shared_ptr< DeviceBuffer > impeller::Allocator::CreateBuffer | ( | const DeviceBufferDescriptor & | desc | ) |
Definition at line 44 of file allocator.cc.
References OnCreateBuffer().
Referenced by CreateBufferWithCopy().
std::shared_ptr< DeviceBuffer > impeller::Allocator::CreateBufferWithCopy | ( | const fml::Mapping & | mapping | ) |
Definition at line 39 of file allocator.cc.
References CreateBufferWithCopy().
std::shared_ptr< DeviceBuffer > impeller::Allocator::CreateBufferWithCopy | ( | const uint8_t * | buffer, |
size_t | length | ||
) |
Definition at line 18 of file allocator.cc.
References CreateBuffer(), impeller::kHostVisible, impeller::DeviceBufferDescriptor::size, and impeller::DeviceBufferDescriptor::storage_mode.
Referenced by CreateBufferWithCopy().
std::shared_ptr< Texture > impeller::Allocator::CreateTexture | ( | const TextureDescriptor & | desc | ) |
Definition at line 49 of file allocator.cc.
References GetMaxTextureSizeSupported(), impeller::TSize< T >::height, impeller::TextureDescriptor::mip_count, impeller::TSize< T >::MipCount(), OnCreateTexture(), impeller::TextureDescriptor::size, VALIDATION_LOG, and impeller::TSize< T >::width.
Referenced by impeller::RenderTarget::SetupDepthStencilAttachments().
|
inlinevirtual |
Reimplemented in impeller::AllocatorVK, and impeller::AllocatorMTL.
Definition at line 56 of file allocator.h.
|
inlinevirtual |
Write debug memory usage information to the dart timeline in debug and profile modes.
This is supported on both the Metal and Vulkan backends.
Definition at line 53 of file allocator.h.
|
pure virtual |
Implemented in impeller::testing::TestAllocator, impeller::testing::FlushTestAllocator, and impeller::testing::FailingAllocator.
Referenced by CreateTexture().
bool impeller::Allocator::IsValid | ( | ) | const |
|
virtual |
Minimum value for row_bytes
on a Texture. The row bytes parameter of that method must be aligned to this value.
Definition at line 69 of file allocator.cc.
References impeller::BytesPerPixelForPixelFormat().
|
protectedpure virtual |
Implemented in impeller::testing::TestAllocator, impeller::testing::FlushTestAllocator, and impeller::testing::FailingAllocator.
Referenced by CreateBuffer().
|
protectedpure virtual |
Implemented in impeller::testing::TestAllocator, impeller::testing::FlushTestAllocator, and impeller::testing::FailingAllocator.
Referenced by CreateTexture().