Flutter Impeller
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)
 
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 }
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 216 of file allocator_mtl.mm.

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

◆ DebugSetSupportsUMA()

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

Definition at line 212 of file allocator_mtl.mm.

212  {
213  supports_uma_ = value;
214 }
int32_t value

References value.

Friends And Related Function 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: