1#import <Foundation/Foundation.h> 2 3@interface TestClass : NSObject 4@end 5 6@implementation TestClass 7 8- (void)drawSomething:(id<MTLCommandBuffer>)commandBuffer { 9 [renderPass performDrawBlock:^(id<MTLRenderCommandEncoder> renderCommandEncoder) { 10 screenBlitObject.texture = src; 11 12 // Make sure the pipeline state pixelformat is the same as destination pixel format 13 [screenBlitObject updatePipelineState:dst.pixelFormat]; 14 15 [screenBlitObject drawWithRenderCommandEncoder:renderCommandEncoder]; 16 } withTargetTexture:dst andCommandBuffer:commandBuffer]; 17} 18 19@end 20