Instance Method


Determines the region of the source texture that will be read for an encode operation.


- (MPSRegion)sourceRegionForDestinationSize:(MTLSize)destinationSize;



The size of the full virtual destination image.

Return Value

The area in the virtual source image that will be read.


This method is used to determine which region of the source texture will be read by the encodeToCommandBuffer:sourceTexture:destinationTexture: method when the filter runs. This information may be needed if the source image is broken into multiple textures. The size of the full (untiled) destination image is provided. The region of the full (untiled) source image that will be read is returned. You can then piece together an appropriate texture containing that information for use in your tiled context.

This method will consult the offset and clipRect properties to determine the full region read by the function. Other properties, such as kernel height and width, will be consulted as necessary. All properties should be set to their intended values prior to calling this method.

See Also


- encodeToCommandBuffer:inPlaceTexture:fallbackCopyAllocator:

This method attempts to apply a kernel in place on a texture.


A block to make a copy of a source texture for filters that can only execute out of place.

- encodeToCommandBuffer:sourceTexture:destinationTexture:

Encodes a kernel into a command buffer, out of place.