Flutter Engine
 
Loading...
Searching...
No Matches
impeller::AllocatorMTL Class Referencefinal

#include <allocator_mtl.h>

Inheritance diagram for impeller::AllocatorMTL:
impeller::Allocator

Public Member Functions

 AllocatorMTL ()
 
 ~AllocatorMTL () override
 
Bytes DebugGetHeapUsage () const override
 
void DebugSetSupportsUMA (bool value)
 
 AllocatorMTL (id< MTLDevice > device, std::string label)
 
- Public Member Functions inherited from impeller::Allocator
virtual ~Allocator ()
 
bool IsValid () const
 
std::shared_ptr< DeviceBufferCreateBuffer (const DeviceBufferDescriptor &desc)
 
std::shared_ptr< TextureCreateTexture (const TextureDescriptor &desc, bool threadsafe=false)
 Creates a new texture.
 
std::shared_ptr< DeviceBufferCreateBufferWithCopy (const uint8_t *buffer, size_t length)
 
std::shared_ptr< DeviceBufferCreateBufferWithCopy (const fml::Mapping &mapping)
 

Friends

class ContextMTL
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::Allocator
 Allocator ()
 

Detailed Description

Definition at line 37 of file allocator_mtl.h.

Constructor & Destructor Documentation

◆ AllocatorMTL() [1/2]

impeller::AllocatorMTL::AllocatorMTL ( )

◆ ~AllocatorMTL()

impeller::AllocatorMTL::~AllocatorMTL ( )
overridedefault

◆ AllocatorMTL() [2/2]

impeller::AllocatorMTL::AllocatorMTL ( id< MTLDevice >  device,
std::string  label 
)

Definition at line 60 of file allocator_mtl.mm.

61 : device_(device), allocator_label_(std::move(label)) {
62 if (!device_) {
63 return;
64 }
65
66 supports_memoryless_targets_ = DeviceSupportsDeviceTransientTargets(device_);
67 supports_uma_ = device_.hasUnifiedMemory;
68 max_texture_supported_ = DeviceMaxTextureSizeSupported(device_);
69
70 is_valid_ = true;
71}
VkDevice device
Definition main.cc:69
ISize DeviceMaxTextureSizeSupported(id< MTLDevice > device)
static bool DeviceSupportsDeviceTransientTargets(id< MTLDevice > device)

References impeller::DeviceMaxTextureSizeSupported(), and impeller::DeviceSupportsDeviceTransientTargets().

Member Function Documentation

◆ DebugGetHeapUsage()

Bytes impeller::AllocatorMTL::DebugGetHeapUsage ( ) const
overridevirtual

Reimplemented from impeller::Allocator.

Definition at line 217 of file allocator_mtl.mm.

217 {
218#ifdef IMPELLER_DEBUG
219 return debug_allocater_->GetAllocationSize();
220#else
221 return {};
222#endif // IMPELLER_DEBUG
223}

◆ DebugSetSupportsUMA()

void impeller::AllocatorMTL::DebugSetSupportsUMA ( bool  value)

Definition at line 213 of file allocator_mtl.mm.

213 {
214 supports_uma_ = value;
215}
int32_t value

References value.

Friends And Related Symbol Documentation

◆ ContextMTL

friend class ContextMTL
friend

Definition at line 53 of file allocator_mtl.h.


The documentation for this class was generated from the following files: