【发布时间】:2018-12-19 23:03:27
【问题描述】:
是否可以有一个MTLRenderPassDescriptor 渲染到深度或模板纹理,但没有颜色附件?像这样:
MTLRenderPassDescriptor* textureRenderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
MTLRenderPassStencilAttachmentDescriptor* textureAttachment = [[MTLRenderPassStencilAttachmentDescriptor alloc]init];
textureAttachment.texture = texture;
textureAttachment.loadAction = MTLLoadActionClear;
textureAttachment.storeAction = MTLStoreActionStore;
textureRenderPassDescriptor.stencilAttachment = textureAttachment;
我尝试这样做,但在尝试使用此管道状态时出现以下错误:
failed assertion `For color attachment 0, the renderPipelineState pixelFormat must be MTLPixelFormatInvalid, as no texture is set.'
【问题讨论】:
标签: metal