| 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 106 of file allocator_mtl.mm.

107 : device_(device), allocator_label_(std::move(label)) {
108 if (!device_) {
109 return;
110 }
111
112 supports_memoryless_targets_ = DeviceSupportsDeviceTransientTargets(device_);
113 supports_uma_ = DeviceHasUnifiedMemoryArchitecture(device_);
114 max_texture_supported_ = DeviceMaxTextureSizeSupported(device_);
115
116 is_valid_ = true;
117 }
impeller::DeviceHasUnifiedMemoryArchitecture
static bool DeviceHasUnifiedMemoryArchitecture(id< MTLDevice > device)
Definition: allocator_mtl.mm:40
impeller::DeviceMaxTextureSizeSupported
ISize DeviceMaxTextureSizeSupported(id< MTLDevice > device)
Definition: allocator_mtl.mm:55
impeller::DeviceSupportsDeviceTransientTargets
static bool DeviceSupportsDeviceTransientTargets(id< MTLDevice > device)
Definition: allocator_mtl.mm:19

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

## Member Function Documentation

## ◆ DebugGetHeapUsage()

Bytes impeller::AllocatorMTL::DebugGetHeapUsage | ( |  | ) | const
| override virtual

Reimplemented from impeller::Allocator.

Definition at line 262 of file allocator_mtl.mm.

262 {
263 #ifdef IMPELLER_DEBUG
264 return debug_allocater_->GetAllocationSize();
265 #else
266 return {};
267 #endif // IMPELLER_DEBUG
268 }

## ◆ DebugSetSupportsUMA()

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

Definition at line 258 of file allocator_mtl.mm.

258 {
259 supports_uma_ = value;
260 }
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