#include <allocator_mtl.h>
Definition at line 15 of file allocator_mtl.h.
◆ AllocatorMTL()
impeller::AllocatorMTL::AllocatorMTL |
( |
| ) |
|
◆ ~AllocatorMTL()
impeller::AllocatorMTL::~AllocatorMTL |
( |
| ) |
|
|
overridedefault |
◆ GetMaxTextureSizeSupported()
ISize impeller::AllocatorMTL::GetMaxTextureSizeSupported |
( |
| ) |
const |
|
overrideprivatevirtual |
◆ MinimumBytesPerRow()
uint16_t impeller::AllocatorMTL::MinimumBytesPerRow |
( |
PixelFormat |
format | ) |
const |
|
overrideprivatevirtual |
Minimum value for row_bytes
on a Texture. The row bytes parameter of that method must be aligned to this value.
Reimplemented from impeller::Allocator.
Definition at line 222 of file allocator_mtl.mm.
222 {
223 return static_cast<uint16_t>([device_
225}
uint32_t uint32_t * format
constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format)
◆ OnCreateBuffer()
Implements impeller::Allocator.
Definition at line 174 of file allocator_mtl.mm.
175 {
177 desc.storage_mode, supports_memoryless_targets_, supports_uma_);
179 desc.storage_mode, supports_memoryless_targets_, supports_uma_);
180
181 auto buffer = [device_ newBufferWithLength:
desc.size
184 return nullptr;
185 }
186 return std::shared_ptr<DeviceBufferMTL>(new DeviceBufferMTL(desc,
188 storage_mode
189 ));
190}
static const uint8_t buffer[]
static MTLStorageMode ToMTLStorageMode(StorageMode mode, bool supports_memoryless_targets, bool supports_uma)
static MTLResourceOptions ToMTLResourceOptions(StorageMode type, bool supports_memoryless_targets, bool supports_uma)
◆ OnCreateTexture()
Implements impeller::Allocator.
Definition at line 192 of file allocator_mtl.mm.
193 {
194 if (!IsValid()) {
195 return nullptr;
196 }
197
199
200 if (!mtl_texture_desc) {
202 return nullptr;
203 }
204
206 desc.storage_mode, supports_memoryless_targets_, supports_uma_);
207
208 if (@available(macOS 12.5, ios 15.0, *)) {
211 mtl_texture_desc.compressionType = MTLTextureCompressionTypeLossy;
212 }
213 }
214
215 auto texture = [device_ newTextureWithDescriptor:mtl_texture_desc];
217 return nullptr;
218 }
220}
static std::shared_ptr< TextureMTL > Create(TextureDescriptor desc, id< MTLTexture > texture)
static bool SupportsLossyTextureCompression(id< MTLDevice > device)
MTLTextureDescriptor * ToMTLTextureDescriptor(const TextureDescriptor &desc)
◆ ContextMTL
The documentation for this class was generated from the following files: