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... | |
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 22 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(), and impeller::scene::Geometry::MakeFromFlatbuffer().
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::DeviceBuffer::AsTexture(), impeller::EntityPassTarget::Flip(), impeller::scene::Skin::GetJointsTexture(), impeller::RenderTarget::SetupDepthStencilAttachments(), impeller::scene::UnpackTextureFromFlatbuffer(), and impeller::WrapTextureWithRenderTarget().
|
inlinevirtual |
Write debug memory usage information to the dart timeline in debug and profile modes.
This is only supported on the Vulkan backend.
Definition at line 51 of file allocator.h.
|
pure virtual |
Implemented in impeller::testing::TestAllocator.
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.
Referenced by CreateBuffer().
|
protectedpure virtual |
Implemented in impeller::testing::TestAllocator.
Referenced by CreateTexture().