您的位置:首页 > 其它

MTLRenderPassDescriptor

2016-04-03 13:38 399 查看
在创建MTLRenderCommandEncoder对象的时候需要传入 MTLRenderPassDescriptor 作为参数,  那么MTLRenderPassDescritpor 是个什么东西,  应该如何设置其中的参数呢?  

1. 创建 MTLRenderPassDescriptor

+ (MTLRenderPassDescriptor
*)renderPassDescriptor

2 常用的属性 

 (1)  colorAttachment    

    在定义中是数组(array).   继承自MTLRenderPassAttachmentDescritpor

 (2)  depthAttachment

    depthAttachment 也是继承自 MTLRenderPassAttachmentDescritpor, 所以常用的属性就很相似

3.  MTLRenderPassAttachmentDescritpor

其常用属性包括: 

       @property (nullable, nonatomic, strong) id<MTLTexture>  texture,  普通直接使用CAMetalLayer的nextDrawable中的texture

       @property (nonatomic)  MTLClearColor   clearColor

       @property (nonatomic) MTLStoreAction   storeAction

       @property (nonatomic) MTLLoadAction    loadAction
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: