Function

CVMetalTextureCacheCreate

Creates a new texture cache.

Declaration

CVReturn CVMetalTextureCacheCreate(CFAllocatorRef allocator, CFDictionaryRef cacheAttributes, id<MTLDevice> metalDevice, CFDictionaryRef textureAttributes, CVMetalTextureCacheRef  _Nullable *cacheOut);

Parameters

allocator

The CFAllocatorRef to use for allocating the texture cache.

cacheAttributes

A dictionary specifying options for the cache’s behavior, or NULL to use default options. For applicable keys and values, see Cache Attributes.

metalDevice

The Metal device for which the cache will create texture objects.

textureAttributes

A dictionary specifying options for creating textures from the cache, or NULL to use default options.

cacheOut

Upon return, contains the newly created texture cache.

Return Value

Upon successful creation of the texture cache, this function returns kCVReturnSuccess.