| 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)
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 | ( |  | ) |
| override default

## ◆ 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
| override virtual

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 }
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