prefetchStorage(with:imageDescriptorList:)
A method that helps the framework decide which allocations to make ahead of time.
Declaration
class func prefetchStorage(with commandBuffer: any MTLCommandBuffer, imageDescriptorList descriptorList: [MPSImageDescriptor])Parameters
- commandBuffer:
The command buffer on which the temporary images will be exclusively used.
- descriptorList:
An array of image descriptors that describe the temporary images that will be created.
Discussion
The texture cache that underlies the temporary images can automatically allocate new storage as needed, whenever you create new temporary images. However, sometimes a more global view of what you plan to make is useful for maximizing memory reuse to get the most efficient operation. Calling this class method provides a hint to the texture cache about what the list of temporary images will be.