| Flutter Impeller |

Public Member Functions | Friends | List of all members
impeller::AllocatorMTL Class Referencefinal

`#include <allocator_mtl.h>`

Inheritance diagram for impeller::AllocatorMTL:

## 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< DeviceBuffer > | CreateBuffer (const DeviceBufferDescriptor &desc)
std::shared_ptr< Texture > | CreateTexture (const TextureDescriptor &desc, bool threadsafe=false)
| Creates a new texture. More...
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (const uint8_t *buffer, size_t length)
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (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 }
impeller::DeviceMaxTextureSizeSupported
ISize DeviceMaxTextureSizeSupported(id< MTLDevice > device)
Definition: allocator_mtl.mm:25
impeller::DeviceSupportsDeviceTransientTargets
static bool DeviceSupportsDeviceTransientTargets(id< MTLDevice > device)
Definition: allocator_mtl.mm:19

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 }
value
int32_t value
Definition: dl_golden_unittests.cc:459

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:

- impeller/renderer/backend/metal/allocator_mtl.h
- impeller/renderer/backend/metal/allocator_mtl.mm