Search code examples
iosmetalmetalkit

Can we use MTLRenderPipelineState & MTLDepthStencilState in multithread?


Can we use MTLRenderPipelineState & MTLDepthStencilState in multithread ? I mean can in thread A assign MTLRenderPipelineState to a RenderCommandEncoder and at the same time from thread B assign also this MTLRenderPipelineState to another RenderCommandEncoder? same for MTLDepthStencilState


Solution

  • Yes. Metal state objects are immutable and safe to use across threads.