// // SCMetalModule.h // Snapchat // // Created by Michel Loenngren on 7/19/17. // // #import "SCMetalTextureResource.h" #import "SCMetalUtils.h" #import "SCProcessingModule.h" #import @protocol SCMetalModuleFunctionProvider @property (nonatomic, readonly) NSString *functionName; @end @protocol SCMetalRenderCommand /** Sets textures and parameters for the shader function. When implementing this function, the command encoder must be computed and the pipeline state set. That is, ensure that there are calls to: [commandBuffer computeCommandEncoder] and [commandEncoder setComputePipelineState:pipelineState]. */ #if !TARGET_IPHONE_SIMULATOR - (id)encodeMetalCommand:(id)commandBuffer pipelineState:(id)pipelineState textureResource:(SCMetalTextureResource *)textureResource; #endif - (BOOL)requiresDepthData; @end /** NOTE: If we start chaining multiple metal modules we should not run them back to back but instead chain different render passes. */ @interface SCMetalModule : NSObject // Designated initializer: SCMetalModule should always have a SCMetalRenderCommand - (instancetype)initWithMetalRenderCommand:(id)metalRenderCommand; @end