是否可以使用<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.13.1/lodash.min.js"></script>
来渲染深度或模版纹理,但没有颜色附件?像这样:
MTLRenderPassDescriptor
我尝试这样做,但是在尝试使用此管道状态时收到以下错误:
MTLRenderPassDescriptor* textureRenderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
MTLRenderPassStencilAttachmentDescriptor* textureAttachment = [[MTLRenderPassStencilAttachmentDescriptor alloc]init];
textureAttachment.texture = texture;
textureAttachment.loadAction = MTLLoadActionClear;
textureAttachment.storeAction = MTLStoreActionStore;
textureRenderPassDescriptor.stencilAttachment = textureAttachment;
答案 0 :(得分:3)
作为声明状态,创建pixelFormat
时需要将MTLRenderPipelineState
设置为无效:
pipelineStateDescriptor.colorAttachments[0].pixelFormat = MTLPixelFormatInvalid;