且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在一个MTLRenderCommandEncoder中使用多个MTLRenderPipelineStates吗?

更新时间:2023-11-09 18:52:58

是的,您可以在一个渲染命令编码器中使用多个管道状态.这就是setRenderPipelineState()方法存在的原因,而不是管道状态成为渲染过程描述符的一部分的原因.渲染过程描述符中的属性仅在创建渲染命令编码器时读取,并且在该编码器的生命周期内无法更改.在编码器上可以独立设置的任何内容都可以在其使用期限内进行更改.

Yes, you can use multiple pipeline states in one render command encoder. That's precisely why the setRenderPipelineState() method exists, rather than the pipeline state being part of the render pass descriptor. The properties in the render pass descriptor are only read at the time of the creation of the render command encoder and can't be changed during the lifetime of that encoder. Anything which is independently settable on the encoder can be changed during its lifetime.