secondarySourceRegion(forDestinationSize:)
Determines the region of the secondary source texture that will be read for an encode operation.
Declaration
func secondarySourceRegion(forDestinationSize destinationSize: MTLSize) -> MPSRegionParameters
- 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 secondary source texture will be read by the encode(commandBuffer:primaryTexture:secondaryTexture:destinationTexture:) method when the filter runs. This information may be needed if the secondary 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 secondaryOffset 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
encode(commandBuffer:primaryTexture:inPlaceSecondaryTexture:fallbackCopyAllocator:)encode(commandBuffer:inPlacePrimaryTexture:secondaryTexture:fallbackCopyAllocator:)encode(commandBuffer:primaryTexture:secondaryTexture:destinationTexture:)encode(commandBuffer:primaryImage:secondaryImage:destinationImage:)primarySourceRegion(forDestinationSize:)