Instance Method

primarySourceRegionForDestinationSize:

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

Declaration

- (MPSRegion)primarySourceRegionForDestinationSize:(MTLSize)destinationSize;

Parameters

destinationSize

The size of the full virtual destination image.

Return Value

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

Discussion

This method is used to determine which region of the primary source texture will be read by the encodeToCommandBuffer:primaryTexture:secondaryTexture:destinationTexture: method when the filter runs. This information may be needed if the primary 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 primaryOffset 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

Methods

- encodeToCommandBuffer:primaryTexture:inPlaceSecondaryTexture:fallbackCopyAllocator:

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

- encodeToCommandBuffer:inPlacePrimaryTexture:secondaryTexture:fallbackCopyAllocator:

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

- encodeToCommandBuffer:primaryTexture:secondaryTexture:destinationTexture:

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

- secondarySourceRegionForDestinationSize:

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